mirror of
https://github.com/expo/config-plugins.git
synced 2026-11-13 20:28:07 -10:00
fix(android): added onNewIntent handler
This commit is contained in:
2 files changed
+11
-2
No files matched your search
@@ -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).
|
||||
|
||||
+10
-1
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user