pushwoosh-cordova-plugin 6.0.1 → 6.1.1
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/{MIT-LICENSE.txt → LICENSE.md} +0 -0
- package/README.md +20 -32
- package/README_PGB.md +32 -0
- package/package.json +1 -1
- package/package_pgb.json +29 -0
- package/plugin.xml +71 -82
- package/src/android/src/com/pushwoosh/plugin/internal/PhonegapPluginProvider.java +22 -0
- package/src/android/src/com/pushwoosh/plugin/pushnotifications/CustomFirebaseMessagingService.java +29 -0
- package/src/android/src/com/pushwoosh/plugin/pushnotifications/InboxUiStyleManager.java +136 -0
- package/src/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java +365 -387
- package/src/android/src/com/pushwoosh/plugin/pushnotifications/PushwooshNotificationServiceExtension.java +38 -0
- package/src/ios/PWBackward.h +25 -0
- package/src/ios/PWBackward.m +53 -0
- package/src/ios/PushNotification.m +409 -147
- package/src/ios/Pushwoosh.framework/Modules/module.modulemap +6 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWAppDelegate.h +20 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWGDPRManager.h +46 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInAppManager.h +174 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInbox.h +147 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInlineInAppView.h +26 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWLog.h +23 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWMessaging.h +20 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWNotificationExtensionManager.h +33 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWRichMediaManager.h +118 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWRichMediaStyle.h +122 -0
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h +263 -151
- package/src/ios/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h +525 -0
- package/src/ios/Pushwoosh.framework/Versions/A/libPushwoosh.a +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/Info.plist +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/PWIInboxAttachmentViewController.nib +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/PWIInboxMessageViewCell.nib +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/PWIInboxViewController.nib +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/errorMessage@2x.png +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/inbox_icon.png +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/noMessage@2x.png +0 -0
- package/src/ios/PushwooshInboxBundle.bundle/unread.png +0 -0
- package/src/ios/PushwooshInboxUI.framework/Modules/module.modulemap +6 -0
- package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxStyle.h +122 -0
- package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxUI.h +39 -0
- package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PushwooshInboxUI.h +19 -0
- package/src/ios/PushwooshInboxUI.framework/Versions/A/libPushwooshInboxUI.a +0 -0
- package/src/windows/PushSDK/Newtonsoft.Json.dll +0 -0
- package/src/windows/PushSDK/PushSDK.winmd +0 -0
- package/src/windows/PushwooshPluginProxy.js +88 -74
- package/src/wp8/PushNotification.cs +14 -0
- package/src/wp8/PushSDK/PushSDK.dll +0 -0
- package/www/PushNotification.js +179 -45
- package/Documentation/files/PushNotification-js.html +0 -157
- package/Documentation/index/Classes.html +0 -33
- package/Documentation/index/Functions.html +0 -61
- package/Documentation/index/General.html +0 -65
- package/Documentation/index.html +0 -1
- package/Documentation/javascript/main.js +0 -841
- package/Documentation/javascript/prettify.js +0 -1526
- package/Documentation/javascript/searchdata.js +0 -92
- package/Documentation/search/ClassesP.html +0 -20
- package/Documentation/search/FunctionsA.html +0 -20
- package/Documentation/search/FunctionsC.html +0 -20
- package/Documentation/search/FunctionsG.html +0 -20
- package/Documentation/search/FunctionsO.html +0 -20
- package/Documentation/search/FunctionsP.html +0 -20
- package/Documentation/search/FunctionsR.html +0 -20
- package/Documentation/search/FunctionsS.html +0 -20
- package/Documentation/search/FunctionsU.html +0 -20
- package/Documentation/search/GeneralA.html +0 -20
- package/Documentation/search/GeneralC.html +0 -20
- package/Documentation/search/GeneralF.html +0 -20
- package/Documentation/search/GeneralG.html +0 -20
- package/Documentation/search/GeneralO.html +0 -20
- package/Documentation/search/GeneralP.html +0 -20
- package/Documentation/search/GeneralR.html +0 -20
- package/Documentation/search/GeneralS.html +0 -20
- package/Documentation/search/GeneralU.html +0 -20
- package/Documentation/search/NoResults.html +0 -15
- package/Documentation/styles/main.css +0 -828
- package/VERSION.md +0 -132
- package/push.gradle +0 -21
- package/src/ios/Pushwoosh.framework/Versions/A/Pushwoosh +0 -0
|
@@ -5,26 +5,34 @@
|
|
|
5
5
|
//
|
|
6
6
|
|
|
7
7
|
#import <Foundation/Foundation.h>
|
|
8
|
+
|
|
9
|
+
#if TARGET_OS_IOS
|
|
10
|
+
|
|
8
11
|
#import <UIKit/UIKit.h>
|
|
9
12
|
#import <StoreKit/StoreKit.h>
|
|
10
13
|
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
|
|
11
17
|
@class PushNotificationManager;
|
|
18
|
+
|
|
19
|
+
#if TARGET_OS_IOS || TARGET_OS_WATCH
|
|
20
|
+
|
|
21
|
+
#import <UserNotifications/UserNotifications.h>
|
|
22
|
+
|
|
12
23
|
@class CLLocation;
|
|
13
24
|
|
|
14
|
-
|
|
15
|
-
PWOrientationPortrait = 1 << 0,
|
|
16
|
-
PWOrientationPortraitUpsideDown = 1 << 1,
|
|
17
|
-
PWOrientationLandscapeLeft = 1 << 2,
|
|
18
|
-
PWOrientationLandscapeRight = 1 << 3,
|
|
19
|
-
};
|
|
25
|
+
#endif
|
|
20
26
|
|
|
21
|
-
typedef void(^PushwooshGetTagsHandler)(NSDictionary *tags);
|
|
22
|
-
typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
27
|
+
typedef void (^PushwooshGetTagsHandler)(NSDictionary *tags);
|
|
28
|
+
typedef void (^PushwooshErrorHandler)(NSError *error);
|
|
23
29
|
|
|
24
30
|
/**
|
|
25
31
|
`PushNotificationDelegate` protocol defines the methods that can be implemented in the delegate of the `PushNotificationManager` class' singleton object.
|
|
26
32
|
These methods provide information about the key events for push notification manager such as registering with APS services, receiving push notifications or working with the received notification.
|
|
27
33
|
These methods implementation allows to react on these events properly.
|
|
34
|
+
|
|
35
|
+
Deprecated. Use PWMessagingDelegate instead.
|
|
28
36
|
*/
|
|
29
37
|
@protocol PushNotificationDelegate
|
|
30
38
|
|
|
@@ -34,26 +42,24 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
34
42
|
|
|
35
43
|
@param token A token used for identifying the device with APS.
|
|
36
44
|
*/
|
|
37
|
-
- (void)
|
|
45
|
+
- (void)onDidRegisterForRemoteNotificationsWithDeviceToken:(NSString *)token;
|
|
38
46
|
|
|
39
47
|
/**
|
|
40
48
|
Sent to the delegate when Apple Push Service (APS) could not complete the registration process successfully.
|
|
41
49
|
|
|
42
50
|
@param error An NSError object encapsulating the information about the reason of the registration failure. Within this method you can define application's behaviour in case of registration failure.
|
|
43
51
|
*/
|
|
44
|
-
- (void)
|
|
52
|
+
- (void)onDidFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
|
|
45
53
|
|
|
46
54
|
/**
|
|
47
55
|
Tells the delegate that the push manager has received a remote notification.
|
|
48
56
|
|
|
49
|
-
If this method is implemented `onPushAccepted:withNotification:` will not be called, internal message boxes will not be displayed.
|
|
50
|
-
|
|
51
57
|
@param pushManager The push manager that received the remote notification.
|
|
52
58
|
@param pushNotification A dictionary that contains information referring to the remote notification, potentially including a badge number for the application icon, an alert sound, an alert message to display to the user, a notification identifier, and custom data.
|
|
53
59
|
The provider originates it as a JSON-defined dictionary that iOS converts to an NSDictionary object; the dictionary may contain only property-list objects plus NSNull.
|
|
54
|
-
|
|
60
|
+
@param onStart If the application was not foreground when the push notification was received, the application will be opened with this parameter equal to `YES`, otherwise the parameter will be `NO`.
|
|
55
61
|
*/
|
|
56
|
-
- (void)
|
|
62
|
+
- (void)onPushReceived:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart;
|
|
57
63
|
|
|
58
64
|
/**
|
|
59
65
|
Tells the delegate that the user has pressed OK on the push notification.
|
|
@@ -63,77 +69,100 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
63
69
|
@param pushNotification A dictionary that contains information referring to the remote notification, potentially including a badge number for the application icon, an alert sound, an alert message to display to the user, a notification identifier, and custom data.
|
|
64
70
|
The provider originates it as a JSON-defined dictionary that iOS converts to an NSDictionary object; the dictionary may contain only property-list objects plus NSNull.
|
|
65
71
|
Push dictionary sample:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
@code
|
|
73
|
+
{
|
|
74
|
+
aps = {
|
|
75
|
+
alert = "Some text.";
|
|
76
|
+
sound = default;
|
|
77
|
+
};
|
|
78
|
+
p = 1pb;
|
|
79
|
+
}
|
|
80
|
+
@endcode
|
|
75
81
|
*/
|
|
76
|
-
- (void)
|
|
82
|
+
- (void)onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification DEPRECATED_ATTRIBUTE;
|
|
77
83
|
|
|
78
84
|
/**
|
|
79
|
-
Tells the delegate that
|
|
85
|
+
Tells the delegate that a custom action was triggered when opening a notification.
|
|
86
|
+
|
|
87
|
+
@param identifier NSString containing an ID of a clicked button. This ID is set by a user when creating a category in the Pushwoosh Control Panel
|
|
88
|
+
@param notification NSDictionary with push payload.
|
|
89
|
+
*/
|
|
90
|
+
- (void)onActionIdentifierReceived:(NSString *)identifier withNotification:(NSDictionary *)notification;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
Tells the delegate that the user has pressed on the push notification banner.
|
|
80
94
|
|
|
81
95
|
@param pushManager The push manager that received the remote notification.
|
|
82
96
|
@param pushNotification A dictionary that contains information about the remote notification, potentially including a badge number for the application icon, an alert sound, an alert message to display to the user, a notification identifier, and custom data.
|
|
83
97
|
The provider originates it as a JSON-defined dictionary that iOS converts to an NSDictionary object; the dictionary may contain only property-list objects plus NSNull.
|
|
84
98
|
Push dictionary sample:
|
|
99
|
+
@code
|
|
100
|
+
{
|
|
101
|
+
aps = {
|
|
102
|
+
alert = "Some text.";
|
|
103
|
+
sound = default;
|
|
104
|
+
};
|
|
105
|
+
p = 1pb;
|
|
106
|
+
}
|
|
107
|
+
@endcode
|
|
85
108
|
|
|
86
|
-
|
|
87
|
-
aps = {
|
|
88
|
-
alert = "Some text.";
|
|
89
|
-
sound = default;
|
|
90
|
-
};
|
|
91
|
-
p = 1pb;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@param onStart If the application was not active when the push notification was received, the application will be launched with this parameter equal to `YES`, otherwise the parameter will be `NO`.
|
|
109
|
+
@param onStart If the application was not foreground when the push notification was received, the application will be opened with this parameter equal to `YES`, otherwise the parameter will be `NO`.
|
|
95
110
|
*/
|
|
96
|
-
- (void)
|
|
111
|
+
- (void)onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart;
|
|
97
112
|
|
|
98
113
|
/**
|
|
99
114
|
Tells the delegate that the push manager has received tags from the server.
|
|
100
115
|
|
|
101
116
|
@param tags Dictionary representation of received tags.
|
|
102
117
|
Dictionary example:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
@code
|
|
119
|
+
{
|
|
120
|
+
Country = ru;
|
|
121
|
+
Language = ru;
|
|
122
|
+
}
|
|
123
|
+
@endcode
|
|
109
124
|
*/
|
|
110
|
-
- (void)
|
|
125
|
+
- (void)onTagsReceived:(NSDictionary *)tags;
|
|
111
126
|
|
|
112
127
|
/**
|
|
113
128
|
Sent to the delegate when push manager could not complete the tags receiving process successfully.
|
|
114
129
|
|
|
115
130
|
@param error An NSError object that encapsulates information why receiving tags did not succeed.
|
|
116
131
|
*/
|
|
117
|
-
- (void)
|
|
132
|
+
- (void)onTagsFailedToReceive:(NSError *)error;
|
|
118
133
|
|
|
119
134
|
/**
|
|
120
135
|
Tells the delegate that In-App with specified code has been closed
|
|
121
136
|
|
|
122
137
|
@param code In-App code
|
|
123
138
|
*/
|
|
124
|
-
- (void)
|
|
139
|
+
- (void)onInAppClosed:(NSString *)code __attribute__((deprecated("Use PWRichMediaPresentingDelegate protocol from PWRichMediaManager.h")));
|
|
125
140
|
|
|
126
141
|
/**
|
|
127
142
|
Tells the delegate that In-App with specified code has been displayed
|
|
128
143
|
|
|
129
144
|
@param code In-App code
|
|
130
145
|
*/
|
|
131
|
-
- (void)
|
|
146
|
+
- (void)onInAppDisplayed:(NSString *)code __attribute__((deprecated("Use PWRichMediaPresentingDelegate protocol from PWRichMediaManager.h")));
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
#if TARGET_OS_IOS || TARGET_OS_WATCH
|
|
150
|
+
/**
|
|
151
|
+
The method will be called on the delegate when the application is launched in response to the user's request to view in-app notification settings.
|
|
152
|
+
Add UNAuthorizationOptionProvidesAppNotificationSettings as an option in [PushNotificationManager pushManager].additionalAuthorizationOptions to add a button to inline notification settings view and the notification settings view in Settings.
|
|
153
|
+
The notification will be nil when opened from Settings.
|
|
154
|
+
|
|
155
|
+
@param pushManager PushNotificationManager instance
|
|
156
|
+
@param notification Source notification
|
|
157
|
+
*/
|
|
158
|
+
- (void)pushManager:(PushNotificationManager *)pushManager openSettingsForNotification:(UNNotification *)notification __IOS_AVAILABLE(12.0);
|
|
159
|
+
|
|
160
|
+
#endif
|
|
132
161
|
|
|
133
162
|
@end
|
|
134
163
|
|
|
135
164
|
/**
|
|
136
|
-
|
|
165
|
+
`PWTags` class encapsulates the methods for creating tags parameters for sending them to the server.
|
|
137
166
|
*/
|
|
138
167
|
@interface PWTags : NSObject
|
|
139
168
|
|
|
@@ -141,29 +170,51 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
141
170
|
Creates a dictionary for incrementing/decrementing a numeric tag on the server.
|
|
142
171
|
|
|
143
172
|
Example:
|
|
173
|
+
@code
|
|
174
|
+
NSDictionary *tags = @{
|
|
175
|
+
@"Alias" : aliasField.text,
|
|
176
|
+
@"FavNumber" : @([favNumField.text intValue]),
|
|
177
|
+
@"price": [PWTags incrementalTagWithInteger:5],
|
|
178
|
+
};
|
|
144
179
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
[NSNumber numberWithInt:[favNumField.text intValue]], @"FavNumber",
|
|
148
|
-
[PWTags incrementalTagWithInteger:5], @"price",
|
|
149
|
-
nil];
|
|
150
|
-
|
|
151
|
-
[[PushNotificationManager pushManager] setTags:tags];
|
|
180
|
+
[[PushNotificationManager pushManager] setTags:tags];
|
|
181
|
+
@endcode
|
|
152
182
|
|
|
153
183
|
@param delta Difference that needs to be applied to the tag's counter.
|
|
154
184
|
|
|
155
185
|
@return Dictionary, that needs to be sent as the value for the tag
|
|
156
186
|
*/
|
|
157
|
-
+ (NSDictionary *)
|
|
187
|
+
+ (NSDictionary *)incrementalTagWithInteger:(NSInteger)delta;
|
|
158
188
|
|
|
159
|
-
|
|
189
|
+
/**
|
|
190
|
+
Creates a dictionary for extending Tag’s values list with additional values
|
|
191
|
+
|
|
192
|
+
Example:
|
|
193
|
+
|
|
194
|
+
@code
|
|
195
|
+
NSDictionary *tags = @{
|
|
196
|
+
@"Alias" : aliasField.text,
|
|
197
|
+
@"FavNumber" : @([favNumField.text intValue]),
|
|
198
|
+
@"List" : [PWTags appendValuesToListTag:@[ @"Item1" ]]
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
[[PushNotificationManager pushManager] setTags:tags];
|
|
202
|
+
@endcode
|
|
203
|
+
|
|
204
|
+
@param array Array of values to be added to the tag.
|
|
205
|
+
|
|
206
|
+
@return Dictionary to be sent as the value for the tag
|
|
207
|
+
*/
|
|
208
|
+
+ (NSDictionary *)appendValuesToListTag:(NSArray<NSString *> *)array;
|
|
160
209
|
|
|
210
|
+
@end
|
|
161
211
|
|
|
162
212
|
/**
|
|
163
|
-
|
|
213
|
+
`PushNotificationManager` class offers access to the singleton-instance of the push manager responsible for registering the device with the APS servers, receiving and processing push notifications.
|
|
214
|
+
|
|
215
|
+
Deprecated. Use Pushwoosh class instead.
|
|
164
216
|
*/
|
|
165
|
-
@interface PushNotificationManager : NSObject
|
|
166
|
-
NSObject<PushNotificationDelegate> *__unsafe_unretained delegate;
|
|
217
|
+
@interface PushNotificationManager : NSObject {
|
|
167
218
|
}
|
|
168
219
|
|
|
169
220
|
/**
|
|
@@ -180,21 +231,50 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
180
231
|
`PushNotificationDelegate` protocol delegate that would receive the information about events for push notification manager such as registering with APS services, receiving push notifications or working with the received notification.
|
|
181
232
|
Pushwoosh Runtime sets it to ApplicationDelegate by default
|
|
182
233
|
*/
|
|
183
|
-
@property (nonatomic,
|
|
234
|
+
@property (nonatomic, weak) NSObject<PushNotificationDelegate> *delegate;
|
|
235
|
+
|
|
236
|
+
#if TARGET_OS_IOS || TARGET_OS_WATCH
|
|
184
237
|
|
|
185
238
|
/**
|
|
186
239
|
Show push notifications alert when push notification is received while the app is running, default is `YES`
|
|
187
240
|
*/
|
|
188
241
|
@property (nonatomic, assign) BOOL showPushnotificationAlert;
|
|
189
242
|
|
|
243
|
+
/**
|
|
244
|
+
Authorization options in addition to UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionCarPlay.
|
|
245
|
+
*/
|
|
246
|
+
@property (nonatomic) UNAuthorizationOptions additionalAuthorizationOptions __IOS_AVAILABLE(12.0);
|
|
247
|
+
|
|
248
|
+
#endif
|
|
249
|
+
|
|
190
250
|
/**
|
|
191
251
|
Returns push notification payload if the app was started in response to push notification or null otherwise
|
|
192
252
|
*/
|
|
193
253
|
@property (nonatomic, copy, readonly) NSDictionary *launchNotification;
|
|
194
254
|
|
|
255
|
+
#if TARGET_OS_IOS || TARGET_OS_WATCH
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
Returns UNUserNotificationCenterDelegate that handles foreground push notifications on iOS10
|
|
259
|
+
*/
|
|
260
|
+
@property (nonatomic, strong, readonly) id<UNUserNotificationCenterDelegate> notificationCenterDelegate;
|
|
261
|
+
|
|
262
|
+
#elif TARGET_OS_OSX
|
|
263
|
+
|
|
264
|
+
@property (nonatomic, strong, readonly) id<NSUserNotificationCenterDelegate> notificationCenterDelegate;
|
|
265
|
+
|
|
266
|
+
#endif
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
Set custom application language. Must be a lowercase two-letter code according to ISO-639-1 standard ("en", "de", "fr", etc.).
|
|
270
|
+
Device language used by default.
|
|
271
|
+
Set to nil if you want to use device language again.
|
|
272
|
+
*/
|
|
273
|
+
@property (nonatomic) NSString *language;
|
|
274
|
+
|
|
195
275
|
/**
|
|
196
276
|
Initializes PushNotificationManager. Usually called by Pushwoosh Runtime internally.
|
|
197
|
-
@param
|
|
277
|
+
@param appCode Pushwoosh App ID.
|
|
198
278
|
@param appName Application name.
|
|
199
279
|
*/
|
|
200
280
|
+ (void)initializeWithAppCode:(NSString *)appCode appName:(NSString *)appName;
|
|
@@ -210,83 +290,100 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
210
290
|
Registers for push notifications. By default registeres for "UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert" flags.
|
|
211
291
|
Automatically detects if you have "newsstand-content" in "UIBackgroundModes" and adds "UIRemoteNotificationTypeNewsstandContentAvailability" flag.
|
|
212
292
|
*/
|
|
213
|
-
- (void)
|
|
293
|
+
- (void)registerForPushNotifications;
|
|
214
294
|
|
|
215
295
|
/**
|
|
216
|
-
Unregisters from push notifications.
|
|
296
|
+
Unregisters from push notifications.
|
|
217
297
|
*/
|
|
218
|
-
- (void)
|
|
298
|
+
- (void)unregisterForPushNotificationsWithCompletion:(void (^)(NSError *error))completion;
|
|
219
299
|
|
|
220
|
-
|
|
221
|
-
|
|
300
|
+
/**
|
|
301
|
+
Deprecated. Use unregisterForPushNotificationsWithCompletion: method instead
|
|
302
|
+
*/
|
|
303
|
+
- (void)unregisterForPushNotifications __attribute__((deprecated));
|
|
222
304
|
|
|
223
305
|
/**
|
|
224
|
-
|
|
306
|
+
Deprecated. Use initializeWithAppCode:appName: method instead
|
|
225
307
|
*/
|
|
226
|
-
- (
|
|
308
|
+
- (instancetype)initWithApplicationCode:(NSString *)appCode appName:(NSString *)appName __attribute__((deprecated));
|
|
309
|
+
|
|
310
|
+
#if TARGET_OS_IOS
|
|
227
311
|
|
|
228
312
|
/**
|
|
229
|
-
|
|
313
|
+
Deprecated. Use initializeWithAppCode:appName: method instead
|
|
314
|
+
*/
|
|
315
|
+
- (id)initWithApplicationCode:(NSString *)appCode navController:(UIViewController *)navController appName:(NSString *)appName __attribute__((deprecated));
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
Start location tracking.
|
|
319
|
+
|
|
320
|
+
Deprecated. Use PushwooshGeozones framework.
|
|
230
321
|
*/
|
|
231
|
-
- (void)
|
|
322
|
+
- (void)startLocationTracking __attribute__((deprecated("Use PushwooshGeozones framework")));
|
|
232
323
|
|
|
233
324
|
/**
|
|
234
|
-
|
|
325
|
+
Stops location tracking
|
|
326
|
+
|
|
327
|
+
Deprecated. Use PushwooshGeozones framework.
|
|
235
328
|
*/
|
|
236
|
-
- (void)
|
|
329
|
+
- (void)stopLocationTracking __attribute__((deprecated("Use PushwooshGeozones framework")));
|
|
237
330
|
|
|
238
331
|
/**
|
|
239
|
-
|
|
332
|
+
Explicitly sends geolocation to the server for GeoFencing push technology. Also called internally, please use `startLocationTracking` and `stopLocationTracking` functions.
|
|
333
|
+
|
|
334
|
+
@param location Location to be sent.
|
|
335
|
+
|
|
336
|
+
Deprecated. Use PushwooshGeozones framework.
|
|
240
337
|
*/
|
|
241
|
-
- (void)
|
|
338
|
+
- (void)sendLocation:(CLLocation *)location __attribute__((deprecated("Use PushwooshGeozones framework")));
|
|
339
|
+
|
|
340
|
+
#endif
|
|
242
341
|
|
|
243
342
|
/**
|
|
244
343
|
Send tags to server. Tag names have to be created in the Pushwoosh Control Panel. Possible tag types: Integer, String, Incremental (integer only), List tags (array of values).
|
|
245
344
|
|
|
246
345
|
Example:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
nil];
|
|
346
|
+
@code
|
|
347
|
+
NSDictionary *tags = @{ @"Alias" : aliasField.text,
|
|
348
|
+
@"FavNumber" : @([favNumField.text intValue]),
|
|
349
|
+
@"price" : [PWTags incrementalTagWithInteger:5],
|
|
350
|
+
@"List" : @[ @"Item1", @"Item2", @"Item3" ]
|
|
351
|
+
};
|
|
254
352
|
|
|
255
|
-
|
|
353
|
+
[[PushNotificationManager pushManager] setTags:tags];
|
|
354
|
+
@endcode
|
|
256
355
|
|
|
257
356
|
@param tags Dictionary representation of tags to send.
|
|
258
357
|
*/
|
|
259
|
-
- (void)
|
|
358
|
+
- (void)setTags:(NSDictionary *)tags;
|
|
260
359
|
|
|
261
360
|
/**
|
|
262
361
|
Send tags to server with completion block. If setTags succeeds competion is called with nil argument. If setTags fails completion is called with error.
|
|
263
362
|
*/
|
|
264
|
-
- (void)
|
|
363
|
+
- (void)setTags:(NSDictionary *)tags withCompletion:(void (^)(NSError *error))completion;
|
|
265
364
|
|
|
266
365
|
/**
|
|
267
366
|
Get tags from the server. Calls delegate method `onTagsReceived:` or `onTagsFailedToReceive:` depending on the results.
|
|
268
367
|
*/
|
|
269
|
-
- (void)
|
|
368
|
+
- (void)loadTags;
|
|
270
369
|
|
|
271
370
|
/**
|
|
272
371
|
Get tags from server. Calls delegate method if exists and handler (block).
|
|
273
372
|
|
|
274
373
|
@param successHandler The block is executed on the successful completion of the request. This block has no return value and takes one argument: the dictionary representation of the recieved tags.
|
|
275
374
|
Example of the dictionary representation of the received tags:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}
|
|
281
|
-
|
|
375
|
+
{
|
|
376
|
+
Country = ru;
|
|
377
|
+
Language = ru;
|
|
378
|
+
}
|
|
282
379
|
@param errorHandler The block is executed on the unsuccessful completion of the request. This block has no return value and takes one argument: the error that occurred during the request.
|
|
283
380
|
*/
|
|
284
|
-
- (void)
|
|
381
|
+
- (void)loadTags:(PushwooshGetTagsHandler)successHandler error:(PushwooshErrorHandler)errorHandler;
|
|
285
382
|
|
|
286
383
|
/**
|
|
287
384
|
Informs the Pushwoosh about the app being launched. Usually called internally by SDK Runtime.
|
|
288
385
|
*/
|
|
289
|
-
- (void)
|
|
386
|
+
- (void)sendAppOpen;
|
|
290
387
|
|
|
291
388
|
/**
|
|
292
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.
|
|
@@ -294,27 +391,25 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
294
391
|
|
|
295
392
|
@param badge Current badge value.
|
|
296
393
|
*/
|
|
297
|
-
- (void)
|
|
394
|
+
- (void)sendBadges:(NSInteger)badge __API_AVAILABLE(macos(10.10), ios(8.0));
|
|
298
395
|
|
|
299
|
-
|
|
300
|
-
Sends geolocation to the server for GeoFencing push technology. Called internally, please use `startLocationTracking` and `stopLocationTracking` functions.
|
|
301
|
-
|
|
302
|
-
@param location Location to be sent.
|
|
303
|
-
*/
|
|
304
|
-
- (void) sendLocation: (CLLocation *) location;
|
|
396
|
+
+ (NSString *)pushwooshVersion;
|
|
305
397
|
|
|
398
|
+
#if TARGET_OS_IOS
|
|
306
399
|
/**
|
|
307
400
|
Sends in-app purchases to Pushwoosh. Use in paymentQueue:updatedTransactions: payment queue method (see example).
|
|
308
401
|
|
|
309
402
|
Example:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
403
|
+
@code
|
|
404
|
+
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
|
|
405
|
+
[[PushNotificationManager pushManager] sendSKPaymentTransactions:transactions];
|
|
406
|
+
}
|
|
407
|
+
@endcode
|
|
314
408
|
|
|
315
409
|
@param transactions Array of SKPaymentTransaction items as received in the payment queue.
|
|
316
410
|
*/
|
|
317
|
-
- (void)
|
|
411
|
+
- (void)sendSKPaymentTransactions:(NSArray *)transactions;
|
|
412
|
+
|
|
318
413
|
|
|
319
414
|
/**
|
|
320
415
|
Tracks individual in-app purchase. See recommended `sendSKPaymentTransactions:` method.
|
|
@@ -324,14 +419,15 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
324
419
|
@param currencyCode currency of the price (ex: @"USD")
|
|
325
420
|
@param date time of the purchase (ex: [NSDate now])
|
|
326
421
|
*/
|
|
327
|
-
- (void)
|
|
422
|
+
- (void)sendPurchase:(NSString *)productIdentifier withPrice:(NSDecimalNumber *)price currencyCode:(NSString *)currencyCode andDate:(NSDate *)date;
|
|
328
423
|
|
|
424
|
+
#endif
|
|
329
425
|
/**
|
|
330
426
|
Gets current push token.
|
|
331
427
|
|
|
332
428
|
@return Current push token. May be nil if no push token is available yet.
|
|
333
429
|
*/
|
|
334
|
-
- (NSString *)
|
|
430
|
+
- (NSString *)getPushToken;
|
|
335
431
|
|
|
336
432
|
/**
|
|
337
433
|
Gets HWID. Unique device identifier that used in all API calls with Pushwoosh.
|
|
@@ -339,71 +435,74 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
339
435
|
|
|
340
436
|
@return Unique device identifier.
|
|
341
437
|
*/
|
|
342
|
-
- (NSString *)
|
|
438
|
+
- (NSString *)getHWID;
|
|
343
439
|
|
|
344
|
-
- (void)
|
|
345
|
-
- (void)
|
|
440
|
+
- (void)handlePushRegistration:(NSData *)devToken;
|
|
441
|
+
- (void)handlePushRegistrationString:(NSString *)deviceID;
|
|
346
442
|
|
|
347
|
-
|
|
348
|
-
- (void) handlePushRegistrationFailure:(NSError *) error;
|
|
349
|
-
|
|
350
|
-
//if the push is received while the app is running. internal
|
|
351
|
-
- (BOOL) handlePushReceived:(NSDictionary *) userInfo;
|
|
443
|
+
- (void)handlePushRegistrationFailure:(NSError *)error;
|
|
352
444
|
|
|
445
|
+
//If the push is received while the app is running. Call it only for iOS version < 10. For iOS 10 and higher use notificationCenterDelegate.
|
|
446
|
+
- (BOOL)handlePushReceived:(NSDictionary *)userInfo;
|
|
353
447
|
|
|
354
448
|
/**
|
|
355
449
|
Gets APN payload from push notifications dictionary.
|
|
356
450
|
|
|
357
451
|
Example:
|
|
452
|
+
@code
|
|
453
|
+
- (void)onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart {
|
|
454
|
+
NSDictionary * apnPayload = [[PushNotificationsManager pushManager] getApnPayload:pushNotification];
|
|
455
|
+
NSLog(@"%@", apnPayload);
|
|
456
|
+
}
|
|
457
|
+
@endcode
|
|
358
458
|
|
|
359
|
-
- (void) onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart {
|
|
360
|
-
NSDictionary * apnPayload = [[PushNotificationsManager pushManager] getApnPayload:pushNotification];
|
|
361
|
-
NSLog(@"%@", apnPayload);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
459
|
For Push dictionary sample:
|
|
460
|
+
@code
|
|
461
|
+
{
|
|
462
|
+
aps = {
|
|
463
|
+
alert = "Some text.";
|
|
464
|
+
sound = default;
|
|
465
|
+
};
|
|
466
|
+
p = 1pb;
|
|
467
|
+
}
|
|
468
|
+
@endcode
|
|
365
469
|
|
|
366
|
-
{
|
|
367
|
-
aps = {
|
|
368
|
-
alert = "Some text.";
|
|
369
|
-
sound = default;
|
|
370
|
-
};
|
|
371
|
-
p = 1pb;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
470
|
Result is:
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
471
|
+
@code
|
|
472
|
+
{
|
|
473
|
+
alert = "Some text.";
|
|
474
|
+
sound = default;
|
|
475
|
+
};
|
|
476
|
+
@endcode
|
|
381
477
|
@param pushNotification Push notifications dictionary as received in `onPushAccepted: withNotification: onStart:`
|
|
382
478
|
*/
|
|
383
|
-
- (NSDictionary *)
|
|
479
|
+
- (NSDictionary *)getApnPayload:(NSDictionary *)pushNotification;
|
|
384
480
|
|
|
385
481
|
/**
|
|
386
482
|
Gets custom JSON string data from push notifications dictionary as specified in Pushwoosh Control Panel.
|
|
387
483
|
|
|
388
484
|
Example:
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
485
|
+
@code
|
|
486
|
+
- (void)onPushAccepted:(PushNotificationManager *)pushManager withNotification:(NSDictionary *)pushNotification onStart:(BOOL)onStart {
|
|
487
|
+
NSString * customData = [[PushNotificationsManager pushManager] getCustomPushData:pushNotification];
|
|
488
|
+
NSLog(@"%@", customData);
|
|
489
|
+
}
|
|
490
|
+
@endcode
|
|
394
491
|
|
|
395
492
|
@param pushNotification Push notifications dictionary as received in `onPushAccepted: withNotification: onStart:`
|
|
396
493
|
*/
|
|
397
|
-
- (NSString *)
|
|
494
|
+
- (NSString *)getCustomPushData:(NSDictionary *)pushNotification;
|
|
398
495
|
|
|
399
496
|
/**
|
|
400
497
|
The same as getCustomPushData but returns NSDictionary rather than JSON string (converts JSON string into NSDictionary).
|
|
401
498
|
*/
|
|
402
|
-
- (NSDictionary *)
|
|
499
|
+
- (NSDictionary *)getCustomPushDataAsNSDict:(NSDictionary *)pushNotification;
|
|
403
500
|
|
|
404
501
|
/**
|
|
405
502
|
Returns dictionary with enabled remove notificaton types.
|
|
503
|
+
|
|
406
504
|
Example enabled push:
|
|
505
|
+
@code
|
|
407
506
|
{
|
|
408
507
|
enabled = 1;
|
|
409
508
|
pushAlert = 1;
|
|
@@ -411,10 +510,11 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
411
510
|
pushSound = 1;
|
|
412
511
|
type = 7;
|
|
413
512
|
}
|
|
414
|
-
|
|
513
|
+
@endcode
|
|
415
514
|
where "type" field is UIUserNotificationType
|
|
416
515
|
|
|
417
516
|
Disabled push:
|
|
517
|
+
@code
|
|
418
518
|
{
|
|
419
519
|
enabled = 1;
|
|
420
520
|
pushAlert = 0;
|
|
@@ -422,6 +522,7 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
422
522
|
pushSound = 0;
|
|
423
523
|
type = 0;
|
|
424
524
|
}
|
|
525
|
+
@endcode
|
|
425
526
|
|
|
426
527
|
Note: In the latter example "enabled" field means that device can receive push notification but could not display alerts (ex: silent push)
|
|
427
528
|
*/
|
|
@@ -430,13 +531,15 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
430
531
|
/**
|
|
431
532
|
Clears the notifications from the notification center.
|
|
432
533
|
*/
|
|
433
|
-
+ (void)
|
|
534
|
+
+ (void)clearNotificationCenter;
|
|
434
535
|
|
|
435
536
|
/**
|
|
436
537
|
Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
|
|
437
538
|
This allows data and events to be matched across multiple user devices.
|
|
539
|
+
|
|
540
|
+
Deprecated. Use PWInAppManager setUserId method instead
|
|
438
541
|
*/
|
|
439
|
-
- (void)
|
|
542
|
+
- (void)setUserId:(NSString *)userId __attribute__ ((deprecated));;
|
|
440
543
|
|
|
441
544
|
/**
|
|
442
545
|
Move all events from oldUserId to newUserId if doMerge is true. If doMerge is false all events for oldUserId are removed.
|
|
@@ -444,27 +547,36 @@ typedef void(^PushwooshErrorHandler)(NSError *error);
|
|
|
444
547
|
@param oldUserId source user
|
|
445
548
|
@param newUserId destination user
|
|
446
549
|
@param doMerge if false all events for oldUserId are removed, if true all events for oldUserId are moved to newUserId
|
|
447
|
-
@param
|
|
550
|
+
@param completion callback
|
|
551
|
+
|
|
552
|
+
Deprecated. Use PWInAppManager mergeUserId method instead
|
|
448
553
|
*/
|
|
449
|
-
- (void)
|
|
554
|
+
- (void)mergeUserId:(NSString *)oldUserId to:(NSString *)newUserId doMerge:(BOOL)doMerge completion:(void (^)(NSError *error))completion __attribute__ ((deprecated));
|
|
450
555
|
|
|
451
556
|
/**
|
|
452
557
|
Post events for In-App Messages. This can trigger In-App message display as specified in Pushwoosh Control Panel.
|
|
453
558
|
|
|
454
559
|
Example:
|
|
560
|
+
@code
|
|
561
|
+
[[PushNotificationManager pushManager] setUserId:@"96da2f590cd7246bbde0051047b0d6f7"];
|
|
562
|
+
[[PushNotificationManager pushManager] postEvent:@"buttonPressed" withAttributes:@{ @"buttonNumber" : @"4", @"buttonLabel" : @"Banner" } completion:nil];
|
|
563
|
+
@endcode
|
|
455
564
|
|
|
456
|
-
[[PushNotificationManager pushManager] setUserId:@"96da2f590cd7246bbde0051047b0d6f7"];
|
|
457
|
-
[[PushNotificationManager pushManager] postEvent:@"buttonPressed" withAttributes:@{ @"buttonNumber" : @"4", @"buttonLabel" : @"Banner" } completion:nil];
|
|
458
|
-
|
|
459
565
|
@param event name of the event
|
|
460
566
|
@param attributes NSDictionary of event attributes
|
|
461
567
|
@param completion function to call after posting event
|
|
568
|
+
|
|
569
|
+
Deprecated. Use PWInAppManager postEvent method instead
|
|
462
570
|
*/
|
|
463
|
-
- (void)
|
|
571
|
+
- (void)postEvent:(NSString *)event withAttributes:(NSDictionary *)attributes completion:(void (^)(NSError *error))completion __attribute__ ((deprecated));
|
|
464
572
|
|
|
465
573
|
/**
|
|
466
574
|
See `postEvent:withAttributes:completion:`
|
|
575
|
+
|
|
576
|
+
Deprecated. Use PWInAppManager postEvent method instead
|
|
467
577
|
*/
|
|
468
|
-
- (void)
|
|
578
|
+
- (void)postEvent:(NSString *)event withAttributes:(NSDictionary *)attributes __attribute__ ((deprecated));
|
|
579
|
+
|
|
580
|
+
+ (BOOL)isPushwooshMessage:(NSDictionary *)userInfo;
|
|
469
581
|
|
|
470
582
|
@end
|