pushwoosh-cordova-plugin 6.1.0 → 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.
Files changed (79) hide show
  1. package/{MIT-LICENSE.txt → LICENSE.md} +0 -0
  2. package/README.md +20 -32
  3. package/README_PGB.md +32 -0
  4. package/package.json +1 -1
  5. package/package_pgb.json +29 -0
  6. package/plugin.xml +71 -85
  7. package/src/android/src/com/pushwoosh/plugin/internal/PhonegapPluginProvider.java +22 -0
  8. package/src/android/src/com/pushwoosh/plugin/pushnotifications/CustomFirebaseMessagingService.java +29 -0
  9. package/src/android/src/com/pushwoosh/plugin/pushnotifications/InboxUiStyleManager.java +136 -0
  10. package/src/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java +339 -388
  11. package/src/android/src/com/pushwoosh/plugin/pushnotifications/PushwooshNotificationServiceExtension.java +38 -0
  12. package/src/ios/PWBackward.h +25 -0
  13. package/src/ios/PWBackward.m +53 -0
  14. package/src/ios/PushNotification.m +409 -158
  15. package/src/ios/Pushwoosh.framework/Modules/module.modulemap +6 -0
  16. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWAppDelegate.h +20 -0
  17. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWGDPRManager.h +46 -0
  18. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInAppManager.h +174 -0
  19. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInbox.h +147 -0
  20. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWInlineInAppView.h +26 -0
  21. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWLog.h +23 -0
  22. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWMessaging.h +20 -0
  23. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWNotificationExtensionManager.h +33 -0
  24. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWRichMediaManager.h +118 -0
  25. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PWRichMediaStyle.h +122 -0
  26. package/src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h +263 -151
  27. package/src/ios/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h +525 -0
  28. package/src/ios/Pushwoosh.framework/Versions/A/libPushwoosh.a +0 -0
  29. package/src/ios/PushwooshInboxBundle.bundle/Info.plist +0 -0
  30. package/src/ios/PushwooshInboxBundle.bundle/PWIInboxAttachmentViewController.nib +0 -0
  31. package/src/ios/PushwooshInboxBundle.bundle/PWIInboxMessageViewCell.nib +0 -0
  32. package/src/ios/PushwooshInboxBundle.bundle/PWIInboxViewController.nib +0 -0
  33. package/src/ios/PushwooshInboxBundle.bundle/errorMessage@2x.png +0 -0
  34. package/src/ios/PushwooshInboxBundle.bundle/inbox_icon.png +0 -0
  35. package/src/ios/PushwooshInboxBundle.bundle/noMessage@2x.png +0 -0
  36. package/src/ios/PushwooshInboxBundle.bundle/unread.png +0 -0
  37. package/src/ios/PushwooshInboxUI.framework/Modules/module.modulemap +6 -0
  38. package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxStyle.h +122 -0
  39. package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PWIInboxUI.h +39 -0
  40. package/src/ios/PushwooshInboxUI.framework/Versions/A/Headers/PushwooshInboxUI.h +19 -0
  41. package/src/ios/PushwooshInboxUI.framework/Versions/A/libPushwooshInboxUI.a +0 -0
  42. package/src/windows/PushSDK/Newtonsoft.Json.dll +0 -0
  43. package/src/windows/PushSDK/PushSDK.winmd +0 -0
  44. package/src/windows/PushwooshPluginProxy.js +88 -74
  45. package/src/wp8/PushNotification.cs +14 -0
  46. package/src/wp8/PushSDK/PushSDK.dll +0 -0
  47. package/www/PushNotification.js +171 -45
  48. package/Documentation/files/PushNotification-js.html +0 -157
  49. package/Documentation/index/Classes.html +0 -33
  50. package/Documentation/index/Functions.html +0 -61
  51. package/Documentation/index/General.html +0 -65
  52. package/Documentation/index.html +0 -1
  53. package/Documentation/javascript/main.js +0 -841
  54. package/Documentation/javascript/prettify.js +0 -1526
  55. package/Documentation/javascript/searchdata.js +0 -92
  56. package/Documentation/search/ClassesP.html +0 -20
  57. package/Documentation/search/FunctionsA.html +0 -20
  58. package/Documentation/search/FunctionsC.html +0 -20
  59. package/Documentation/search/FunctionsG.html +0 -20
  60. package/Documentation/search/FunctionsO.html +0 -20
  61. package/Documentation/search/FunctionsP.html +0 -20
  62. package/Documentation/search/FunctionsR.html +0 -20
  63. package/Documentation/search/FunctionsS.html +0 -20
  64. package/Documentation/search/FunctionsU.html +0 -20
  65. package/Documentation/search/GeneralA.html +0 -20
  66. package/Documentation/search/GeneralC.html +0 -20
  67. package/Documentation/search/GeneralF.html +0 -20
  68. package/Documentation/search/GeneralG.html +0 -20
  69. package/Documentation/search/GeneralO.html +0 -20
  70. package/Documentation/search/GeneralP.html +0 -20
  71. package/Documentation/search/GeneralR.html +0 -20
  72. package/Documentation/search/GeneralS.html +0 -20
  73. package/Documentation/search/GeneralU.html +0 -20
  74. package/Documentation/search/NoResults.html +0 -15
  75. package/Documentation/styles/main.css +0 -828
  76. package/VERSION.md +0 -138
  77. package/push.gradle +0 -21
  78. package/src/android/src/com/pushwoosh/plugin/pushnotifications/NotificationFactory.java +0 -29
  79. package/src/ios/Pushwoosh.framework/Versions/A/Pushwoosh +0 -0
