Commit 4cd72c48 authored by yogevbd's avatar yogevbd

Fix push receiving from dead state

parent 3676811e
...@@ -92,7 +92,6 @@ public class PushNotification implements IPushNotification { ...@@ -92,7 +92,6 @@ public class PushNotification implements IPushNotification {
protected void digestNotification() { protected void digestNotification() {
if (!mAppLifecycleFacade.isReactInitialized()) { if (!mAppLifecycleFacade.isReactInitialized()) {
setAsInitialNotification(); setAsInitialNotification();
launchOrResumeApp();
return; return;
} }
...@@ -122,10 +121,6 @@ public class PushNotification implements IPushNotification { ...@@ -122,10 +121,6 @@ public class PushNotification implements IPushNotification {
protected void dispatchUponVisibility() { protected void dispatchUponVisibility() {
mAppLifecycleFacade.addVisibilityListener(getIntermediateAppVisibilityListener()); mAppLifecycleFacade.addVisibilityListener(getIntermediateAppVisibilityListener());
// Make the app visible so that we'll dispatch the notification opening when visibility changes to 'true' (see
// above listener registration).
launchOrResumeApp();
} }
protected AppVisibilityListener getIntermediateAppVisibilityListener() { protected AppVisibilityListener getIntermediateAppVisibilityListener() {
...@@ -197,9 +192,4 @@ public class PushNotification implements IPushNotification { ...@@ -197,9 +192,4 @@ public class PushNotification implements IPushNotification {
private void notifyOpenedToJS() { private void notifyOpenedToJS() {
mJsIOHelper.sendEventToJS(NOTIFICATION_OPENED_EVENT_NAME, mNotificationProps.asBundle(), mAppLifecycleFacade.getRunningReactContext()); mJsIOHelper.sendEventToJS(NOTIFICATION_OPENED_EVENT_NAME, mNotificationProps.asBundle(), mAppLifecycleFacade.getRunningReactContext());
} }
protected void launchOrResumeApp() {
final Intent intent = mAppLaunchHelper.getLaunchIntent(mContext);
mContext.startActivity(intent);
}
} }
{ {
"name": "react-native-notifications", "name": "react-native-notifications",
"version": "1.2.4", "version": "1.2.5",
"description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android", "description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android",
"author": "Lidan Hifi <lidan.hifi@gmail.com>", "author": "Lidan Hifi <lidan.hifi@gmail.com>",
"license": "MIT", "license": "MIT",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment