pushwoosh-react-native-plugin 2.0.0 → 2.2.17
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/.github/ISSUE_TEMPLATE/bug_report.yml +135 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +31 -0
- package/.github/ISSUE_TEMPLATE/question.yml +28 -0
- package/InlineInApp.js +71 -0
- package/README.md +35 -85
- package/docs/README.md +230 -11
- package/index.d.ts +91 -0
- package/index.js +265 -24
- package/package.json +12 -1
- package/pushwoosh-react-native-plugin.podspec +20 -0
- package/react-native.config.js +9 -0
- package/scripts/add_inbox_ios_resources.js +42 -0
- package/src/android/build.gradle +40 -10
- package/src/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/android/gradlew +160 -0
- package/src/android/gradlew.bat +90 -0
- package/src/android/src/main/AndroidManifest.xml +19 -54
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/ConversionUtil.java +214 -148
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/CustomFirebaseMessagingService.java +29 -0
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/EventDispatcher.java +7 -6
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/InboxUiStyleManager.java +162 -0
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/InlineInAppManager.java +48 -0
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/PushwooshNotificationServiceExtension.java +44 -0
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/PushwooshPackage.java +4 -2
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/PushwooshPlugin.java +606 -393
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/RCTInlineInAppView.java +75 -0
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/internal/ReactNativePluginProvider.java +15 -0
- package/src/ios/PWAppDelegate.h +20 -0
- package/src/ios/PWGDPRManager.h +46 -0
- package/src/ios/PWIInboxStyle.h +122 -0
- package/src/ios/PWIInboxUI.h +39 -0
- package/src/ios/PWInAppManager.h +176 -0
- package/src/ios/PWInbox.h +147 -0
- package/src/ios/PWInlineInAppView.h +26 -0
- package/src/ios/PWLog.h +23 -0
- package/src/ios/PWMessaging.h +20 -0
- package/src/ios/PWNotificationExtensionManager.h +46 -0
- package/src/ios/PWRichMediaManager.h +123 -0
- package/src/ios/PWRichMediaStyle.h +122 -0
- package/src/ios/PushNotificationManager.h +234 -111
- package/src/ios/Pushwoosh.h +623 -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.h +19 -0
- package/src/ios/PushwooshPlugin/PWEventDispatcher.h +1 -1
- package/src/ios/PushwooshPlugin/PWInlineInAppManager.h +17 -0
- package/src/ios/PushwooshPlugin/PWInlineInAppManager.m +54 -0
- package/src/ios/PushwooshPlugin/Pushwoosh.h +18 -3
- package/src/ios/PushwooshPlugin/Pushwoosh.m +532 -98
- package/src/ios/PushwooshPlugin.xcodeproj/project.pbxproj +27 -6
- package/src/ios/libPushwoosh.a +0 -0
- package/src/ios/libPushwooshInboxUI.a +0 -0
- package/.npmignore +0 -3
- package/src/android/.npmignore +0 -1
- package/src/android/pushwooshplugin.iml +0 -150
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/NotificationReceiver.java +0 -42
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/PostEventActivity.java +0 -45
- package/src/ios/Pushwoosh.a +0 -0
- package/src/ios/PushwooshPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
package/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const PushwooshModule = NativeModules.Pushwoosh;
|
|
|
16
16
|
//
|
|
17
17
|
//const Pushwoosh = require('pushwoosh-react-native-plugin');
|
|
18
18
|
//
|
|
19
|
-
//Pushwoosh.init({ "pw_appid" : "XXXX-XXXX", "project_number" : "XXXXXXXXXXXXX" });
|
|
19
|
+
//Pushwoosh.init({ "pw_appid" : "XXXX-XXXX", "project_number" : "XXXXXXXXXXXXX", "reverse_proxy_url" : "your_url_proxy" });
|
|
20
20
|
//
|
|
21
21
|
//Pushwoosh.register(
|
|
22
22
|
// (token) => {
|
|
@@ -47,6 +47,42 @@ class PushNotification {
|
|
|
47
47
|
PushwooshModule.init(config, success, fail);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
//Function: createLocalNotification
|
|
51
|
+
//Creates a local notification with a specified message, delay and custom data
|
|
52
|
+
//
|
|
53
|
+
//Example:
|
|
54
|
+
//(start code)
|
|
55
|
+
// //creates a local notification with "message" content, 5 seconds delay and passes {"somedata":"optional"} object in payload
|
|
56
|
+
// Pushwoosh.createLocalNotification({msg:"message", seconds:5, userData:{"somedata":"optional"}});
|
|
57
|
+
//(end)
|
|
58
|
+
|
|
59
|
+
createLocalNotification(data: Object){
|
|
60
|
+
PushwooshModule.createLocalNotification(data);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//Function: clearLocalNotification
|
|
64
|
+
//Clears all existing and cancels all pending local notifications
|
|
65
|
+
//
|
|
66
|
+
//Example:
|
|
67
|
+
//(start code)
|
|
68
|
+
// Pushwoosh.clearLocalNotification();
|
|
69
|
+
//(end)
|
|
70
|
+
|
|
71
|
+
clearLocalNotification(){
|
|
72
|
+
PushwooshModule.clearLocalNotification();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//Function: clearNotificationCenter
|
|
76
|
+
//Clears all existing and cancels all pending notifications
|
|
77
|
+
//
|
|
78
|
+
//Example:
|
|
79
|
+
//(start code)
|
|
80
|
+
// Pushwoosh.clearNotificationCenter();
|
|
81
|
+
//(end)
|
|
82
|
+
clearNotificationCenter(){
|
|
83
|
+
PushwooshModule.clearNotificationCenter();
|
|
84
|
+
}
|
|
85
|
+
|
|
50
86
|
//Function: register
|
|
51
87
|
//Call this to register for push notifications and retreive a push Token
|
|
52
88
|
//
|
|
@@ -106,7 +142,7 @@ class PushNotification {
|
|
|
106
142
|
// }
|
|
107
143
|
// );
|
|
108
144
|
//
|
|
109
|
-
// //
|
|
145
|
+
// //settings list tags "MyTag" with values (array) "hello", "world"
|
|
110
146
|
// pushNotification.setTags({"MyTag":["hello", "world"]});
|
|
111
147
|
//(end)
|
|
112
148
|
setTags(tags: Object, success: ?Function, fail: ?Function) {
|
|
@@ -142,6 +178,30 @@ class PushNotification {
|
|
|
142
178
|
PushwooshModule.getTags(success, fail);
|
|
143
179
|
}
|
|
144
180
|
|
|
181
|
+
//Function: setShowPushnotificationAlert
|
|
182
|
+
//Set push notifications alert when push notification is received while the app is running, default is `true`
|
|
183
|
+
//
|
|
184
|
+
//Example:
|
|
185
|
+
//(start code)
|
|
186
|
+
// Pushwoosh.setShowPushnotificationAlert(false);
|
|
187
|
+
//(end)
|
|
188
|
+
setShowPushnotificationAlert(showPushnotificationAlert: boolean) {
|
|
189
|
+
PushwooshModule.setShowPushnotificationAlert(showPushnotificationAlert);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
//Function: getShowPushnotificationAlert
|
|
193
|
+
//Show push notifications alert when push notification is received while the app is running, default is `true`
|
|
194
|
+
//
|
|
195
|
+
//Example:
|
|
196
|
+
//(start code)
|
|
197
|
+
// Pushwoosh.getShowPushnotificationAlert((showPushnotificationAlert) => {
|
|
198
|
+
// console.warn("showPushnotificationAlert = " + showPushnotificationAlert);
|
|
199
|
+
// });
|
|
200
|
+
//(end)
|
|
201
|
+
getShowPushnotificationAlert(callback: Function) {
|
|
202
|
+
PushwooshModule.getShowPushnotificationAlert(callback);
|
|
203
|
+
}
|
|
204
|
+
|
|
145
205
|
//Function: getPushToken
|
|
146
206
|
//Call this to get push token if it is available. Note the token also comes in registerDevice function callback.
|
|
147
207
|
//
|
|
@@ -184,6 +244,22 @@ class PushNotification {
|
|
|
184
244
|
PushwooshModule.setUserId(userId);
|
|
185
245
|
}
|
|
186
246
|
|
|
247
|
+
//Function: setUserId: completion:
|
|
248
|
+
//[android, ios] Set User indetifier. This could be Facebook ID, username or email, or any other user ID.
|
|
249
|
+
//This allows data and events to be matched across multiple user devices.
|
|
250
|
+
//If setUserId succeeds competion is called with nil argument. If setUserId fails completion is called with error.
|
|
251
|
+
//Parameters:
|
|
252
|
+
// "userId" - user string identifier
|
|
253
|
+
setUserId(userId: string, success: ?Function, fail: ?Function) {
|
|
254
|
+
if (!success) {
|
|
255
|
+
success = function() {};
|
|
256
|
+
}
|
|
257
|
+
if (!fail) {
|
|
258
|
+
fail = function(error) {};
|
|
259
|
+
}
|
|
260
|
+
PushwooshModule.setUserId(userId, success, fail);
|
|
261
|
+
}
|
|
262
|
+
|
|
187
263
|
//Function: postEvent
|
|
188
264
|
//[android, ios] Post events for In-App Messages. This can trigger In-App message display as specified in Pushwoosh Control Panel.
|
|
189
265
|
//
|
|
@@ -203,28 +279,6 @@ class PushNotification {
|
|
|
203
279
|
PushwooshModule.postEvent(event, attributes);
|
|
204
280
|
}
|
|
205
281
|
|
|
206
|
-
//Function: startLocationTracking
|
|
207
|
-
//[android, ios, wp8, windows] Starts geolocation based push notifications. You need to configure Geozones in Pushwoosh Control panel.
|
|
208
|
-
//
|
|
209
|
-
//Parameters:
|
|
210
|
-
// "success" - success callback
|
|
211
|
-
// "fail" - error callback
|
|
212
|
-
//
|
|
213
|
-
startLocationTracking() {
|
|
214
|
-
PushwooshModule.startLocationTracking();
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
//Function: stopLocationTracking
|
|
218
|
-
//[android, ios, wp8, windows] Stops geolocation based push notifications
|
|
219
|
-
//
|
|
220
|
-
//Parameters:
|
|
221
|
-
// "success" - success callback
|
|
222
|
-
// "fail" - error callback
|
|
223
|
-
//
|
|
224
|
-
stopLocationTracking() {
|
|
225
|
-
PushwooshModule.stopLocationTracking();
|
|
226
|
-
}
|
|
227
|
-
|
|
228
282
|
//Function: setApplicationIconBadgeNumber
|
|
229
283
|
//[android, ios, wp8, windows] Set the application icon badge number
|
|
230
284
|
//
|
|
@@ -319,6 +373,193 @@ class PushNotification {
|
|
|
319
373
|
setVibrateType(type: number) {
|
|
320
374
|
PushwooshModule.setVibrateType(type);
|
|
321
375
|
}
|
|
376
|
+
|
|
377
|
+
//Function: presentInboxUI
|
|
378
|
+
//[android, ios] Opens Inbox screen.
|
|
379
|
+
//
|
|
380
|
+
// Supported style keys:
|
|
381
|
+
//
|
|
382
|
+
// Customizes the date formatting
|
|
383
|
+
// "dateFormat"
|
|
384
|
+
//
|
|
385
|
+
// The default icon in the cell next to the message; if not specified, the app icon is used
|
|
386
|
+
// "defaultImageIcon"
|
|
387
|
+
//
|
|
388
|
+
// The appearance of the unread messages mark (iOS only)
|
|
389
|
+
// "unreadImage"
|
|
390
|
+
//
|
|
391
|
+
// The image which is displayed if an error occurs and the list of inbox messages is empty
|
|
392
|
+
// "listErrorImage"
|
|
393
|
+
//
|
|
394
|
+
// The image which is displayed if the list of inbox messages is empty
|
|
395
|
+
// "listEmptyImage"
|
|
396
|
+
//
|
|
397
|
+
// The error text which is displayed when an error occurs; cannot be localized
|
|
398
|
+
// "listErrorMessage"
|
|
399
|
+
//
|
|
400
|
+
// The text which is displayed if the list of inbox messages is empty; cannot be localized
|
|
401
|
+
// "listEmptyMessage"
|
|
402
|
+
//
|
|
403
|
+
// The default text color (iOS only)
|
|
404
|
+
// "defaultTextColor"
|
|
405
|
+
//
|
|
406
|
+
// The accent color
|
|
407
|
+
// "accentColor"
|
|
408
|
+
//
|
|
409
|
+
// The default background color
|
|
410
|
+
// "backgroundColor"
|
|
411
|
+
//
|
|
412
|
+
// The default selection color
|
|
413
|
+
// "highlightColor"
|
|
414
|
+
//
|
|
415
|
+
// The color of message titles
|
|
416
|
+
// "titleColor"
|
|
417
|
+
//
|
|
418
|
+
// The color of message titles if message was readed (Android only)
|
|
419
|
+
// "readTitleColor"
|
|
420
|
+
//
|
|
421
|
+
// The color of messages descriptions
|
|
422
|
+
// "descriptionColor"
|
|
423
|
+
//
|
|
424
|
+
// The color of messages descriptions if message was readed (Android only)
|
|
425
|
+
// "readDescriptionColor"
|
|
426
|
+
//
|
|
427
|
+
// The color of message dates
|
|
428
|
+
// "dateColor"
|
|
429
|
+
//
|
|
430
|
+
// The color of message dates if message was readed (Android only)
|
|
431
|
+
// "readDateColor"
|
|
432
|
+
//
|
|
433
|
+
// The color of the separator
|
|
434
|
+
// "dividerColor"
|
|
435
|
+
//
|
|
436
|
+
//Example:
|
|
437
|
+
//(start code)
|
|
438
|
+
// Pushwoosh.presentInboxUI({
|
|
439
|
+
// "dateFormat" : "dd.MMMM.YYYY",
|
|
440
|
+
// "defaultImageIcon" : Image.resolveAssetSource(require('./icon.png')),
|
|
441
|
+
// "listErrorImage" : Image.resolveAssetSource(require('./error.png')),
|
|
442
|
+
// "listEmptyImage" : Image.resolveAssetSource(require('./empty.png')),
|
|
443
|
+
// "listErrorMessage" : "Error message1",
|
|
444
|
+
// "listEmptyMessage" : "Error message2",
|
|
445
|
+
// "accentColor" : processColor('#ff00ff'),
|
|
446
|
+
// "highlightColor" : processColor('yellow'),
|
|
447
|
+
// "dateColor" : processColor('blue'),
|
|
448
|
+
// "titleColor" : processColor('#ff00ff'),
|
|
449
|
+
// "dividerColor" : processColor('#ff00ff'),
|
|
450
|
+
// "descriptionColor" : processColor('green'),
|
|
451
|
+
// "backgroundColor" : processColor('rgba(255, 100, 30, 1.0)'),
|
|
452
|
+
// "barBackgroundColor" : processColor('#ffffff'),
|
|
453
|
+
// "barAccentColor" : processColor('#ffd700'),
|
|
454
|
+
// "barTextColor" : processColor('#282828')
|
|
455
|
+
// });
|
|
456
|
+
//(end)
|
|
457
|
+
|
|
458
|
+
presentInboxUI(style: ?Object) {
|
|
459
|
+
PushwooshModule.presentInboxUI(style);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
messagesWithNoActionPerformedCount(result: Function) {
|
|
463
|
+
PushwooshModule.messagesWithNoActionPerformedCount(result);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
unreadMessagesCount(result: Function) {
|
|
467
|
+
PushwooshModule.unreadMessagesCount(result);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
messagesCount(result: Function) {
|
|
471
|
+
PushwooshModule.messagesCount(result);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
loadMessages(success: Function, fail: ?Function) {
|
|
475
|
+
if (!fail) {
|
|
476
|
+
fail = function() {};
|
|
477
|
+
}
|
|
478
|
+
PushwooshModule.loadMessages(success, fail);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
readMessage(id: string) {
|
|
482
|
+
PushwooshModule.readMessage(id);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
readMessages(ids: Array) {
|
|
486
|
+
PushwooshModule.readMessages(ids);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
deleteMessage(id: string) {
|
|
490
|
+
PushwooshModule.deleteMessage(id);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
deleteMessages(ids: Array) {
|
|
494
|
+
PushwooshModule.deleteMessages(ids);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
performAction(id: string) {
|
|
498
|
+
PushwooshModule.performAction(id);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Show inApp for change setting Enable/disable all communication with Pushwoosh
|
|
502
|
+
showGDPRConsentUI(){
|
|
503
|
+
PushwooshModule.showGDPRConsentUI();
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Show inApp for all device data from Pushwoosh and stops all interactions and communication permanently.
|
|
507
|
+
showGDPRDeletionUI(){
|
|
508
|
+
PushwooshModule.showGDPRDeletionUI();
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
isDeviceDataRemoved(success: Function){
|
|
512
|
+
PushwooshModule.isDeviceDataRemoved(success);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// Return flag is enable communication with server
|
|
516
|
+
isCommunicationEnabled(success: Function){
|
|
517
|
+
PushwooshModule.isCommunicationEnabled(success);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// Return flag is enabled GDPR on server
|
|
521
|
+
isAvailableGDPR(success: Function){
|
|
522
|
+
PushwooshModule.isAvailableGDPR(success);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// Enable/disable all communication with Pushwoosh. Enabled by default.
|
|
526
|
+
setCommunicationEnabled(enable: boolean, success: ?Function, fail: ?Function) {
|
|
527
|
+
if (!success) {
|
|
528
|
+
success = function() {};
|
|
529
|
+
}
|
|
530
|
+
if (!fail) {
|
|
531
|
+
fail = function(error) {};
|
|
532
|
+
}
|
|
533
|
+
PushwooshModule.setCommunicationEnabled(enable, success, fail);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Removes all device data from Pushwoosh and stops all interactions and communication permanently.
|
|
537
|
+
removeAllDeviceData( success: ?Function, fail: ?Function) {
|
|
538
|
+
if (!success) {
|
|
539
|
+
success = function() {};
|
|
540
|
+
}
|
|
541
|
+
if (!fail) {
|
|
542
|
+
fail = function(error) {};
|
|
543
|
+
}
|
|
544
|
+
PushwooshModule.removeAllDeviceData(success, fail);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// Set notification icon background color
|
|
548
|
+
setNotificationIconBackgroundColor(color: string) {
|
|
549
|
+
PushwooshModule.setNotificationIconBackgroundColor(color);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// Set custom application language. Must be a lowercase two-letter code according to ISO-639-1 standard ("en", "de", "fr", etc.).
|
|
553
|
+
// Device language used by default.
|
|
554
|
+
// Set to null if you want to use device language again.
|
|
555
|
+
setLanguage(language: string) {
|
|
556
|
+
PushwooshModule.setLanguage(language);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Enables Huawei push messaging
|
|
560
|
+
enableHuaweiPushNotifications() {
|
|
561
|
+
PushwooshModule.enableHuaweiPushNotifications();
|
|
562
|
+
}
|
|
322
563
|
}
|
|
323
564
|
|
|
324
565
|
module.exports = new PushNotification();
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pushwoosh-react-native-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.17",
|
|
4
4
|
"description": "This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/Pushwoosh/pushwoosh-react-native-plugin.git"
|
|
@@ -15,5 +16,15 @@
|
|
|
15
16
|
"license": "MIT",
|
|
16
17
|
"bugs": {
|
|
17
18
|
"url": "https://github.com/Pushwoosh/pushwoosh-react-native-plugin/issues"
|
|
19
|
+
},
|
|
20
|
+
"rnpm": {
|
|
21
|
+
"android": {
|
|
22
|
+
"sourceDir": "./src/android"
|
|
23
|
+
},
|
|
24
|
+
"ios": {
|
|
25
|
+
"podspecName": "pushwoosh-react-native-plugin",
|
|
26
|
+
"podspecPath": "./pushwoosh-react-native-plugin.podspec",
|
|
27
|
+
"assets" : [ "./src/ios/PushwooshInboxBundle.bundle" ]
|
|
28
|
+
}
|
|
18
29
|
}
|
|
19
30
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = "pushwoosh-react-native-plugin"
|
|
3
|
+
s.version = "2.2.17"
|
|
4
|
+
s.summary = "React Native Pushwoosh Push Notifications module"
|
|
5
|
+
s.requires_arc = true
|
|
6
|
+
s.author = 'Pushwoosh'
|
|
7
|
+
s.license = 'MIT'
|
|
8
|
+
s.homepage = 'n/a'
|
|
9
|
+
s.source = { :git => "https://github.com/Pushwoosh/pushwoosh-react-native-plugin.git" }
|
|
10
|
+
s.source_files = 'src/ios/PushwooshPlugin/Pushwoosh.{h,m}', 'src/ios/PushwooshPlugin/PWEventDispatcher.{h,m}', 'src/ios/PushwooshPlugin/PWInlineInAppManager.{h,m}'
|
|
11
|
+
s.platform = :ios, "11.0"
|
|
12
|
+
s.xcconfig = {
|
|
13
|
+
"HEADER_SEARCH_PATHS" => "${PODS_ROOT}/Headers/Public/React"
|
|
14
|
+
}
|
|
15
|
+
s.static_framework = true
|
|
16
|
+
|
|
17
|
+
s.dependency 'React'
|
|
18
|
+
s.dependency 'PushwooshXCFramework'
|
|
19
|
+
s.dependency 'PushwooshInboxUIXCFramework'
|
|
20
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
require('react-native/setupBabel')();
|
|
2
|
+
|
|
3
|
+
const core = require('react-native/local-cli/core');
|
|
4
|
+
const PbxFile = require('xcode/lib/pbxFile');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const xcode = require('xcode');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const createGroupWithMessage = require('react-native/local-cli/link/ios/createGroupWithMessage');
|
|
9
|
+
|
|
10
|
+
function pwAddInboxiOSResources() {
|
|
11
|
+
core.configPromise.then(function(config) {
|
|
12
|
+
const iOSconfig = config.getProjectConfig().ios;
|
|
13
|
+
const pw_iOSconfig = config.getDependencyConfig('pushwoosh-react-native-plugin').ios;
|
|
14
|
+
|
|
15
|
+
const project = xcode.project(iOSconfig.pbxprojPath).parseSync();
|
|
16
|
+
|
|
17
|
+
var targets = project.pbxNativeTargetSection();
|
|
18
|
+
|
|
19
|
+
for (uuid in targets) {
|
|
20
|
+
var libFiles = project.pbxFrameworksBuildPhaseObj(uuid).files;
|
|
21
|
+
var filesCount = libFiles.length;
|
|
22
|
+
for (var f = 0; f < filesCount; ++f) {
|
|
23
|
+
var fileRef = project.pbxBuildFileSection()[libFiles[f].value].fileRef;
|
|
24
|
+
var file = project.pbxFileReferenceSection()[fileRef];
|
|
25
|
+
if (file != null) {
|
|
26
|
+
if (file.path == 'libPushwooshPlugin.a') {
|
|
27
|
+
createGroupWithMessage(project, 'Resources');
|
|
28
|
+
project.addResourceFile(path.relative(iOSconfig.sourceDir, path.join(pw_iOSconfig.sourceDir, 'PushwooshInboxBundle.bundle')), {'target' : uuid }, null);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
fs.writeFileSync(
|
|
34
|
+
iOSconfig.pbxprojPath,
|
|
35
|
+
project.writeSync()
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
pwAddInboxiOSResources();
|
package/src/android/build.gradle
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
repositories {
|
|
3
|
+
mavenCentral()
|
|
4
|
+
maven {
|
|
5
|
+
url "https://maven.google.com"
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
dependencies {
|
|
10
|
+
classpath 'com.android.tools.build:gradle:4.1.3'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
allprojects {
|
|
15
|
+
repositories {
|
|
16
|
+
mavenCentral()
|
|
17
|
+
maven {
|
|
18
|
+
url "https://maven.google.com"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
1
23
|
apply plugin: 'com.android.library'
|
|
2
24
|
|
|
3
25
|
android {
|
|
4
|
-
compileSdkVersion
|
|
5
|
-
buildToolsVersion "23.0.3"
|
|
6
|
-
|
|
26
|
+
compileSdkVersion 33
|
|
7
27
|
defaultConfig {
|
|
8
|
-
minSdkVersion
|
|
28
|
+
minSdkVersion 21
|
|
29
|
+
targetSdkVersion 33
|
|
9
30
|
}
|
|
10
31
|
buildTypes {
|
|
11
32
|
release {
|
|
@@ -15,11 +36,20 @@ android {
|
|
|
15
36
|
}
|
|
16
37
|
}
|
|
17
38
|
|
|
39
|
+
ext {
|
|
40
|
+
pushwoosh = "6.7.0"
|
|
41
|
+
}
|
|
42
|
+
|
|
18
43
|
dependencies {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
implementation 'com.facebook.react:react-native:+'
|
|
45
|
+
implementation "com.pushwoosh:pushwoosh:${pushwoosh}"
|
|
46
|
+
implementation "com.pushwoosh:pushwoosh-firebase:${pushwoosh}"
|
|
47
|
+
implementation "com.pushwoosh:pushwoosh-huawei:${pushwoosh}"
|
|
48
|
+
implementation "com.pushwoosh:pushwoosh-amazon:${pushwoosh}"
|
|
49
|
+
implementation "com.pushwoosh:pushwoosh-badge:${pushwoosh}"
|
|
50
|
+
implementation "com.pushwoosh:pushwoosh-inbox:${pushwoosh}"
|
|
51
|
+
implementation "com.pushwoosh:pushwoosh-inbox-ui:${pushwoosh}"
|
|
52
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20"
|
|
53
|
+
implementation "com.google.firebase:firebase-messaging:23.1.0"
|
|
25
54
|
}
|
|
55
|
+
|
|
Binary file
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
##
|
|
5
|
+
## Gradle start up script for UN*X
|
|
6
|
+
##
|
|
7
|
+
##############################################################################
|
|
8
|
+
|
|
9
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
10
|
+
DEFAULT_JVM_OPTS=""
|
|
11
|
+
|
|
12
|
+
APP_NAME="Gradle"
|
|
13
|
+
APP_BASE_NAME=`basename "$0"`
|
|
14
|
+
|
|
15
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
16
|
+
MAX_FD="maximum"
|
|
17
|
+
|
|
18
|
+
warn ( ) {
|
|
19
|
+
echo "$*"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
die ( ) {
|
|
23
|
+
echo
|
|
24
|
+
echo "$*"
|
|
25
|
+
echo
|
|
26
|
+
exit 1
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# OS specific support (must be 'true' or 'false').
|
|
30
|
+
cygwin=false
|
|
31
|
+
msys=false
|
|
32
|
+
darwin=false
|
|
33
|
+
case "`uname`" in
|
|
34
|
+
CYGWIN* )
|
|
35
|
+
cygwin=true
|
|
36
|
+
;;
|
|
37
|
+
Darwin* )
|
|
38
|
+
darwin=true
|
|
39
|
+
;;
|
|
40
|
+
MINGW* )
|
|
41
|
+
msys=true
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
44
|
+
|
|
45
|
+
# Attempt to set APP_HOME
|
|
46
|
+
# Resolve links: $0 may be a link
|
|
47
|
+
PRG="$0"
|
|
48
|
+
# Need this for relative symlinks.
|
|
49
|
+
while [ -h "$PRG" ] ; do
|
|
50
|
+
ls=`ls -ld "$PRG"`
|
|
51
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
52
|
+
if expr "$link" : '/.*' > /dev/null; then
|
|
53
|
+
PRG="$link"
|
|
54
|
+
else
|
|
55
|
+
PRG=`dirname "$PRG"`"/$link"
|
|
56
|
+
fi
|
|
57
|
+
done
|
|
58
|
+
SAVED="`pwd`"
|
|
59
|
+
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
60
|
+
APP_HOME="`pwd -P`"
|
|
61
|
+
cd "$SAVED" >/dev/null
|
|
62
|
+
|
|
63
|
+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
64
|
+
|
|
65
|
+
# Determine the Java command to use to start the JVM.
|
|
66
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
67
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
68
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
69
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
70
|
+
else
|
|
71
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
|
72
|
+
fi
|
|
73
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
74
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
75
|
+
|
|
76
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
77
|
+
location of your Java installation."
|
|
78
|
+
fi
|
|
79
|
+
else
|
|
80
|
+
JAVACMD="java"
|
|
81
|
+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
82
|
+
|
|
83
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
84
|
+
location of your Java installation."
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# Increase the maximum file descriptors if we can.
|
|
88
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
|
89
|
+
MAX_FD_LIMIT=`ulimit -H -n`
|
|
90
|
+
if [ $? -eq 0 ] ; then
|
|
91
|
+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
92
|
+
MAX_FD="$MAX_FD_LIMIT"
|
|
93
|
+
fi
|
|
94
|
+
ulimit -n $MAX_FD
|
|
95
|
+
if [ $? -ne 0 ] ; then
|
|
96
|
+
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
97
|
+
fi
|
|
98
|
+
else
|
|
99
|
+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
100
|
+
fi
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
# For Darwin, add options to specify how the application appears in the dock
|
|
104
|
+
if $darwin; then
|
|
105
|
+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# For Cygwin, switch paths to Windows format before running java
|
|
109
|
+
if $cygwin ; then
|
|
110
|
+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
111
|
+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
112
|
+
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
113
|
+
|
|
114
|
+
# We build the pattern for arguments to be converted via cygpath
|
|
115
|
+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
116
|
+
SEP=""
|
|
117
|
+
for dir in $ROOTDIRSRAW ; do
|
|
118
|
+
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
119
|
+
SEP="|"
|
|
120
|
+
done
|
|
121
|
+
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
122
|
+
# Add a user-defined pattern to the cygpath arguments
|
|
123
|
+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
124
|
+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
125
|
+
fi
|
|
126
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
127
|
+
i=0
|
|
128
|
+
for arg in "$@" ; do
|
|
129
|
+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
130
|
+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
131
|
+
|
|
132
|
+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
133
|
+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
134
|
+
else
|
|
135
|
+
eval `echo args$i`="\"$arg\""
|
|
136
|
+
fi
|
|
137
|
+
i=$((i+1))
|
|
138
|
+
done
|
|
139
|
+
case $i in
|
|
140
|
+
(0) set -- ;;
|
|
141
|
+
(1) set -- "$args0" ;;
|
|
142
|
+
(2) set -- "$args0" "$args1" ;;
|
|
143
|
+
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
144
|
+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
145
|
+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
146
|
+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
147
|
+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
148
|
+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
149
|
+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
150
|
+
esac
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
|
154
|
+
function splitJvmOpts() {
|
|
155
|
+
JVM_OPTS=("$@")
|
|
156
|
+
}
|
|
157
|
+
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
|
158
|
+
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
|
159
|
+
|
|
160
|
+
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|