pushwoosh-cordova-plugin 8.3.23 → 8.3.25
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/README.md +3 -3
- package/README_PGB.md +1 -1
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/ios/PushNotification.m +31 -7
package/README.md
CHANGED
|
@@ -14,13 +14,13 @@ Cross-Platform push notifications by Pushwoosh for Cordova / PhoneGap
|
|
|
14
14
|
Using npm (requires cordova 7.0+):
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
cordova plugin add pushwoosh-cordova-plugin@8.3.
|
|
17
|
+
cordova plugin add pushwoosh-cordova-plugin@8.3.25
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Using git:
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.3.
|
|
23
|
+
cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.3.25
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
#### Phonegap
|
|
@@ -28,7 +28,7 @@ cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.
|
|
|
28
28
|
Using npm (requires phonegap 7.1+):
|
|
29
29
|
|
|
30
30
|
```
|
|
31
|
-
cordova plugin add pushwoosh-cordova-plugin@8.3.
|
|
31
|
+
cordova plugin add pushwoosh-cordova-plugin@8.3.25
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### Guide
|
package/README_PGB.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pushwoosh-cordova-plugin",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.25",
|
|
4
4
|
"description": "\n This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).\n ",
|
|
5
5
|
"main":"www/PushNotification.js",
|
|
6
6
|
"typings":"types/index.d.ts",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="pushwoosh-cordova-plugin" version="8.3.
|
|
2
|
+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="pushwoosh-cordova-plugin" version="8.3.25">
|
|
3
3
|
|
|
4
4
|
<name>Pushwoosh</name>
|
|
5
5
|
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
<source url="https://github.com/CocoaPods/Specs.git"/>
|
|
126
126
|
</config>
|
|
127
127
|
<pods use-frameworks="true">
|
|
128
|
-
<pod name="PushwooshXCFramework" spec="6.5.
|
|
128
|
+
<pod name="PushwooshXCFramework" spec="6.5.8" />
|
|
129
129
|
<pod name="PushwooshInboxUIXCFramework" spec="6.1.2" />
|
|
130
130
|
</pods>
|
|
131
131
|
</podspec>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
@end
|
|
47
47
|
|
|
48
|
-
@interface PushNotification() <PWMessagingDelegate>
|
|
48
|
+
@interface PushNotification() <PWMessagingDelegate, UIApplicationDelegate>
|
|
49
49
|
|
|
50
50
|
@property (nonatomic, retain) NSMutableDictionary *callbackIds;
|
|
51
51
|
@property (nonatomic, retain) PushNotificationManager *pushManager;
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
@property (nonatomic, assign) BOOL deviceReady;
|
|
56
56
|
|
|
57
57
|
- (BOOL) application:(UIApplication *)application pwplugin_didRegisterUserNotificationSettings:(UIUserNotificationSettings *)settings;
|
|
58
|
+
- (void) application:(UIApplication *)application pwplugin_didRegisterWithDeviceToken:(NSData *)deviceToken;
|
|
59
|
+
- (void) application:(UIApplication *)application pwplugin_didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler;
|
|
60
|
+
- (void) application:(UIApplication *)application pwplugin_didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
|
|
58
61
|
|
|
59
62
|
@end
|
|
60
63
|
|
|
@@ -249,16 +252,10 @@ API_AVAILABLE(ios(10.0)) {
|
|
|
249
252
|
if (![response.actionIdentifier isEqualToString:UNNotificationDefaultActionIdentifier] && [[PushNotificationManager pushManager].delegate respondsToSelector:@selector(onActionIdentifierReceived:withNotification:)]) {
|
|
250
253
|
[[PushNotificationManager pushManager].delegate onActionIdentifierReceived:response.actionIdentifier withNotification:[self pushPayloadFromContent:response.notification.request.content]];
|
|
251
254
|
}
|
|
252
|
-
|
|
253
|
-
[[Pushwoosh sharedInstance] handlePushReceived:[self pushPayloadFromContent:response.notification.request.content]];
|
|
254
255
|
}
|
|
255
256
|
};
|
|
256
257
|
|
|
257
258
|
if ([self isRemoteNotification:response.notification] && [PWMessage isPushwooshMessage:response.notification.request.content.userInfo]) {
|
|
258
|
-
if (![self isContentAvailablePush:response.notification.request.content.userInfo]) {
|
|
259
|
-
[[Pushwoosh sharedInstance] handlePushReceived:[self pushPayloadFromContent:response.notification.request.content]];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
259
|
handlePushAcceptanceBlock();
|
|
263
260
|
} else if ([response.notification.request.content.userInfo objectForKey:@"pw_push"]) {
|
|
264
261
|
handlePushAcceptanceBlock();
|
|
@@ -827,6 +824,30 @@ API_AVAILABLE(ios(10.0)) {
|
|
|
827
824
|
}
|
|
828
825
|
}
|
|
829
826
|
|
|
827
|
+
void pwplugin_didReceiveRemoteNotification(id self, SEL _cmd, UIApplication * application, NSDictionary * userInfo, void (^completionHandler)(UIBackgroundFetchResult)) {
|
|
828
|
+
if ([self respondsToSelector:@selector(application:pwplugin_didReceiveRemoteNotification:fetchCompletionHandler:)]) {
|
|
829
|
+
[self application:application pwplugin_didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
[[Pushwoosh sharedInstance] handlePushReceived:userInfo];
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
void pwplugin_didRegisterWithDeviceToken(id self, SEL _cmd, id application, NSData *deviceToken) {
|
|
836
|
+
if ([self respondsToSelector:@selector(application: pwplugin_didRegisterWithDeviceToken:)]) {
|
|
837
|
+
[self application:application pwplugin_didRegisterWithDeviceToken:deviceToken];
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
[[Pushwoosh sharedInstance] handlePushRegistration:deviceToken];
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
void pwplugin_didFailToRegisterForRemoteNotificationsWithError(id self, SEL _cmd, UIApplication *application, NSError *error) {
|
|
844
|
+
if ([self respondsToSelector:@selector(application:pwplugin_didFailToRegisterForRemoteNotificationsWithError:)]) {
|
|
845
|
+
[self application:application pwplugin_didFailToRegisterForRemoteNotificationsWithError:error];
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
[[Pushwoosh sharedInstance] handlePushRegistrationFailure:error];
|
|
849
|
+
}
|
|
850
|
+
|
|
830
851
|
BOOL pwplugin_didRegisterUserNotificationSettings(id self, SEL _cmd, id application, id notificationSettings) {
|
|
831
852
|
PushNotification *pushHandler = pw_PushNotificationPlugin;
|
|
832
853
|
|
|
@@ -876,6 +897,9 @@ BOOL pwplugin_didRegisterUserNotificationSettings(id self, SEL _cmd, id applicat
|
|
|
876
897
|
appDelegateClass = [delegate class];
|
|
877
898
|
|
|
878
899
|
pushwoosh_swizzle([delegate class], @selector(application:didRegisterUserNotificationSettings:), @selector(application:pwplugin_didRegisterUserNotificationSettings:), (IMP)pwplugin_didRegisterUserNotificationSettings, "v@:::");
|
|
900
|
+
pushwoosh_swizzle([delegate class], @selector(application:didRegisterForRemoteNotificationsWithDeviceToken:), @selector(application:pwplugin_didRegisterWithDeviceToken:), (IMP)pwplugin_didRegisterWithDeviceToken, "v@:::");
|
|
901
|
+
pushwoosh_swizzle([delegate class], @selector(application:didFailToRegisterForRemoteNotificationsWithError:), @selector(application:pwplugin_didFailToRegisterForRemoteNotificationsWithError:), (IMP)pwplugin_didFailToRegisterForRemoteNotificationsWithError, "v@:::");
|
|
902
|
+
pushwoosh_swizzle([delegate class], @selector(application:didReceiveRemoteNotification:fetchCompletionHandler:), @selector(application:pwplugin_didReceiveRemoteNotification:fetchCompletionHandler:), (IMP)pwplugin_didReceiveRemoteNotification, "v@::::");
|
|
879
903
|
}
|
|
880
904
|
|
|
881
905
|
- (NSDictionary*)inboxMessageToDictionary:(NSObject<PWInboxMessageProtocol>*) message {
|