Open itsrifat opened 7 years ago
I did some digging around and looks like Line 24 of ReactNativeUAReceiver.java
is always returning false when the app is in background, an hence ReactNativeUAEventEmitter
's sendEvent
is not getting triggered.
If I comment out the isRunning
check on line 26,
if (ReactNativeUAEventEmitter.getInstance() != null) // instead of if (isRunning && ReactNativeUAEventEmitter.getInstance() != null)
My on_notification
code on the js side gets executed fine whether the app is in background or foreground.
Is there any way around this?
@arthursz, Any thoughts?
@itsrifat It looks like react only gets setup from an activity. Thats not always going to happen when an Android application is woken up in the background, so the react context will not be setup. This seems to be a limitation with react and not this plugin.
I have set up the project for both ios and android.
onNotificationOpened
andonNotificationReceived
works fine for android, but nothing happens if the app is in background. For ios,on_notification
gets triggered in background if the background processing flag is turned on for a message in Urban Airship. Am I missing something?