diff --git a/node_modules/react-native-notifications/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java b/node_modules/react-native-notifications/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java index f9c858b..94ea188 100644 --- a/node_modules/react-native-notifications/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java +++ b/node_modules/react-native-notifications/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java @@ -2,8 +2,8 @@ package com.wix.reactnativenotifications; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.v4.app.NotificationManagerCompat; +import androidx.annotation.NonNull; +import androidx.core.app.NotificationManagerCompat; public abstract class NotificationManagerCompatFacade { public static NotificationManagerCompat from(@NonNull Context context) { diff --git a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java index 90969b2..4c00e69 100644 --- a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java +++ b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsModule.java @@ -63,7 +63,7 @@ public class RNNotificationsModule extends ReactContextBaseJavaModule implements @Override public void onNewIntent(Intent intent) { if (NotificationIntentAdapter.canHandleIntent(intent)) { - Bundle notificationData = intent.getExtras(); + Bundle notificationData = NotificationIntentAdapter.extractPendingNotificationDataFromIntent(intent); final IPushNotification notification = PushNotification.get(getReactApplicationContext().getApplicationContext(), notificationData); if (notification != null) { notification.onOpened(); diff --git a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java index c090247..494aae8 100644 --- a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java +++ b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/RNNotificationsPackage.java @@ -20,6 +20,7 @@ import com.wix.reactnativenotifications.core.notification.PushNotification; import com.wix.reactnativenotifications.core.notification.PushNotificationProps; import com.wix.reactnativenotifications.core.notificationdrawer.IPushNotificationsDrawer; import com.wix.reactnativenotifications.core.notificationdrawer.PushNotificationsDrawer; +import com.wix.reactnativenotifications.core.ReactAppLifecycleFacade; import java.util.Arrays; import java.util.Collections; @@ -67,7 +68,12 @@ public class RNNotificationsPackage implements ReactPackage, AppLifecycleFacade. @Override public void onActivityStarted(Activity activity) { - if (InitialNotificationHolder.getInstance().get() != null) { + boolean isReactInitialized = false; + if (AppLifecycleFacadeHolder.get() instanceof ReactAppLifecycleFacade) { + isReactInitialized = AppLifecycleFacadeHolder.get().isReactInitialized(); + } + + if (InitialNotificationHolder.getInstance().get() == null && !isReactInitialized) { callOnOpenedIfNeed(activity); } } @@ -96,8 +102,7 @@ public class RNNotificationsPackage implements ReactPackage, AppLifecycleFacade. Intent intent = activity.getIntent(); if (NotificationIntentAdapter.canHandleIntent(intent)) { Context appContext = mApplication.getApplicationContext(); - Bundle notificationData = NotificationIntentAdapter.cannotHandleTrampolineActivity(appContext) ? - NotificationIntentAdapter.extractPendingNotificationDataFromIntent(intent) : intent.getExtras(); + Bundle notificationData = NotificationIntentAdapter.extractPendingNotificationDataFromIntent(intent); final IPushNotification pushNotification = PushNotification.get(appContext, notificationData); if (pushNotification != null) { pushNotification.onOpened(); diff --git a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java index 41b4824..4285ac5 100644 --- a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java +++ b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java @@ -14,17 +14,9 @@ public class NotificationIntentAdapter { @SuppressLint("UnspecifiedImmutableFlag") public static PendingIntent createPendingNotificationIntent(Context appContext, PushNotificationProps notification) { - if (cannotHandleTrampolineActivity(appContext)) { - Intent mainActivityIntent = appContext.getPackageManager().getLaunchIntentForPackage(appContext.getPackageName()); - mainActivityIntent.putExtra(PUSH_NOTIFICATION_EXTRA_NAME, notification.asBundle()); - TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(appContext); - taskStackBuilder.addNextIntentWithParentStack(mainActivityIntent); - return taskStackBuilder.getPendingIntent((int) System.currentTimeMillis(), PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); - } else { - Intent intent = new Intent(appContext, ProxyService.class); - intent.putExtra(PUSH_NOTIFICATION_EXTRA_NAME, notification.asBundle()); - return PendingIntent.getService(appContext, (int) System.currentTimeMillis(), intent, PendingIntent.FLAG_ONE_SHOT); - } + Intent intent = appContext.getPackageManager().getLaunchIntentForPackage(appContext.getPackageName()); + intent.putExtra(PUSH_NOTIFICATION_EXTRA_NAME, notification.asBundle()); + return PendingIntent.getActivity(appContext, (int) System.currentTimeMillis(), intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); } public static boolean cannotHandleTrampolineActivity(Context appContext) { diff --git a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java index 54a5fb8..06bbfb9 100644 --- a/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java +++ b/node_modules/react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java @@ -28,7 +28,7 @@ public class PushNotification implements IPushNotification { final protected AppLifecycleFacade mAppLifecycleFacade; final protected AppLaunchHelper mAppLaunchHelper; final protected JsIOHelper mJsIOHelper; - final protected PushNotificationProps mNotificationProps; + protected PushNotificationProps mNotificationProps; final protected AppVisibilityListener mAppVisibilityListener = new AppVisibilityListener() { @Override public void onAppVisible() { diff --git a/node_modules/react-native-notifications/lib/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java b/node_modules/react-native-notifications/lib/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java index f9c858b..94ea188 100644 --- a/node_modules/react-native-notifications/lib/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java +++ b/node_modules/react-native-notifications/lib/android/app/src/reactNative59/java/com/wix/reactnativenotifications/NotificationManagerCompatFacade.java @@ -2,8 +2,8 @@ package com.wix.reactnativenotifications; import android.content.Context; -import android.support.annotation.NonNull; -import android.support.v4.app.NotificationManagerCompat; +import androidx.annotation.NonNull; +import androidx.core.app.NotificationManagerCompat; public abstract class NotificationManagerCompatFacade { public static NotificationManagerCompat from(@NonNull Context context) { diff --git a/node_modules/react-native-notifications/lib/ios/RCTConvert+RNNotifications.h b/node_modules/react-native-notifications/lib/ios/RCTConvert+RNNotifications.h index 8b2c269..8667351 100644 --- a/node_modules/react-native-notifications/lib/ios/RCTConvert+RNNotifications.h +++ b/node_modules/react-native-notifications/lib/ios/RCTConvert+RNNotifications.h @@ -1,5 +1,5 @@ #import -@import UserNotifications; +#import @interface RCTConvert (UIMutableUserNotificationAction) + (UIMutableUserNotificationAction *)UIMutableUserNotificationAction:(id)json; diff --git a/node_modules/react-native-notifications/lib/ios/RNNotificationCenter.h b/node_modules/react-native-notifications/lib/ios/RNNotificationCenter.h index 4bc5292..4839d55 100644 --- a/node_modules/react-native-notifications/lib/ios/RNNotificationCenter.h +++ b/node_modules/react-native-notifications/lib/ios/RNNotificationCenter.h @@ -4,7 +4,7 @@ typedef void (^RCTPromiseResolveBlock)(id result); typedef void (^RCTResponseSenderBlock)(NSArray *response); typedef void (^RCTPromiseRejectBlock)(NSString *code, NSString *message, NSError *error); -@import UserNotifications; +#import @interface RNNotificationCenter : NSObject diff --git a/node_modules/react-native-notifications/lib/ios/RNNotificationEventHandler.h b/node_modules/react-native-notifications/lib/ios/RNNotificationEventHandler.h index a07c6e9..8e3ca6a 100644 --- a/node_modules/react-native-notifications/lib/ios/RNNotificationEventHandler.h +++ b/node_modules/react-native-notifications/lib/ios/RNNotificationEventHandler.h @@ -1,5 +1,5 @@ #import -@import UserNotifications; +#import #import "RNNotificationsStore.h" #import "RNEventEmitter.h" diff --git a/node_modules/react-native-notifications/lib/ios/RNNotificationParser.h b/node_modules/react-native-notifications/lib/ios/RNNotificationParser.h index 7aa2bfb..c1c019c 100644 --- a/node_modules/react-native-notifications/lib/ios/RNNotificationParser.h +++ b/node_modules/react-native-notifications/lib/ios/RNNotificationParser.h @@ -1,5 +1,5 @@ #import -@import UserNotifications; +#import @interface RNNotificationParser : NSObject diff --git a/node_modules/react-native-notifications/lib/ios/RNNotificationsStore.h b/node_modules/react-native-notifications/lib/ios/RNNotificationsStore.h index 4f8a171..7e4f9ca 100644 --- a/node_modules/react-native-notifications/lib/ios/RNNotificationsStore.h +++ b/node_modules/react-native-notifications/lib/ios/RNNotificationsStore.h @@ -1,6 +1,6 @@ #import #import -@import UserNotifications; +#import @interface RNNotificationsStore : NSObject