I\'m building a react native module, from my module I send a PendingIntent like this.
Intent postAuthorizationIntent = new Intent(\"com.example.HANDLE_AUTHOR
I had this same issue and fixed it by calling super.onNewIntent(intent)
from MainActivity
:
@Override
public void onNewIntent(Intent intent) {
setIntent(intent);
super.onNewIntent(intent);
}
With this in place, onNewIntent
is called in your module - assuming your module implements ActivityEventListener
and you've registered it as a listener in the constructor:
reactContext.addActivityEventListener(this);
Ok I solved the issue.
public class RNSsfAuthModule extends ReactContextBaseJavaModule implements ActivityEventListener, Application.ActivityLifecycleCallbacks{
....
public ExampleModule(ReactApplicationContext reactContext, Application application) {
super(reactContext);
...
reactContext.addActivityEventListener(this);
application.registerActivityLifecycleCallbacks(this);
}
...
@Override
public void onActivityStarted(Activity activity) {
checkIntent(activity.getIntent());
}
}