@@ -0,0 +1,525 @@
1
+ //
2
+ // Pushwoosh.h
3
+ // Pushwoosh SDK
4
+ // (c) Pushwoosh 2020
5
+ //
6
+
7
+ #import <Foundation/Foundation.h>
8
+
9
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
10
+
11
+ #import <UserNotifications/UserNotifications.h>
12
+
13
+ #endif
14
+
15
+ #if TARGET_OS_IOS
16
+
17
+ #import <StoreKit/StoreKit.h>
18
+
19
+ #endif
20
+
21
+ #define PUSHWOOSH_VERSION @"6.3.5"
22
+
23
+
24
+ @class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
25
+
26
+
27
+ typedef void (^PushwooshRegistrationHandler)(NSString *token, NSError *error);
28
+ typedef void (^PushwooshGetTagsHandler)(NSDictionary *tags);
29
+ typedef void (^PushwooshErrorHandler)(NSError *error);
30
+
31
+
32
+ /**
33
+ `PWMessagingDelegate` protocol defines the methods that can be implemented in the delegate of the `Pushwoosh` class' singleton object.
34
+ These methods provide information about the key events for push notification manager such as, receiving push notifications and opening the received notification.
35
+ These methods implementation allows to react on these events properly.
36
+ */
37
+ @protocol PWMessagingDelegate <NSObject>
38
+
39
+ @optional
40
+ /**
41
+ Tells the delegate that the application has received a remote notification.
42
+
43
+ @param pushwoosh The push manager that received the remote notification.
44
+ @param message A PWMessage object 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.
45
+ */
46
+ - (void)pushwoosh:(Pushwoosh *)pushwoosh onMessageReceived:(PWMessage *)message;
47
+
48
+ /**
49
+ Tells the delegate that the user has pressed on the push notification banner.
50
+
51
+ @param pushwoosh The push manager that received the remote notification.
52
+ @param message A PWMessage object 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.
53
+ */
54
+ - (void)pushwoosh:(Pushwoosh *)pushwoosh onMessageOpened:(PWMessage *)message;
55
+
56
+ @end
57
+
58
+
59
+ /**
60
+ Message from Pushwoosh.
61
+ */
62
+ @interface PWMessage : NSObject
63
+
64
+ /**
65
+ Title of the push message.
66
+ */
67
+ @property (nonatomic, readonly) NSString *title;
68
+
69
+ /**
70
+ Subtitle of the push message.
71
+ */
72
+ @property (nonatomic, readonly) NSString *subTitle;
73
+
74
+ /**
75
+ Body of the push message.
76
+ */
77
+ @property (nonatomic, readonly) NSString *message;
78
+
79
+ /**
80
+ Badge number of the push message.
81
+ */
82
+ @property (nonatomic, readonly) NSUInteger badge;
83
+
84
+ /**
85
+ Remote URL or deeplink from the push message.
86
+ */
87
+ @property (nonatomic, readonly) NSString *link;
88
+
89
+ /**
90
+ Returns YES if this message received/opened then the app is in foreground state.
91
+ */
92
+ @property (nonatomic, readonly, getter=isForegroundMessage) BOOL foregroundMessage;
93
+
94
+ /**
95
+ Returns YES if this message contains 'content-available' key (silent or newsstand push).
96
+ */
97
+ @property (nonatomic, readonly, getter=isContentAvailable) BOOL contentAvailable;
98
+
99
+ /**
100
+ Returns YES if this is inbox message.
101
+ */
102
+ @property (nonatomic, readonly, getter=isInboxMessage) BOOL inboxMessage;
103
+
104
+ /**
105
+ Gets custom JSON data from push notifications dictionary as specified in Pushwoosh Control Panel.
106
+ */
107
+ @property (nonatomic, readonly) NSDictionary *customData;
108
+
109
+ /**
110
+ Original payload of the message.
111
+ */
112
+ @property (nonatomic, readonly) NSDictionary *payload;
113
+
114
+ /**
115
+ Returns YES if this message is recieved from Pushwoosh.
116
+ */
117
+ + (BOOL)isPushwooshMessage:(NSDictionary *)userInfo;
118
+
119
+ @end
120
+
121
+
122
+ /**
123
+ `Pushwoosh` 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.
124
+ */
125
+ @interface Pushwoosh : NSObject
126
+
127
+ /**
128
+ Pushwoosh Application ID. Usually retrieved automatically from Info.plist parameter `Pushwoosh_APPID`
129
+ */
130
+ @property (nonatomic, copy, readonly) NSString *applicationCode;
131
+
132
+ /**
133
+ `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.
134
+ Pushwoosh Runtime sets it to ApplicationDelegate by default
135
+ */
136
+ @property (nonatomic, weak) NSObject<PWMessagingDelegate> *delegate;
137
+
138
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
139
+
140
+ /**
141
+ Show push notifications alert when push notification is received while the app is running, default is `YES`
142
+ */
143
+ @property (nonatomic, assign) BOOL showPushnotificationAlert;
144
+
145
+ /**
146
+ Authorization options in addition to UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionCarPlay.
147
+ */
148
+ @property (nonatomic) UNAuthorizationOptions additionalAuthorizationOptions __IOS_AVAILABLE(12.0);
149
+
150
+ #endif
151
+
152
+ /**
153
+ Returns push notification payload if the app was started in response to push notification or null otherwise
154
+ */
155
+ @property (nonatomic, copy, readonly) NSDictionary *launchNotification;
156
+
157
+ /**
158
+ Proxy contains UNUserNotificationCenterDelegate objects.
159
+ */
160
+ @property (nonatomic, readonly) PWNotificationCenterDelegateProxy *notificationCenterDelegateProxy;
161
+
162
+ /**
163
+ Set custom application language. Must be a lowercase two-letter code according to ISO-639-1 standard ("en", "de", "fr", etc.).
164
+ Device language used by default.
165
+ Set to nil if you want to use device language again.
166
+ */
167
+ @property (nonatomic) NSString *language;
168
+
169
+ /**
170
+ Initializes Pushwoosh.
171
+ @param appCode Pushwoosh App ID.
172
+ */
173
+ + (void)initializeWithAppCode:(NSString *)appCode;
174
+
175
+ /**
176
+ Returns an object representing the current push manager.
177
+
178
+ @return A singleton object that represents the push manager.
179
+ */
180
+ + (instancetype)sharedInstance;
181
+
182
+ /**
183
+ Registers for push notifications. By default registeres for "UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert" flags.
184
+ Automatically detects if you have "newsstand-content" in "UIBackgroundModes" and adds "UIRemoteNotificationTypeNewsstandContentAvailability" flag.
185
+ */
186
+ - (void)registerForPushNotifications;
187
+ - (void)registerForPushNotificationsWithCompletion:(PushwooshRegistrationHandler)completion;
188
+
189
+ /**
190
+ Unregisters from push notifications.
191
+ */
192
+ - (void)unregisterForPushNotifications;
193
+ - (void)unregisterForPushNotificationsWithCompletion:(void (^)(NSError *error))completion;
194
+
195
+ /**
196
+ Handle registration to remote notifications.
197
+ */
198
+ - (void)handlePushRegistration:(NSData *)devToken;
199
+ - (void)handlePushRegistrationFailure:(NSError *)error;
200
+
201
+ /**
202
+ Handle received push notification.
203
+ */
204
+ - (BOOL)handlePushReceived:(NSDictionary *)userInfo;
205
+
206
+ /**
207
+ * Change default base url to reverse proxy url
208
+ * @param url - reverse proxy url
209
+ */
210
+ - (void)setReverseProxy:(NSString *)url;
211
+
212
+ /**
213
+ * Disables reverse proxy
214
+ */
215
+ - (void)disableReverseProxy;
216
+
217
+ /**
218
+ 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).
219
+
220
+ Example:
221
+ @code
222
+ NSDictionary *tags = @{ @"Alias" : aliasField.text,
223
+ @"FavNumber" : @([favNumField.text intValue]),
224
+ @"price" : [PWTags incrementalTagWithInteger:5],
225
+ @"List" : @[ @"Item1", @"Item2", @"Item3" ]
226
+ };
227
+
228
+ [[PushNotificationManager pushManager] setTags:tags];
229
+ @endcode
230
+
231
+ @param tags Dictionary representation of tags to send.
232
+ */
233
+ - (void)setTags:(NSDictionary *)tags;
234
+
235
+ /**
236
+ Send tags to server with completion block. If setTags succeeds competion is called with nil argument. If setTags fails completion is called with error.
237
+ */
238
+ - (void)setTags:(NSDictionary *)tags completion:(void (^)(NSError *error))completion;
239
+
240
+ - (void)setEmailTags:(NSDictionary *)tags forEmail:(NSString *)email;
241
+
242
+ - (void)setEmailTags:(NSDictionary *)tags forEmail:(NSString *)email completion:(void(^)(NSError *error))completion;
243
+
244
+ /**
245
+ Get tags from server. Calls delegate method if exists and handler (block).
246
+
247
+ @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.
248
+ Example of the dictionary representation of the received tags:
249
+ {
250
+ Country = ru;
251
+ Language = ru;
252
+ }
253
+ @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.
254
+ */
255
+ - (void)getTags:(PushwooshGetTagsHandler)successHandler onFailure:(PushwooshErrorHandler)errorHandler;
256
+
257
+ /**
258
+ 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.
259
+ This way Pushwoosh server can know what current badge value is set for the application.
260
+
261
+ @param badge Current badge value.
262
+ */
263
+ - (void)sendBadges:(NSInteger)badge __API_AVAILABLE(macos(10.10), ios(8.0));
264
+
265
+ /**
266
+ Pushwoosh SDK version.
267
+ */
268
+ + (NSString *)version;
269
+
270
+ #if TARGET_OS_IOS
271
+ /**
272
+ Sends in-app purchases to Pushwoosh. Use in paymentQueue:updatedTransactions: payment queue method (see example).
273
+
274
+ Example:
275
+ @code
276
+ - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
277
+ [[PushNotificationManager pushManager] sendSKPaymentTransactions:transactions];
278
+ }
279
+ @endcode
280
+
281
+ @param transactions Array of SKPaymentTransaction items as received in the payment queue.
282
+ */
283
+ - (void)sendSKPaymentTransactions:(NSArray *)transactions;
284
+
285
+ /**
286
+ Tracks individual in-app purchase. See recommended `sendSKPaymentTransactions:` method.
287
+
288
+ @param productIdentifier purchased product ID
289
+ @param price price for the product
290
+ @param currencyCode currency of the price (ex: @"USD")
291
+ @param date time of the purchase (ex: [NSDate now])
292
+ */
293
+ - (void)sendPurchase:(NSString *)productIdentifier withPrice:(NSDecimalNumber *)price currencyCode:(NSString *)currencyCode andDate:(NSDate *)date;
294
+
295
+ #endif
296
+ /**
297
+ Gets current push token.
298
+
299
+ @return Current push token. May be nil if no push token is available yet.
300
+ */
301
+ - (NSString *)getPushToken;
302
+
303
+ /**
304
+ Gets HWID. Unique device identifier that used in all API calls with Pushwoosh.
305
+ This is identifierForVendor for iOS >= 7.
306
+
307
+ @return Unique device identifier.
308
+ */
309
+ - (NSString *)getHWID;
310
+
311
+ /**
312
+ Returns dictionary with enabled remove notificaton types.
313
+
314
+ Example enabled push:
315
+ @code
316
+ {
317
+ enabled = 1;
318
+ pushAlert = 1;
319
+ pushBadge = 1;
320
+ pushSound = 1;
321
+ type = 7;
322
+ }
323
+ @endcode
324
+ where "type" field is UIUserNotificationType
325
+
326
+ Disabled push:
327
+ @code
328
+ {
329
+ enabled = 1;
330
+ pushAlert = 0;
331
+ pushBadge = 0;
332
+ pushSound = 0;
333
+ type = 0;
334
+ }
335
+ @endcode
336
+
337
+ Note: In the latter example "enabled" field means that device can receive push notification but could not display alerts (ex: silent push)
338
+ */
339
+ + (NSMutableDictionary *)getRemoteNotificationStatus;
340
+
341
+ /**
342
+ Clears the notifications from the notification center.
343
+ */
344
+ + (void)clearNotificationCenter;
345
+
346
+ /**
347
+ Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
348
+ This allows data and events to be matched across multiple user devices.
349
+ If setUserId succeeds competion is called with nil argument. If setUserId fails completion is called with error.
350
+
351
+ @param userId user identifier
352
+ */
353
+ - (void)setUserId:(NSString *)userId completion:(void(^)(NSError * error))completion;
354
+
355
+ /**
356
+ Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
357
+ This allows data and events to be matched across multiple user devices.
358
+
359
+ @param userId user identifier
360
+ */
361
+ - (void)setUserId:(NSString *)userId;
362
+
363
+ /**
364
+ Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
365
+ This allows data and events to be matched across multiple user devices.
366
+ If setUser succeeds competion is called with nil argument. If setUser fails completion is called with error.
367
+
368
+ @param userId user identifier
369
+ @param emails user's emails array
370
+ */
371
+ - (void)setUser:(NSString *)userId emails:(NSArray *)emails completion:(void(^)(NSError * error))completion;
372
+
373
+
374
+ /**
375
+ Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
376
+ This allows data and events to be matched across multiple user devices.
377
+
378
+ @param userId user identifier
379
+ @param emails user's emails array
380
+ */
381
+ - (void)setUser:(NSString *)userId emails:(NSArray *)emails;
382
+
383
+ /**
384
+ Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
385
+ This allows data and events to be matched across multiple user devices.
386
+ If setUser succeeds competion is called with nil argument. If setUser fails completion is called with error.
387
+
388
+ @param userId user identifier
389
+ @param email user's email string
390
+ */
391
+ - (void)setUser:(NSString *)userId email:(NSString *)email completion:(void(^)(NSError * error))completion;
392
+
393
+ /**
394
+ Register emails list associated to the current user.
395
+ If setEmails succeeds competion is called with nil argument. If setEmails fails completion is called with error.
396
+
397
+ @param emails user's emails array
398
+ */
399
+ - (void)setEmails:(NSArray *)emails completion:(void(^)(NSError * error))completion;
400
+
401
+ /**
402
+ Register emails list associated to the current user.
403
+
404
+ @param emails user's emails array
405
+ */
406
+ - (void)setEmails:(NSArray *)emails;
407
+
408
+ /**
409
+ Register email associated to the current user. Email should be a string and could not be null or empty.
410
+ If setEmail succeeds competion is called with nil argument. If setEmail fails completion is called with error.
411
+
412
+ @param email user's email string
413
+ */
414
+ - (void)setEmail:(NSString *)email completion:(void(^)(NSError * error))completion;
415
+
416
+ /**
417
+ Register email associated to the current user. Email should be a string and could not be null or empty.
418
+
419
+ @param email user's email string
420
+ */
421
+ - (void)setEmail:(NSString *)email;
422
+
423
+ /**
424
+ Move all events from oldUserId to newUserId if doMerge is true. If doMerge is false all events for oldUserId are removed.
425
+
426
+ @param oldUserId source user
427
+ @param newUserId destination user
428
+ @param doMerge if false all events for oldUserId are removed, if true all events for oldUserId are moved to newUserId
429
+ @param completion callback
430
+ */
431
+ - (void)mergeUserId:(NSString *)oldUserId to:(NSString *)newUserId doMerge:(BOOL)doMerge completion:(void (^)(NSError *error))completion;
432
+
433
+ /**
434
+ Starts communication with Pushwoosh server.
435
+ */
436
+ - (void)startServerCommunication;
437
+
438
+ /**
439
+ Stops communication with Pushwoosh server.
440
+ */
441
+ - (void)stopServerCommunication;
442
+
443
+ /**
444
+ Process URL of some deep link. Primarly used for register test devices.
445
+
446
+ @param url Deep Link URL
447
+ */
448
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
449
+ - (BOOL)handleOpenURL:(NSURL *)url;
450
+ #endif
451
+
452
+ @end
453
+
454
+ /**
455
+ `PWNotificationCenterDelegateProxy` class handles notifications on iOS 10 and forwards methods of UNUserNotificationCenterDelegate to all added delegates.
456
+ */
457
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
458
+ @interface PWNotificationCenterDelegateProxy : NSObject <UNUserNotificationCenterDelegate>
459
+ #elif TARGET_OS_OSX
460
+ @interface PWNotificationCenterDelegateProxy : NSObject <NSUserNotificationCenterDelegate>
461
+ #endif
462
+ /**
463
+ Returns UNUserNotificationCenterDelegate that handles foreground push notifications on iOS10
464
+ */
465
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
466
+ @property (nonatomic, strong, readonly) id<UNUserNotificationCenterDelegate> defaultNotificationCenterDelegate;
467
+ #elif TARGET_OS_OSX
468
+ @property (nonatomic, strong, readonly) id<NSUserNotificationCenterDelegate> defaultNotificationCenterDelegate;
469
+ #endif
470
+
471
+ /**
472
+ Adds extra UNUserNotificationCenterDelegate that handles foreground push notifications on iOS10.
473
+ */
474
+ #if TARGET_OS_IOS || TARGET_OS_WATCH
475
+ - (void)addNotificationCenterDelegate:(id<UNUserNotificationCenterDelegate>)delegate;
476
+ #endif
477
+ @end
478
+
479
+
480
+ /**
481
+ `PWTagsBuilder` class encapsulates the methods for creating tags parameters for sending them to the server.
482
+ */
483
+ @interface PWTagsBuilder : NSObject
484
+ /**
485
+ Creates a dictionary for incrementing/decrementing a numeric tag on the server.
486
+
487
+ Example:
488
+ @code
489
+ NSDictionary *tags = @{
490
+ @"Alias" : aliasField.text,
491
+ @"FavNumber" : @([favNumField.text intValue]),
492
+ @"price": [PWTags incrementalTagWithInteger:5],
493
+ };
494
+
495
+ [[PushNotificationManager pushManager] setTags:tags];
496
+ @endcode
497
+
498
+ @param delta Difference that needs to be applied to the tag's counter.
499
+
500
+ @return Dictionary, that needs to be sent as the value for the tag
501
+ */
502
+ + (NSDictionary *)incrementalTagWithInteger:(NSInteger)delta;
503
+
504
+ /**
505
+ Creates a dictionary for extending Tag’s values list with additional values
506
+
507
+ Example:
508
+
509
+ @code
510
+ NSDictionary *tags = @{
511
+ @"Alias" : aliasField.text,
512
+ @"FavNumber" : @([favNumField.text intValue]),
513
+ @"List" : [PWTags appendValuesToListTag:@[ @"Item1" ]]
514
+ };
515
+
516
+ [[PushNotificationManager pushManager] setTags:tags];
517
+ @endcode
518
+
519
+ @param array Array of values to be added to the tag.
520
+
521
+ @return Dictionary to be sent as the value for the tag
522
+ */
523
+ + (NSDictionary *)appendValuesToListTag:(NSArray<NSString *> *)array;
524
+
525
+ @end
@@ -0,0 +1,6 @@
1
+ framework module PushwooshInboxUI {
2
+ umbrella header "PushwooshInboxUI.h"
3
+
4
+ export *
5
+ module * { export * }
6
+ }
@@ -0,0 +1,122 @@
1
+ //
2
+ // PWIInboxStyle.h
3
+ // PushwooshInboxUI
4
+ //
5
+ // Created by Pushwoosh on 01/11/2017.
6
+ // Copyright © 2017 Pushwoosh. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+ #import <UIKit/UIKit.h>
11
+
12
+ typedef NSString * (^PWIDateFormatterBlock)(NSDate *date, NSObject *owner);
13
+
14
+ //! This class is designed to customize the Inbox appearance
15
+ @interface PWIInboxStyle : NSObject
16
+
17
+ //! This block customizes the date formatting
18
+ @property (nonatomic, readwrite) PWIDateFormatterBlock dateFormatterBlock;
19
+
20
+ //! The default icon in the cell next to the message; if not specified, the app icon is used
21
+ @property (nonatomic, readwrite) UIImage *defaultImageIcon;
22
+
23
+ //! The default font
24
+ @property (nonatomic, readwrite) UIFont *defaultFont;
25
+
26
+ //! The default text color
27
+ @property (nonatomic, readwrite) UIColor *defaultTextColor;
28
+
29
+ //! The text color of a read notification
30
+ @property (nonatomic, readwrite) UIColor *readTextColor;
31
+
32
+ //! The default background color
33
+ @property (nonatomic, readwrite) UIColor *backgroundColor;
34
+
35
+ //! The default selection color
36
+ @property (nonatomic, readwrite) UIColor *selectionColor;
37
+
38
+ //! The appearance of the unread messages mark
39
+ @property (nonatomic, readwrite) UIImage *unreadImage;
40
+
41
+ //! The image which is displayed if an error occurs and the list of inbox messages is empty
42
+ @property (nonatomic, readwrite) UIImage *listErrorImage;
43
+
44
+ //! The error text which is displayed when an error occurs; cannot be localized
45
+ @property (nonatomic, readwrite) NSString *listErrorMessage;
46
+
47
+ //! The image which is displayed if the list of inbox messages is empty
48
+ @property (nonatomic, readwrite) UIImage *listEmptyImage;
49
+
50
+ //! The text which is displayed if the list of inbox messages is empty; cannot be localized
51
+ @property (nonatomic, readwrite) NSString *listEmptyMessage;
52
+
53
+ //! The accent color
54
+ @property (nonatomic, readwrite) UIColor *accentColor;
55
+
56
+ //! The color of message titles
57
+ @property (nonatomic, readwrite) UIColor *titleColor;
58
+
59
+ //! The title color for read notifications
60
+ @property (nonatomic, readwrite) UIColor *readTitleColor;
61
+
62
+ //! The color of messages descriptions
63
+ @property (nonatomic, readwrite) UIColor *descriptionColor;
64
+
65
+ //! The color of message dates
66
+ @property (nonatomic, readwrite) UIColor *dateColor;
67
+
68
+ //! The color of the separator
69
+ @property (nonatomic, readwrite) UIColor *separatorColor;
70
+
71
+ //! The font of message titles
72
+ @property (nonatomic, readwrite) UIFont *titleFont;
73
+
74
+ //! The font of message descriptions
75
+ @property (nonatomic, readwrite) UIFont *descriptionFont;
76
+
77
+ //! The font of message dates
78
+ @property (nonatomic, readwrite) UIFont *dateFont;
79
+
80
+ //! The default bar color
81
+ @property (nonatomic, readwrite) UIColor *barBackgroundColor;
82
+
83
+ //! The default back button color
84
+ @property(nonatomic, readwrite) UIColor *barAccentColor;
85
+
86
+ //! The default bar accent color
87
+ @property (nonatomic, readwrite) UIColor *barTextColor;
88
+
89
+ //! The default bar title text
90
+ @property (nonatomic, readwrite) NSString *barTitle;
91
+
92
+ /**
93
+ The method returning the default style; all parameters might be changed
94
+
95
+ @retutn instance of default style
96
+ */
97
+ + (instancetype)defaultStyle;
98
+
99
+ /**
100
+ This method updates the default style for PWInboxViewController
101
+
102
+ @param style the new default style for PWInboxViewController
103
+ */
104
+ + (void)setupDefaultStyle:(PWIInboxStyle *)style;
105
+
106
+ /**
107
+ The method filling style's fields based on following parameters: icon, textColor, accentColor, date; all parameters might be changed
108
+ */
109
+ + (instancetype)customStyleWithDefaultImageIcon:(UIImage *)icon
110
+ textColor:(UIColor *)textColor
111
+ accentColor:(UIColor *)accentColor
112
+ font:(UIFont *)font;
113
+ /**
114
+ The method filling style's fields based on following parameters: icon, textColor, accentColor, font, dateFormatterBlock; all parameters might be changed
115
+ */
116
+ + (instancetype)customStyleWithDefaultImageIcon:(UIImage *)icon
117
+ textColor:(UIColor *)textColor
118
+ accentColor:(UIColor *)accentColor
119
+ font:(UIFont *)font
120
+ dateFromatterBlock:(PWIDateFormatterBlock)dateFormatterBlock;
121
+
122
+ @end