2022-04-07 19:14:04 +00:00
|
|
|
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) {
|
2023-07-03 21:20:51 +00:00
|
|
|
diff --git a/node_modules/react-native-notifications/lib/android/app/build.gradle b/node_modules/react-native-notifications/lib/android/app/build.gradle
|
|
|
|
index d049e84..9ad7004 100644
|
|
|
|
--- a/node_modules/react-native-notifications/lib/android/app/build.gradle
|
|
|
|
+++ b/node_modules/react-native-notifications/lib/android/app/build.gradle
|
|
|
|
@@ -96,9 +96,9 @@ android {
|
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests.all { t ->
|
|
|
|
- reports {
|
|
|
|
- html.enabled true
|
|
|
|
- }
|
|
|
|
+ // reports {
|
|
|
|
+ // html.enabled true
|
|
|
|
+ // }
|
|
|
|
testLogging {
|
|
|
|
events "PASSED", "SKIPPED", "FAILED", "standardOut", "standardError"
|
|
|
|
}
|
2022-10-04 13:25:31 +00:00
|
|
|
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
|
2022-11-16 21:09:46 +00:00
|
|
|
index a249c6a..5b1e9c7 100644
|
2022-10-04 13:25:31 +00:00
|
|
|
--- 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
|
2022-11-16 21:09:46 +00:00
|
|
|
@@ -19,6 +19,7 @@ import com.wix.reactnativenotifications.core.notification.IPushNotification;
|
|
|
|
import com.wix.reactnativenotifications.core.notification.PushNotification;
|
2022-11-04 16:33:03 +00:00
|
|
|
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;
|
2022-11-16 21:09:46 +00:00
|
|
|
@@ -66,7 +67,13 @@ public class RNNotificationsPackage implements ReactPackage, AppLifecycleFacade.
|
2022-11-04 16:33:03 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onActivityStarted(Activity activity) {
|
2022-11-16 21:09:46 +00:00
|
|
|
- if (InitialNotificationHolder.getInstance().get() == null) {
|
2022-11-04 16:33:03 +00:00
|
|
|
+ boolean isReactInitialized = false;
|
|
|
|
+ if (AppLifecycleFacadeHolder.get() instanceof ReactAppLifecycleFacade) {
|
|
|
|
+ isReactInitialized = AppLifecycleFacadeHolder.get().isReactInitialized();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (InitialNotificationHolder.getInstance().get() == null && !isReactInitialized) {
|
2022-11-16 21:09:46 +00:00
|
|
|
+
|
2022-11-04 16:33:03 +00:00
|
|
|
callOnOpenedIfNeed(activity);
|
|
|
|
}
|
|
|
|
}
|
2022-11-16 21:09:46 +00:00
|
|
|
@@ -95,8 +102,7 @@ public class RNNotificationsPackage implements ReactPackage, AppLifecycleFacade.
|
2022-10-04 13:25:31 +00:00
|
|
|
Intent intent = activity.getIntent();
|
|
|
|
if (NotificationIntentAdapter.canHandleIntent(intent)) {
|
|
|
|
Context appContext = mApplication.getApplicationContext();
|
2022-11-16 21:09:46 +00:00
|
|
|
- Bundle notificationData = NotificationIntentAdapter.canHandleTrampolineActivity(appContext) ?
|
|
|
|
- intent.getExtras() : NotificationIntentAdapter.extractPendingNotificationDataFromIntent(intent);
|
2022-10-04 13:25:31 +00:00
|
|
|
+ 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
|
2022-11-16 21:09:46 +00:00
|
|
|
index 70f609a..4484808 100644
|
2022-10-04 13:25:31 +00:00
|
|
|
--- 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) {
|
2022-11-16 21:09:46 +00:00
|
|
|
- if (canHandleTrampolineActivity(appContext)) {
|
|
|
|
- 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);
|
|
|
|
- } else {
|
2022-10-04 13:25:31 +00:00
|
|
|
- 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);
|
|
|
|
- }
|
|
|
|
+ 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);
|
|
|
|
}
|
|
|
|
|
2022-11-16 21:09:46 +00:00
|
|
|
public static boolean canHandleTrampolineActivity(Context appContext) {
|
2022-04-07 19:14:04 +00:00
|
|
|
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
|
2022-11-16 21:09:46 +00:00
|
|
|
index eade08d..a9f2864 100644
|
2022-04-07 19:14:04 +00:00
|
|
|
--- 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) {
|
2022-09-23 20:35:03 +00:00
|
|
|
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 <React/RCTConvert.h>
|
|
|
|
-@import UserNotifications;
|
|
|
|
+#import <UserNotifications/UserNotifications.h>
|
|
|
|
|
|
|
|
@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
|
2022-11-16 21:09:46 +00:00
|
|
|
index 4bc5292..71df0bc 100644
|
2022-09-23 20:35:03 +00:00
|
|
|
--- 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;
|
2022-11-16 21:09:46 +00:00
|
|
|
+#import <UserNotifications/UserNotifications.h>
|
2022-09-23 20:35:03 +00:00
|
|
|
|
|
|
|
@interface RNNotificationCenter : NSObject
|
|
|
|
|
2022-11-16 21:09:46 +00:00
|
|
|
diff --git a/node_modules/react-native-notifications/lib/ios/RNNotificationCenterListener.h b/node_modules/react-native-notifications/lib/ios/RNNotificationCenterListener.h
|
|
|
|
index 77a67dd..eaf0043 100644
|
|
|
|
--- a/node_modules/react-native-notifications/lib/ios/RNNotificationCenterListener.h
|
|
|
|
+++ b/node_modules/react-native-notifications/lib/ios/RNNotificationCenterListener.h
|
|
|
|
@@ -1,5 +1,5 @@
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
-@import UserNotifications;
|
|
|
|
+#import <UserNotifications/UserNotifications.h>
|
|
|
|
#import "RNNotificationEventHandler.h"
|
|
|
|
|
|
|
|
@interface RNNotificationCenterListener : NSObject <UNUserNotificationCenterDelegate>
|
2022-09-23 20:35:03 +00:00
|
|
|
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 <Foundation/Foundation.h>
|
|
|
|
-@import UserNotifications;
|
|
|
|
+#import <UserNotifications/UserNotifications.h>
|
|
|
|
#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 <Foundation/Foundation.h>
|
|
|
|
-@import UserNotifications;
|
|
|
|
+#import <UserNotifications/UserNotifications.h>
|
|
|
|
|
|
|
|
@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 <Foundation/Foundation.h>
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
-@import UserNotifications;
|
|
|
|
+#import <UserNotifications/UserNotifications.h>
|
|
|
|
|
|
|
|
@interface RNNotificationsStore : NSObject
|
|
|
|
|