pushwoosh-react-native-plugin 6.1.59 → 6.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pushwoosh-react-native-plugin.podspec +2 -2
- package/src/android/build.gradle +1 -1
- package/src/android/proguard-rules.pro +1 -1
- package/src/ios/PushwooshPlugin/Pushwoosh.m +37 -16
- package/src/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
- package/src/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
- package/src/android/.gradle/5.6.4/gc.properties +0 -0
- package/src/android/.gradle/vcs-1/gc.properties +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = "pushwoosh-react-native-plugin"
|
|
3
|
-
s.version = "6.1.
|
|
3
|
+
s.version = "6.1.60"
|
|
4
4
|
s.summary = "React Native Pushwoosh Push Notifications module"
|
|
5
5
|
s.requires_arc = true
|
|
6
6
|
s.author = 'Pushwoosh'
|
|
@@ -15,6 +15,6 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
|
|
17
17
|
s.dependency 'React'
|
|
18
|
-
s.dependency 'PushwooshXCFramework', '7.2.
|
|
18
|
+
s.dependency 'PushwooshXCFramework', '7.2.5'
|
|
19
19
|
s.dependency 'PushwooshInboxUIXCFramework'
|
|
20
20
|
end
|
package/src/android/build.gradle
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Add project specific ProGuard rules here.
|
|
2
2
|
# By default, the flags in this file are appended to flags specified
|
|
3
|
-
# in /
|
|
3
|
+
# in $HOME/Library/Android/sdk/tools/proguard/proguard-android.txt
|
|
4
4
|
# You can edit the include path and order by changing the proguardFiles
|
|
5
5
|
# directive in build.gradle.
|
|
6
6
|
#
|
|
@@ -78,6 +78,27 @@ static NSString * const kPushOpenEvent = @"PWPushOpen";
|
|
|
78
78
|
static NSString * const kPushOpenJSEvent = @"pushOpened";
|
|
79
79
|
static NSString * const kPushReceivedJSEvent = @"pushReceived";
|
|
80
80
|
|
|
81
|
+
/// Returns the push link only when it is a deep link this app can route itself, otherwise nil.
|
|
82
|
+
///
|
|
83
|
+
/// http/https links are left to the native SDK: it checks the host's apple-app-site-association
|
|
84
|
+
/// and either hands the link to the app's Universal Links handler (own domain) or opens the
|
|
85
|
+
/// browser (anyone else's). Handing those to RCTLinking too made every external link land in JS
|
|
86
|
+
/// as if it were an in-app destination.
|
|
87
|
+
static NSURL * pwplugin_deepLinkURLFromPushLink(id link) {
|
|
88
|
+
if (![link isKindOfClass:[NSString class]] || [link length] == 0) {
|
|
89
|
+
return nil;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
NSURL *url = [NSURL URLWithString:link];
|
|
93
|
+
NSString *scheme = url.scheme.lowercaseString;
|
|
94
|
+
|
|
95
|
+
if (scheme.length == 0 || [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]) {
|
|
96
|
+
return nil;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return url;
|
|
100
|
+
}
|
|
101
|
+
|
|
81
102
|
@interface PushwooshPlugin (InnerPushwooshPlugin)
|
|
82
103
|
|
|
83
104
|
- (void) application:(UIApplication *)application pwplugin_didRegisterWithDeviceToken:(NSData *)deviceToken;
|
|
@@ -212,12 +233,12 @@ RCT_EXPORT_METHOD(init:(NSDictionary*)config success:(RCTResponseSenderBlock)suc
|
|
|
212
233
|
}
|
|
213
234
|
|
|
214
235
|
if (gStartPushData) {
|
|
215
|
-
|
|
216
|
-
|
|
236
|
+
NSURL *deepLink = pwplugin_deepLinkURLFromPushLink(gStartPushData[@"l"]);
|
|
237
|
+
|
|
217
238
|
//get deeplink from the payload and write it to the launchOptions for proper RCTLinking behavior
|
|
218
|
-
if (
|
|
239
|
+
if (deepLink) {
|
|
219
240
|
NSMutableDictionary *launchOptions = self.bridge.launchOptions.mutableCopy;
|
|
220
|
-
launchOptions[UIApplicationLaunchOptionsURLKey] =
|
|
241
|
+
launchOptions[UIApplicationLaunchOptionsURLKey] = deepLink;
|
|
221
242
|
[self.bridge setValue:launchOptions forKey:@"launchOptions"];
|
|
222
243
|
}
|
|
223
244
|
|
|
@@ -1001,9 +1022,9 @@ RCT_EXPORT_METHOD(getRichMediaType:(RCTResponseSenderBlock)callback) {
|
|
|
1001
1022
|
if (onStart) {
|
|
1002
1023
|
gStartPushData = pushNotification;
|
|
1003
1024
|
// Save deep link URL for New Architecture (Linking.getInitialURL support)
|
|
1004
|
-
|
|
1005
|
-
if (
|
|
1006
|
-
gPushDeepLinkURL =
|
|
1025
|
+
NSURL *deepLink = pwplugin_deepLinkURLFromPushLink(pushNotification[@"l"]);
|
|
1026
|
+
if (deepLink) {
|
|
1027
|
+
gPushDeepLinkURL = deepLink;
|
|
1007
1028
|
}
|
|
1008
1029
|
}
|
|
1009
1030
|
}
|
|
@@ -1011,9 +1032,9 @@ RCT_EXPORT_METHOD(getRichMediaType:(RCTResponseSenderBlock)callback) {
|
|
|
1011
1032
|
if (onStart) {
|
|
1012
1033
|
gStartPushData = pushNotification;
|
|
1013
1034
|
// Save deep link URL for New Architecture (Linking.getInitialURL support)
|
|
1014
|
-
|
|
1015
|
-
if (
|
|
1016
|
-
gPushDeepLinkURL =
|
|
1035
|
+
NSURL *deepLink = pwplugin_deepLinkURLFromPushLink(pushNotification[@"l"]);
|
|
1036
|
+
if (deepLink) {
|
|
1037
|
+
gPushDeepLinkURL = deepLink;
|
|
1017
1038
|
}
|
|
1018
1039
|
}
|
|
1019
1040
|
}
|
|
@@ -1040,9 +1061,9 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
|
|
1040
1061
|
// Capture deep link from push notification on cold start
|
|
1041
1062
|
if ([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
|
|
1042
1063
|
NSDictionary *userInfo = response.notification.request.content.userInfo;
|
|
1043
|
-
|
|
1044
|
-
if (
|
|
1045
|
-
gPushDeepLinkURL =
|
|
1064
|
+
NSURL *deepLink = pwplugin_deepLinkURLFromPushLink(userInfo[@"l"]);
|
|
1065
|
+
if (deepLink) {
|
|
1066
|
+
gPushDeepLinkURL = deepLink;
|
|
1046
1067
|
}
|
|
1047
1068
|
}
|
|
1048
1069
|
|
|
@@ -1101,9 +1122,9 @@ static PWEarlyNotificationDelegate *gEarlyDelegate = nil;
|
|
|
1101
1122
|
NSDictionary *launchOptions = notification.userInfo;
|
|
1102
1123
|
NSDictionary *remoteNotification = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
|
|
1103
1124
|
if (remoteNotification) {
|
|
1104
|
-
|
|
1105
|
-
if (
|
|
1106
|
-
gPushDeepLinkURL =
|
|
1125
|
+
NSURL *deepLink = pwplugin_deepLinkURLFromPushLink(remoteNotification[@"l"]);
|
|
1126
|
+
if (deepLink && !gPushDeepLinkURL) {
|
|
1127
|
+
gPushDeepLinkURL = deepLink;
|
|
1107
1128
|
}
|
|
1108
1129
|
}
|
|
1109
1130
|
}];
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|