fix(android): added onNewIntent handler

This commit is contained in:
Giau. Tran Minh committed 2022-01-20 15:46:34 +07:00
1 parent a98a6e022f
commit 31ed9978ca
2 files changed
+11 -2

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ Config plugin to auto configure `react-native-branch` when the native code is ge
## Expo installation
> Tested against Expo SDK 43
> Tested against Expo SDK 44
> This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
> First install the package with yarn, npm, or [`expo install`](https://docs.expo.io/workflow/expo-cli/#expo-install).
@@ -2,12 +2,21 @@ package expo.modules.adapters.branch
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import expo.modules.core.interfaces.ReactActivityLifecycleListener
import io.branch.rnbranch.*
import io.branch.rnbranch.RNBranchModule
class BranchReactActivityLifecycleListener(activityContext: Context) : ReactActivityLifecycleListener {
override fun onCreate(activity: Activity, savedInstanceState: Bundle?) {
RNBranchModule.initSession(activity.getIntent().getData(), activity);
}
override fun onNewIntent(intent: Intent?): Boolean {
if (intent != null) {
RNBranchModule.onNewIntent(intent);
}
return false
}
}