Skip to content

Commit

Permalink
Fix Issue #255
Browse files Browse the repository at this point in the history
Fix issue #255 - Attempt to invoke virtual method 'int android.content.Intent.getFlags()' on a null object reference
  • Loading branch information
RodrigoSMarques committed Nov 10, 2023
1 parent 6e11aa9 commit 39e9915
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 84 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 7.0.1
* Fix issue #255: `Attempt to invoke virtual method 'int android.content.Intent.getFlags()' on a null object reference`

## 7.0.0
⚠️ This is a major release which contains breaking API changes.
### BREAKING CHANGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.branch.referral.util.LinkProperties;
import io.branch.referral.util.ShareSheetStyle;
import io.branch.referral.validators.IntegrationValidator;
import io.flutter.BuildConfig;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
Expand Down Expand Up @@ -99,6 +100,7 @@ private void setupChannels(BinaryMessenger messenger, Context context) {
private void setActivity(Activity activity) {
LogUtils.debug(DEBUG_NAME, "setActivity call");
this.activity = activity;
initialIntent = activity.getIntent();
activity.getApplication().registerActivityLifecycleCallbacks(this);
}

Expand Down Expand Up @@ -182,7 +184,6 @@ public void onActivityCreated(Activity activity, Bundle bundle) {
public void onActivityStarted(Activity activity) {
LogUtils.debug(DEBUG_NAME, "onActivityStarted call");
if (!isInitialized) {
initialIntent = activity.getIntent();
return;
}
Branch.sessionBuilder(activity).withCallback(branchReferralInitListener).withData(activity.getIntent().getData()).init();
Expand Down Expand Up @@ -445,6 +446,7 @@ private void setupBranch(MethodCall call, final Result result) {
Branch.getInstance().disableTracking(true);
}
this.context.startActivity(initialIntent);

result.success(Boolean.TRUE);
}

Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- BranchSDK (3.0.0)
- Flutter (1.0.0)
- flutter_branch_sdk (7.0.0-beta.2):
- flutter_branch_sdk (7.0.0):
- BranchSDK (~> 3.0.0)
- Flutter

Expand All @@ -22,8 +22,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
BranchSDK: e9c0332b2655cf0357d93db479d07152b059e434
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_branch_sdk: d44ccbe957868d4ff816258a436c23959f6e4cda
flutter_branch_sdk: 1a1b950264cf647d44b221386e64add8a56df78a

PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048

COCOAPODS: 1.13.0
COCOAPODS: 1.13.0
148 changes: 74 additions & 74 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Flutter Branch Sdk</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_branch_sdk_example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>flutterbranchsdk</string>
</array>
<key>CFBundleURLName</key>
<string>br.com.rsmarques.flutter-branch-sdk-example</string>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSUserTrackingUsageDescription</key>
<string>App would like to access IDFA for tracking purpose</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>branch_key</key>
<dict>
<key>live</key>
<string>key_live_bkJRqpb15wLqUAgsDVNUIobjyviWi6Wx</string>
<key>test</key>
<string>key_test_ipQTteg11ENANDeCzSXgqdgfuycWoXYH</string>
</dict>
<key>branch_universal_link_domains</key>
<array>
<string>flutterbranchsdk.app.link</string>
<string>flutterbranchsdk-alternate.app.link</string>
<string>flutterbranchsdk-alternate.test-app.link</string>
<string>flutterbranchsdk.test-app.link</string>
</array>
<key>UIApplicationSupportsIndirectInputEvents</key>
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Flutter Branch Sdk</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_branch_sdk_example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>flutterbranchsdk</string>
</array>
<key>CFBundleURLName</key>
<string>br.com.rsmarques.flutter-branch-sdk-example</string>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSUserTrackingUsageDescription</key>
<string>App would like to access IDFA for tracking purpose</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>branch_key</key>
<dict>
<key>test</key>
<string>key_test_ipQTteg11ENANDeCzSXgqdgfuycWoXYH</string>
<key>live</key>
<string>key_live_bkJRqpb15wLqUAgsDVNUIobjyviWi6Wx</string>
</dict>
<key>branch_universal_link_domains</key>
<array>
<string>flutterbranchsdk.app.link</string>
<string>flutterbranchsdk-alternate.app.link</string>
<string>flutterbranchsdk-alternate.test-app.link</string>
<string>flutterbranchsdk.test-app.link</string>
</array>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void main() async {
*/
//await FlutterBranchSdk.requestTrackingAuthorization();
await FlutterBranchSdk.init(
useTestKey: false, enableLogging: false, disableTracking: false);
useTestKey: true, enableLogging: true, disableTracking: false);
runApp(const MyApp());
}

Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ packages:
path: ".."
relative: true
source: path
version: "7.0.0"
version: "7.0.1"
flutter_lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -214,4 +214,4 @@ packages:
version: "0.1.4-beta"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.3.0"
flutter: ">=3.3.0"
2 changes: 1 addition & 1 deletion lib/src/flutter_branch_sdk_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'objects/branch_universal_object.dart';

/// An implementation of [FlutterBranchSdkPlatform] that uses method channels.
class FlutterBranchSdkMethodChannel implements FlutterBranchSdkPlatform {
static const PLUGIN_VERSION = "7.0.0";
static const PLUGIN_VERSION = "7.0.1";
static const MESSAGE_CHANNEL = 'flutter_branch_sdk/message';
static const EVENT_CHANNEL = 'flutter_branch_sdk/event';

Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ packages:
version: "0.1.4-beta"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.3.0"
flutter: ">=3.3.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_branch_sdk
description: Flutter Plugin for create deep link using Brach SDK (https://branch.io). This plugin provides a cross-platform (iOS, Android, Web).
version: 7.0.0
version: 7.0.1
homepage: https://github.com/RodrigoSMarques/flutter_branch_sdk

environment:
Expand Down

0 comments on commit 39e9915

Please sign in to comment.