pushwoosh-cordova-plugin 8.3.2 → 8.3.5

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 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.2
17
+ cordova plugin add pushwoosh-cordova-plugin@8.3.5
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.2
23
+ cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-plugin.git#8.3.5
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.2
31
+ cordova plugin add pushwoosh-cordova-plugin@8.3.5
32
32
  ```
33
33
 
34
34
  ### Guide
package/README_PGB.md CHANGED
@@ -14,7 +14,7 @@ Cross-Platform push notifications by Pushwoosh for PhoneGap
14
14
  Using npm (requires cordova 5.0+):
15
15
 
16
16
  ```
17
- cordova plugin add pushwoosh-pgb-plugin@8.3.2
17
+ cordova plugin add pushwoosh-pgb-plugin@8.3.5
18
18
  ```
19
19
 
20
20
  ### Guide
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "pushwoosh-cordova-plugin",
3
- "version": "8.3.2",
3
+ "version": "8.3.5",
4
4
  "description": "\n This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).\n ",
5
+ "main":"www/PushNotification.js",
6
+ "typings":"types/index.d.ts",
5
7
  "cordova": {
6
8
  "id": "pushwoosh-cordova-plugin",
7
9
  "platforms": [
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">
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.5">
3
3
 
4
4
  <name>Pushwoosh</name>
5
5
 
@@ -77,13 +77,13 @@
77
77
  <framework src="com.android.support.constraint:constraint-layout:1.0.2" />
78
78
  <framework src="com.github.bumptech.glide:glide:4.7.1" />
79
79
  <framework src="org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60" />
80
- <framework src="com.pushwoosh:pushwoosh:6.4.4"/>
81
- <framework src="com.pushwoosh:pushwoosh-amazon:6.4.4"/>
82
- <framework src="com.pushwoosh:pushwoosh-firebase:6.4.4"/>
83
- <framework src="com.pushwoosh:pushwoosh-badge:6.4.4"/>
84
- <framework src="com.pushwoosh:pushwoosh-inbox:6.4.4"/>
85
- <framework src="com.pushwoosh:pushwoosh-inbox-ui:6.4.4"/>
86
- <framework src="com.pushwoosh:pushwoosh-huawei:6.4.4"/>
80
+ <framework src="com.pushwoosh:pushwoosh:6.6.1"/>
81
+ <framework src="com.pushwoosh:pushwoosh-amazon:6.6.1"/>
82
+ <framework src="com.pushwoosh:pushwoosh-firebase:6.6.1"/>
83
+ <framework src="com.pushwoosh:pushwoosh-badge:6.6.1"/>
84
+ <framework src="com.pushwoosh:pushwoosh-inbox:6.6.1"/>
85
+ <framework src="com.pushwoosh:pushwoosh-inbox-ui:6.6.1"/>
86
+ <framework src="com.pushwoosh:pushwoosh-huawei:6.6.1"/>
87
87
  </platform>
88
88
 
89
89
  <!-- ios -->
@@ -98,6 +98,12 @@
98
98
  <param name="ios-package" value="PushNotification"/>
99
99
  </feature>
100
100
  </config-file>
101
+
102
+ <config-file target="*-Info.plist" parent="UIBackgroundModes">
103
+ <array>
104
+ <string>remote-notification</string>
105
+ </array>
106
+ </config-file>
101
107
 
102
108
  <config-file target="*-Info.plist" parent="Pushwoosh_LOG_LEVEL">
103
109
  <string>$LOG_LEVEL</string>
@@ -113,23 +119,22 @@
113
119
  <config-file parent="aps-environment" target="*/Entitlements-Release.plist">
114
120
  <string>production</string>
115
121
  </config-file>
122
+
123
+ <podspec>
124
+ <config>
125
+ <source url="https://github.com/CocoaPods/Specs.git"/>
126
+ </config>
127
+ <pods use-frameworks="true">
128
+ <pod name="PushwooshXCFramework" />
129
+ </pods>
130
+ </podspec>
131
+ <framework src="Pods/PushwooshXCFramework/XCFramework/Pushwoosh.xcframework" embed="true" />
116
132
 
117
133
  <header-file src="src/ios/PushNotification.h" target-dir="ios"/>
118
134
  <source-file src="src/ios/PushNotification.m" target-dir="ios"/>
119
135
  <header-file src="src/ios/PWBackward.h" target-dir="ios"/>
120
136
  <source-file src="src/ios/PWBackward.m" target-dir="ios"/>
121
- <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h" target-dir="ios"/>
122
- <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/PWInAppManager.h" target-dir="ios"/>
123
- <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/PWGDPRManager.h" target-dir="ios"/>
124
- <header-file src="src/ios/PWLog.h" target-dir="ios"/>
125
- <header-file src="src/ios/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h" target-dir="ios"/>
126
- <header-file src="src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PushwooshInboxUI.h" target-dir="ios"/>
127
- <header-file src="src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxStyle.h" target-dir="ios"/>
128
- <header-file src="src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxUI.h" target-dir="ios"/>
129
-
130
- <source-file src="src/ios/Pushwoosh.framework/Versions/A/libPushwoosh.a" framework="true"/>
131
- <source-file src="src/ios/PushwooshInboxUI.framework/Versions/A/libPushwooshInboxUI.a" framework="true"/>
132
- <resource-file src="src/ios/PushwooshInboxBundle.bundle" />
137
+ <resource-file src="src/ios/" />
133
138
  </platform>
134
139
 
135
140
  <!-- wp8 -->
@@ -20,6 +20,7 @@ import android.webkit.JavascriptInterface;
20
20
 
21
21
  import com.pushwoosh.GDPRManager;
22
22
  import com.pushwoosh.Pushwoosh;
23
+ import com.pushwoosh.RegisterForPushNotificationsResultData;
23
24
  import com.pushwoosh.badge.PushwooshBadge;
24
25
  import com.pushwoosh.exception.GetTagsException;
25
26
  import com.pushwoosh.exception.PushwooshException;
@@ -168,17 +169,18 @@ public class PushNotifications extends CordovaPlugin {
168
169
  @CordovaMethod
169
170
  private boolean additionalAuthorizationOptions(JSONArray data, CallbackContext callbackContext) {
170
171
  // Stub, this is iOS only method
172
+ return true;
171
173
  }
172
174
 
173
175
  @CordovaMethod
174
176
  private boolean registerDevice(JSONArray data, CallbackContext callbackContext) {
175
177
  try {
176
178
  callbackIds.put("registerDevice", callbackContext);
177
- Pushwoosh.getInstance().registerForPushNotifications(new Callback<String, RegisterForPushNotificationsException>() {
179
+ Pushwoosh.getInstance().registerForPushNotifications(new Callback<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException>() {
178
180
  @Override
179
- public void process(@NonNull final Result<String, RegisterForPushNotificationsException> result) {
180
- if (result.isSuccess()) {
181
- doOnRegistered(result.getData());
181
+ public void process(@NonNull final Result<RegisterForPushNotificationsResultData, RegisterForPushNotificationsException> result) {
182
+ if (result.isSuccess() && result.getData != null) {
183
+ doOnRegistered(result.getData().getToken());
182
184
  } else if (result.getException() != null) {
183
185
  doOnRegisteredError(result.getException().getMessage());
184
186
  }
@@ -12,7 +12,8 @@
12
12
  #import <Foundation/Foundation.h>
13
13
  #import <Cordova/CDV.h>
14
14
  #import <Cordova/CDVPlugin.h>
15
- #import "PushNotificationManager.h"
15
+ #import <Pushwoosh/Pushwoosh.h>
16
+ #import <Pushwoosh/PushNotificationManager.h>
16
17
 
17
18
  @interface PushNotification : CDVPlugin <PushNotificationDelegate>
18
19
 
@@ -12,11 +12,10 @@
12
12
 
13
13
  #import "PushNotification.h"
14
14
  #import "PWLog.h"
15
- #import "PushwooshInboxUI.h"
16
- #import "PWGDPRManager.h"
17
- #import "PWInAppManager.h"
15
+ #import <PushwooshInboxUI/PushwooshInboxUI.h>
16
+ #import <Pushwoosh/PWGDPRManager.h>
17
+ #import <Pushwoosh/PWInAppManager.h>
18
18
  #import "PWBackward.h"
19
- #import "Pushwoosh.h"
20
19
 
21
20
  #import "AppDelegate.h"
22
21
 
@@ -28,6 +28,19 @@ NS_ASSUME_NONNULL_BEGIN
28
28
  */
29
29
  - (void)handleNotificationRequest:(UNNotificationRequest *)request contentHandler:(void (^)(UNNotificationContent *))contentHandler;
30
30
 
31
+ /**
32
+ Example:
33
+ @code
34
+ - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
35
+ self.contentHandler = contentHandler;
36
+ self.bestAttemptContent = [request.content mutableCopy];
37
+
38
+ [[PWNotificationExtensionManager sharedManager] handleNotificationRequest:request withAppGroups:@"group.com.example_domain.example_app_name."];
39
+ }
40
+ @endcode
41
+ */
42
+ - (void)handleNotificationRequest:(UNNotificationRequest *)request withAppGroups:(NSString * _Nullable)appGroupsName;
43
+
31
44
  @end
32
45
 
33
46
  NS_ASSUME_NONNULL_END
@@ -385,14 +385,6 @@ typedef void (^PushwooshErrorHandler)(NSError *error);
385
385
  */
386
386
  - (void)sendAppOpen;
387
387
 
388
- /**
389
- Sends current badge value to server. Called internally by SDK Runtime when `UIApplication` `setApplicationBadgeNumber:` is set. This function is used for "auto-incremeting" badges to work.
390
- This way Pushwoosh server can know what current badge value is set for the application.
391
-
392
- @param badge Current badge value.
393
- */
394
- - (void)sendBadges:(NSInteger)badge __API_AVAILABLE(macos(10.10), ios(8.0));
395
-
396
388
  + (NSString *)pushwooshVersion;
397
389
 
398
390
  #if TARGET_OS_IOS
@@ -18,7 +18,7 @@
18
18
 
19
19
  #endif
20
20
 
21
- #define PUSHWOOSH_VERSION @"6.3.5"
21
+ #define PUSHWOOSH_VERSION @"6.4.2"
22
22
 
23
23
 
24
24
  @class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
@@ -81,6 +81,11 @@ Tells the delegate that the user has pressed on the push notification banner.
81
81
  */
82
82
  @property (nonatomic, readonly) NSUInteger badge;
83
83
 
84
+ /**
85
+ Extension badge number of the push message.
86
+ */
87
+ @property (nonatomic, readonly) NSUInteger badgeExtension;
88
+
84
89
  /**
85
90
  Remote URL or deeplink from the push message.
86
91
  */
@@ -0,0 +1,68 @@
1
+ interface PushwooshConfig {
2
+ projectid: string,
3
+ appid: string,
4
+ serviceName?: string
5
+ }
6
+
7
+ type SuccessRegistrationCallback = {
8
+ pushToken: string;
9
+ }
10
+
11
+ type LocalNotification = {
12
+ msg: string;
13
+ seconds: number;
14
+ userData?: Object;
15
+ }
16
+
17
+ type AuthOptions = Record<string, number|string>
18
+
19
+ type RemoteNotificationStatus = Record<string,string|number|boolean>
20
+
21
+ interface PushwooshTags {
22
+ [index: string]: string | number | string[] | number[]
23
+ }
24
+
25
+ export interface PushNotification {
26
+ onDeviceReady(config: PushwooshConfig): void;
27
+ onAppActivated(config: Object): void;
28
+ registerDevice(success?: (callback: SuccessRegistrationCallback) => void, fail?: (error: Error|string) => void): void;
29
+ unregisterDevice(success?: (callback?: string) => void, fail?: (error?: Error|string) => void): void;
30
+ additionalAuthorizationOptions(options: AuthOptions): void;
31
+ setTags(config: PushwooshTags, success?: (tags?: Record<string,PushwooshTags>) => void, fail?: (error?: Error|string) => void): void;
32
+ getTags(success?: (tags: PushwooshTags) => void, fail?: (error?: Error|string) => void): void;
33
+ getPushToken(success?: (pushToken: string) => void): void;
34
+ getPushwooshHWID(success?: (hwid: string) => void): void;
35
+ getRemoteNotificationStatus(success?: (status: RemoteNotificationStatus) => void, fail?: (error: Error|string) => void): void;
36
+ setApplicationIconBadgeNumber(badge: number): void;
37
+ getApplicationIconBadgeNumber(success?: (badge: number) => void): void;
38
+ addToApplicationIconBadgeNumber(badge: number|string): void;
39
+ getLaunchNotification(success?: (notification: string) => void): void;
40
+ clearLaunchNotification(success?: () => void): void;
41
+ setUserId(userId: string): void;
42
+ postEvent(event: string, attributes?: Record<string, string>): void;
43
+ addJavaScriptInterface(bridgeName: string): void;
44
+ createLocalNotification(notification: LocalNotification, success?: () => void, fail?: () => void): void;
45
+ clearLocalNotification(): void;
46
+ clearNotificationCenter(): void;
47
+ setMultiNotificationMode(success?: () => void, fail?: () => void): void;
48
+ setSingleNotificationMode(success?: () => void, fail?: () => void): void;
49
+ cancelAllLocalNotifications(success?: () => void): void;
50
+ pushReceivedCallback(notification: string): void;
51
+ notificationCallback(notification: string): void;
52
+ presentInboxUI(params?: Record<string,any>): void;
53
+ showGDPRConsentUI(): void;
54
+ showGDPRDeletionUI(): void;
55
+ setCommunicationEnabled(enable: boolean, success?: () => void, fail?: (callback: Error|string) => void): void;
56
+ removeAllDeviceData(success?: () => void, fail?: (callback: Error|string) => void): void;
57
+ isCommunicationEnabled(success: (enabled: boolean) => void): void;
58
+ isDeviceDataRemoved(success: (removed: boolean) => void): void;
59
+ isAvailableGDPR(success: (isAvailable: boolean) => void): void;
60
+ enableHuaweiPushNotifications(): void;
61
+ setSoundType(type: string, success?: () => void, fail?: () => void): void;
62
+ setVibrateType(type: string, success?: () => void, fail?: () => void): void;
63
+ setLightScreenOnNotification(on: boolean, success?: () => void, fail?: () => void): void;
64
+ setEnableLED(on: boolean, success?: () => void, fail?: () => void): void;
65
+ setColorLED(color: string, success?: () => void, fail?: () => void): void;
66
+ getPushHistory(success?: (pushHistory: Object) => void): void;
67
+ clearPushHistory(callback: () => void): void;
68
+ }
@@ -0,0 +1,5 @@
1
+ import { PushNotification } from './PushNotification';
2
+
3
+ export declare const Pushwoosh: PushNotification;
4
+ export { PushNotification };
5
+ export default Pushwoosh;
@@ -9,7 +9,7 @@
9
9
  //
10
10
  // MIT Licensed
11
11
 
12
- var exec = require('cordova/exec');
12
+ var exec = window.cordova.exec;
13
13
 
14
14
  //Class: PushNotification
15
15
  //Class to interact with Pushwoosh Push Notifications plugin