I have a use case where I need to register an <intent-filter>
in the AndroidManifest
so the app can receive and handle images. According to the React Native documentation:
You can pass properties down to the React Native app by providing a custom implementation of ReactActivityDelegate in your main activity. This implementation should override getLaunchOptions to return a Bundle with the desired properties.
Easy, right? I can just override getLaunchOptions
, examine the incoming Intent
, check for extras, build the bundle, and return it.
Well, the thing is that the main activity extends NavigationActivity
, which extends AppCompatActivity
, and not ReactActivity
. So I'm unable to provide the custom implementation because method protected ReactActivityDelegate createReactActivityDelegate()
does not exist in NavigationActivity
.
Am I missing something here? Thank you in advanced!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.
I have exactly the same thing going on!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.
The issue has been closed for inactivity.
@phanghos @hannojg did you get a solution?
I got an method here of https://dev.to/ryohlan/how-to-pass-initial-props-from-android-native-2k2
public class MainActivity extends ReactActivity {
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Nullable
@Override
protected Bundle getLaunchOptions() {
Bundle bundle = new Bundle();
bundle.putString("message", "Hello world from Android Native");
return bundle;
}
};
}
...
}
but it use the method from class of ReactActivity, I am not sure how to do with NavigationActivity