pushwoosh-react-native-plugin 6.1.41 → 6.1.43
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/docs/README.md +19 -26
- package/index.d.ts +5 -6
- package/index.js +33 -27
- package/package.json +1 -1
- package/pushwoosh-react-native-plugin.podspec +2 -2
- package/src/android/build.gradle +1 -1
- package/src/android/src/main/java/com/pushwoosh/reactnativeplugin/PushwooshPlugin.java +24 -54
- package/src/ios/PushwooshPlugin/Pushwoosh.h +0 -2
- package/src/ios/PushwooshPlugin/Pushwoosh.m +42 -38
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -152
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -31
- package/.github/ISSUE_TEMPLATE/question.yml +0 -28
package/docs/README.md
CHANGED
|
@@ -57,11 +57,10 @@ DeviceEventEmitter.addListener('pushOpened', (e: Event) => {
|
|
|
57
57
|
<tr class="even"><td><a href="#setsoundtype">setSoundType(type)</a></td></tr>
|
|
58
58
|
<tr class="even"><td><a href="#setvibratetype">setVibrateType(type)</a></td></tr>
|
|
59
59
|
<tr class="even"><td><a href="#presentinboxui">presentInboxUI()</a></td></tr>
|
|
60
|
-
<tr class="even"><td><a href="#showgdprconsentui">showGDPRConsentUI()</a></td></tr>
|
|
61
|
-
<tr class="even"><td><a href="#showgdprdeletionui">showGDPRDeletionUI()</a></td></tr>
|
|
62
60
|
<tr class="even"><td><a href="#setcommunicationenabled">setCommunicationEnabled()</a></td></tr>
|
|
63
|
-
<tr class="even"><td><a href="#removealldevicedata">removeAllDeviceData()</a></td></tr>
|
|
64
61
|
<tr class="even"><td><a href="#enableHuaweiPushNotifications">enableHuaweiPushNotifications()</a></td></tr>
|
|
62
|
+
<tr class="even"><td><a href="#registersmsnumber">registerSMSNumber(phoneNumber)</a></td></tr>
|
|
63
|
+
<tr class="even"><td><a href="#registerwhatsappnumber">registerWhatsappNumber(phoneNumber)</a></td></tr>
|
|
65
64
|
<tr>
|
|
66
65
|
<th align="left" colspan="2"><strong>Events</strong></th>
|
|
67
66
|
</tr>
|
|
@@ -448,48 +447,42 @@ Opens [Inbox](https://www.pushwoosh.com/docs/message-inbox) screen.
|
|
|
448
447
|
Before using Message Inbox, please add node_modules/pushwoosh-react-native-plugin/src/ios/PushwooshInboxBundle.bundle to your project. Or, launch a script 'node node_modules/pushwoosh-react-native-plugin/scripts/add_inbox_ios_resources.js' to do it.
|
|
449
448
|
|
|
450
449
|
|
|
451
|
-
### showGDPRConsentUI
|
|
452
450
|
|
|
453
|
-
|
|
454
|
-
showGDPRConsentUI()
|
|
455
|
-
```
|
|
456
|
-
**[android, ios]**
|
|
457
|
-
A part of [The GDPR Compliance](https://www.pushwoosh.com/docs/the-gdpr-compliance) solution that shows the GDPR Consent Form, ensuring lawful basis for processing personal data of EU citizens.
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
### showGDPRDeletionUI
|
|
451
|
+
### setCommunicationEnabled
|
|
461
452
|
|
|
462
453
|
```js
|
|
463
|
-
|
|
454
|
+
setCommunicationEnabled(on: boolean)
|
|
464
455
|
```
|
|
465
456
|
**[android, ios]**
|
|
466
|
-
A
|
|
457
|
+
A binary method enabling/disabling all communication with Pushwoosh. The boolean value is false unsubscribes the device from receiving push notifications and stops in-app messages download. The value true reverses the effect.
|
|
467
458
|
|
|
468
459
|
|
|
469
|
-
|
|
460
|
+
|
|
461
|
+
### enableHuaweiPushNotifications
|
|
470
462
|
|
|
471
463
|
```js
|
|
472
|
-
|
|
464
|
+
enableHuaweiPushNotifications()
|
|
473
465
|
```
|
|
474
|
-
**[android
|
|
475
|
-
|
|
476
|
-
|
|
466
|
+
**[android]**
|
|
467
|
+
Enables Huawei push messaging. Requires configured Huawei platform for your Pushwoosh application. See the <a href="https://docs.pushwoosh.com/platform-docs/pushwoosh-sdk/android-push-notifications/huawei-integration/huawei-in-react-native">integration guide</a>.
|
|
477
468
|
|
|
478
|
-
###
|
|
469
|
+
### registerSMSNumber
|
|
479
470
|
|
|
480
471
|
```js
|
|
481
|
-
|
|
472
|
+
registerSMSNumber(phoneNumber)
|
|
482
473
|
```
|
|
483
474
|
**[android, ios]**
|
|
484
|
-
|
|
475
|
+
Registers phone number associated to the current user.
|
|
476
|
+
SMS numbers must be in E.164 format (e.g., "+1234567890") and be valid.
|
|
485
477
|
|
|
486
|
-
###
|
|
478
|
+
### registerWhatsappNumber
|
|
487
479
|
|
|
488
480
|
```js
|
|
489
|
-
|
|
481
|
+
registerWhatsappNumber(phoneNumber)
|
|
490
482
|
```
|
|
491
|
-
**[android]**
|
|
492
|
-
|
|
483
|
+
**[android, ios]**
|
|
484
|
+
Registers WhatsApp number associated to the current user.
|
|
485
|
+
WhatsApp numbers must be in E.164 format (e.g., "+1234567890") and be valid.
|
|
493
486
|
|
|
494
487
|
### pushReceived
|
|
495
488
|
|
package/index.d.ts
CHANGED
|
@@ -53,6 +53,9 @@ declare module 'pushwoosh-react-native-plugin' {
|
|
|
53
53
|
//email methods
|
|
54
54
|
setUserEmails(userId: string, emails: (string | string[]), success?: () => void, fail?: (error: Error) => void): void;
|
|
55
55
|
setEmails(emails: (string | string[]), success?: () => void, fail?: (error: Error) => void): void;
|
|
56
|
+
//SMS and WhatsApp methods
|
|
57
|
+
registerSMSNumber(phoneNumber: string): void;
|
|
58
|
+
registerWhatsappNumber(phoneNumber: string): void;
|
|
56
59
|
//badge methods
|
|
57
60
|
setApplicationIconBadgeNumber(badgeNumber: number): void;
|
|
58
61
|
getApplicationIconBadgeNumber(callback: (badge: number) => void): void;
|
|
@@ -80,14 +83,10 @@ declare module 'pushwoosh-react-native-plugin' {
|
|
|
80
83
|
deleteMessages(ids: string[]): void;
|
|
81
84
|
performAction(id: string): void;
|
|
82
85
|
|
|
83
|
-
//
|
|
84
|
-
showGDPRConsentUI(): void;
|
|
85
|
-
showGDPRDeletionUI(): void;
|
|
86
|
-
isDeviceDataRemoved(success: (isRemoved: boolean) => void): void;
|
|
86
|
+
//Communication methods
|
|
87
87
|
isCommunicationEnabled(success: (isEnabled: boolean)=> void): void;
|
|
88
|
-
isAvailableGDPR(success: (isAvailable: boolean) => void): void;
|
|
89
88
|
setCommunicationEnabled(enabled: boolean, success?: () => void, fail?: (error: Error) => void): void;
|
|
90
|
-
|
|
89
|
+
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
const Pushwoosh: Pushwoosh;
|
package/index.js
CHANGED
|
@@ -176,6 +176,38 @@ class PushNotification {
|
|
|
176
176
|
PushwooshModule.setEmails(emails, success, fail);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
//Function: registerSMSNumber
|
|
180
|
+
//Registers phone number associated to the current user.
|
|
181
|
+
//SMS numbers must be in E.164 format (e.g., "+1234567890") and be valid.
|
|
182
|
+
//
|
|
183
|
+
//Example:
|
|
184
|
+
//(start code)
|
|
185
|
+
// Pushwoosh.registerSMSNumber("+1234567890");
|
|
186
|
+
//(end)
|
|
187
|
+
registerSMSNumber(phoneNumber: string) {
|
|
188
|
+
if (!phoneNumber || phoneNumber.trim() === '') {
|
|
189
|
+
console.warn('Pushwoosh: SMS number is null or empty');
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
PushwooshModule.registerSMSNumber(phoneNumber);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
//Function: registerWhatsappNumber
|
|
196
|
+
//Registers WhatsApp number associated to the current user.
|
|
197
|
+
//WhatsApp numbers must be in E.164 format (e.g., "+1234567890") and be valid.
|
|
198
|
+
//
|
|
199
|
+
//Example:
|
|
200
|
+
//(start code)
|
|
201
|
+
// Pushwoosh.registerWhatsappNumber("+1234567890");
|
|
202
|
+
//(end)
|
|
203
|
+
registerWhatsappNumber(phoneNumber: string) {
|
|
204
|
+
if (!phoneNumber || phoneNumber.trim() === '') {
|
|
205
|
+
console.warn('Pushwoosh: WhatsApp number is null or empty');
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
PushwooshModule.registerWhatsappNumber(phoneNumber);
|
|
209
|
+
}
|
|
210
|
+
|
|
179
211
|
//Function: setTags
|
|
180
212
|
//Call this to set tags for the device
|
|
181
213
|
//
|
|
@@ -558,29 +590,12 @@ class PushNotification {
|
|
|
558
590
|
PushwooshModule.performAction(id);
|
|
559
591
|
}
|
|
560
592
|
|
|
561
|
-
// Show inApp for change setting Enable/disable all communication with Pushwoosh
|
|
562
|
-
showGDPRConsentUI(){
|
|
563
|
-
PushwooshModule.showGDPRConsentUI();
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// Show inApp for all device data from Pushwoosh and stops all interactions and communication permanently.
|
|
567
|
-
showGDPRDeletionUI(){
|
|
568
|
-
PushwooshModule.showGDPRDeletionUI();
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
isDeviceDataRemoved(success: Function){
|
|
572
|
-
PushwooshModule.isDeviceDataRemoved(success);
|
|
573
|
-
}
|
|
574
593
|
|
|
575
594
|
// Return flag is enable communication with server
|
|
576
595
|
isCommunicationEnabled(success: Function){
|
|
577
596
|
PushwooshModule.isCommunicationEnabled(success);
|
|
578
597
|
}
|
|
579
598
|
|
|
580
|
-
// Return flag is enabled GDPR on server
|
|
581
|
-
isAvailableGDPR(success: Function){
|
|
582
|
-
PushwooshModule.isAvailableGDPR(success);
|
|
583
|
-
}
|
|
584
599
|
|
|
585
600
|
// Enable/disable all communication with Pushwoosh. Enabled by default.
|
|
586
601
|
setCommunicationEnabled(enable: boolean, success: ?Function, fail: ?Function) {
|
|
@@ -593,16 +608,6 @@ class PushNotification {
|
|
|
593
608
|
PushwooshModule.setCommunicationEnabled(enable, success, fail);
|
|
594
609
|
}
|
|
595
610
|
|
|
596
|
-
// Removes all device data from Pushwoosh and stops all interactions and communication permanently.
|
|
597
|
-
removeAllDeviceData( success: ?Function, fail: ?Function) {
|
|
598
|
-
if (!success) {
|
|
599
|
-
success = function() {};
|
|
600
|
-
}
|
|
601
|
-
if (!fail) {
|
|
602
|
-
fail = function(error) {};
|
|
603
|
-
}
|
|
604
|
-
PushwooshModule.removeAllDeviceData(success, fail);
|
|
605
|
-
}
|
|
606
611
|
|
|
607
612
|
// Set notification icon background color
|
|
608
613
|
setNotificationIconBackgroundColor(color: string) {
|
|
@@ -620,6 +625,7 @@ class PushNotification {
|
|
|
620
625
|
enableHuaweiPushNotifications() {
|
|
621
626
|
PushwooshModule.enableHuaweiPushNotifications();
|
|
622
627
|
}
|
|
628
|
+
|
|
623
629
|
}
|
|
624
630
|
|
|
625
631
|
module.exports = new PushNotification();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = "pushwoosh-react-native-plugin"
|
|
3
|
-
s.version = "6.1.
|
|
3
|
+
s.version = "6.1.43"
|
|
4
4
|
s.summary = "React Native Pushwoosh Push Notifications module"
|
|
5
5
|
s.requires_arc = true
|
|
6
6
|
s.author = 'Pushwoosh'
|
|
@@ -15,6 +15,6 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
|
|
17
17
|
s.dependency 'React'
|
|
18
|
-
s.dependency 'PushwooshXCFramework', '6.
|
|
18
|
+
s.dependency 'PushwooshXCFramework', '6.10.5'
|
|
19
19
|
s.dependency 'PushwooshInboxUIXCFramework'
|
|
20
20
|
end
|
package/src/android/build.gradle
CHANGED
|
@@ -18,7 +18,6 @@ import com.facebook.react.bridge.ReactMethod;
|
|
|
18
18
|
import com.facebook.react.bridge.ReadableArray;
|
|
19
19
|
import com.facebook.react.bridge.ReadableMap;
|
|
20
20
|
import com.facebook.react.bridge.WritableNativeArray;
|
|
21
|
-
import com.pushwoosh.GDPRManager;
|
|
22
21
|
import com.pushwoosh.Pushwoosh;
|
|
23
22
|
import com.pushwoosh.RegisterForPushNotificationsResultData;
|
|
24
23
|
import com.pushwoosh.badge.PushwooshBadge;
|
|
@@ -30,7 +29,7 @@ import com.pushwoosh.exception.SetUserIdException;
|
|
|
30
29
|
import com.pushwoosh.exception.RegisterForPushNotificationsException;
|
|
31
30
|
import com.pushwoosh.exception.UnregisterForPushNotificationException;
|
|
32
31
|
import com.pushwoosh.function.Result;
|
|
33
|
-
import com.pushwoosh.inapp.
|
|
32
|
+
import com.pushwoosh.inapp.InAppManager;
|
|
34
33
|
import com.pushwoosh.inbox.PushwooshInbox;
|
|
35
34
|
import com.pushwoosh.inbox.data.InboxMessage;
|
|
36
35
|
import com.pushwoosh.inbox.exception.InboxMessagesException;
|
|
@@ -306,7 +305,7 @@ public class PushwooshPlugin extends ReactContextBaseJavaModule implements Lifec
|
|
|
306
305
|
|
|
307
306
|
@ReactMethod
|
|
308
307
|
public void postEvent(String event, ReadableMap attributes) {
|
|
309
|
-
|
|
308
|
+
InAppManager.getInstance().postEvent(event, ConversionUtil.convertToTagsBundle(attributes));
|
|
310
309
|
}
|
|
311
310
|
|
|
312
311
|
@ReactMethod
|
|
@@ -498,67 +497,28 @@ public class PushwooshPlugin extends ReactContextBaseJavaModule implements Lifec
|
|
|
498
497
|
PushwooshInbox.performAction(id);
|
|
499
498
|
}
|
|
500
499
|
|
|
501
|
-
@ReactMethod
|
|
502
|
-
public void showGDPRConsentUI(){
|
|
503
|
-
GDPRManager.getInstance().showGDPRConsentUI();
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
@ReactMethod
|
|
507
|
-
public void showGDPRDeletionUI(){
|
|
508
|
-
GDPRManager.getInstance().showGDPRDeletionUI();
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
@ReactMethod
|
|
512
|
-
public void isDeviceDataRemoved(final Callback success){
|
|
513
|
-
success.invoke(GDPRManager.getInstance().isDeviceDataRemoved());
|
|
514
|
-
}
|
|
515
|
-
|
|
516
500
|
@ReactMethod
|
|
517
501
|
public void isCommunicationEnabled(final Callback success){
|
|
518
|
-
success.invoke(
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
@ReactMethod
|
|
522
|
-
public void isAvailableGDPR(final Callback success){
|
|
523
|
-
success.invoke(GDPRManager.getInstance().isAvailable());
|
|
502
|
+
success.invoke(Pushwoosh.getInstance().isServerCommunicationAllowed());
|
|
524
503
|
}
|
|
525
504
|
|
|
526
505
|
@ReactMethod
|
|
527
506
|
public void setCommunicationEnabled(boolean enable, final Callback success, final Callback error) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
success.invoke(result.getData());
|
|
534
|
-
}
|
|
535
|
-
} else if (result.getException() != null) {
|
|
536
|
-
if (error != null) {
|
|
537
|
-
error.invoke(result.getException().getLocalizedMessage());
|
|
538
|
-
}
|
|
539
|
-
}
|
|
507
|
+
try {
|
|
508
|
+
if (enable) {
|
|
509
|
+
Pushwoosh.getInstance().startServerCommunication();
|
|
510
|
+
} else {
|
|
511
|
+
Pushwoosh.getInstance().stopServerCommunication();
|
|
540
512
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
public void removeAllDeviceData(final Callback success, final Callback error) {
|
|
546
|
-
GDPRManager.getInstance().removeAllDeviceData(new com.pushwoosh.function.Callback<Void, PushwooshException>() {
|
|
547
|
-
@Override
|
|
548
|
-
public void process(Result<Void, PushwooshException> result) {
|
|
549
|
-
if (result.isSuccess()) {
|
|
550
|
-
if (success != null) {
|
|
551
|
-
success.invoke(result.getData());
|
|
552
|
-
}
|
|
553
|
-
} else if (result.getException() != null) {
|
|
554
|
-
if (error != null) {
|
|
555
|
-
error.invoke(result.getException().getLocalizedMessage());
|
|
556
|
-
}
|
|
557
|
-
}
|
|
513
|
+
success.invoke();
|
|
514
|
+
} catch (Exception e) {
|
|
515
|
+
if (error != null) {
|
|
516
|
+
error.invoke(e.getMessage());
|
|
558
517
|
}
|
|
559
|
-
}
|
|
518
|
+
}
|
|
560
519
|
}
|
|
561
520
|
|
|
521
|
+
|
|
562
522
|
@ReactMethod
|
|
563
523
|
public void setLanguage(String language){
|
|
564
524
|
Pushwoosh.getInstance().setLanguage(language);
|
|
@@ -580,6 +540,16 @@ public class PushwooshPlugin extends ReactContextBaseJavaModule implements Lifec
|
|
|
580
540
|
Pushwoosh.getInstance().enableHuaweiPushNotifications();
|
|
581
541
|
}
|
|
582
542
|
|
|
543
|
+
@ReactMethod
|
|
544
|
+
public void registerSMSNumber(String phoneNumber) {
|
|
545
|
+
Pushwoosh.getInstance().registerSMSNumber(phoneNumber);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
@ReactMethod
|
|
549
|
+
public void registerWhatsappNumber(String phoneNumber) {
|
|
550
|
+
Pushwoosh.getInstance().registerWhatsappNumber(phoneNumber);
|
|
551
|
+
}
|
|
552
|
+
|
|
583
553
|
///
|
|
584
554
|
/// LifecycleEventListener callbacks
|
|
585
555
|
///
|
|
@@ -14,14 +14,12 @@
|
|
|
14
14
|
#import <PushwooshFramework/PushNotificationManager.h>
|
|
15
15
|
#import <PushwooshFramework/PWInAppManager.h>
|
|
16
16
|
#import <PushwooshInboxUI/PushwooshInboxUI.h>
|
|
17
|
-
#import <PushwooshFramework/PWGDPRManager.h>
|
|
18
17
|
#import <PushwooshFramework/PWInlineInAppView.h>
|
|
19
18
|
#import <PushwooshFramework/PWInbox.h>
|
|
20
19
|
#else
|
|
21
20
|
#import "PushNotificationManager.h"
|
|
22
21
|
#import "PWInAppManager.h"
|
|
23
22
|
#import "PushwooshInboxUI.h"
|
|
24
|
-
#import "PWGDPRManager.h"
|
|
25
23
|
#import "PWInlineInAppView.h"
|
|
26
24
|
#import "PWInbox.h"
|
|
27
25
|
#endif
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
|
|
20
20
|
#define kPushwooshPluginImplementationInfoPlistKey @"Pushwoosh_PLUGIN_NOTIFICATION_HANDLER"
|
|
21
21
|
|
|
22
|
+
#define PW_COMMUNICATION_ENABLED_KEY @"PushwooshCommunicationEnabled"
|
|
23
|
+
#define PW_COMMUNICATION_ENABLED_PLIST_KEY @"Pushwoosh_ALLOW_SERVER_COMMUNICATION"
|
|
24
|
+
|
|
25
|
+
|
|
22
26
|
static id objectOrNull(id object) {
|
|
23
27
|
if (object) {
|
|
24
28
|
return object;
|
|
@@ -773,54 +777,46 @@ API_AVAILABLE(ios(10.0)) {
|
|
|
773
777
|
return controller;
|
|
774
778
|
}
|
|
775
779
|
|
|
776
|
-
RCT_EXPORT_METHOD(showGDPRConsentUI) {
|
|
777
|
-
[[PWGDPRManager sharedManager] showGDPRConsentUI];
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
RCT_EXPORT_METHOD(showGDPRDeletionUI) {
|
|
781
|
-
[[PWGDPRManager sharedManager] showGDPRDeletionUI];
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
RCT_EXPORT_METHOD(isDeviceDataRemoved:(RCTResponseSenderBlock)callback) {
|
|
785
|
-
callback(@[@([PWGDPRManager sharedManager].isDeviceDataRemoved)]);
|
|
786
|
-
}
|
|
787
|
-
|
|
788
780
|
RCT_EXPORT_METHOD(isCommunicationEnabled:(RCTResponseSenderBlock)callback) {
|
|
789
|
-
|
|
790
|
-
}
|
|
781
|
+
BOOL isCommunicationEnabled = [self getCommunicationEnabledState];
|
|
791
782
|
|
|
792
|
-
|
|
793
|
-
callback(@[@([PWGDPRManager sharedManager].isAvailable)]);
|
|
783
|
+
callback(@[@(isCommunicationEnabled)]);
|
|
794
784
|
}
|
|
795
785
|
|
|
796
786
|
RCT_EXPORT_METHOD(setCommunicationEnabled:(BOOL)enabled success:(RCTResponseSenderBlock)successCallback error:(RCTResponseSenderBlock)errorCallback) {
|
|
797
|
-
[[
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
}];
|
|
787
|
+
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:PW_COMMUNICATION_ENABLED_KEY];
|
|
788
|
+
|
|
789
|
+
if (enabled) {
|
|
790
|
+
[[Pushwoosh sharedInstance] startServerCommunication];
|
|
791
|
+
} else {
|
|
792
|
+
[[Pushwoosh sharedInstance] stopServerCommunication];
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
successCallback(@[]);
|
|
808
797
|
}
|
|
809
798
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
799
|
+
- (BOOL)getCommunicationEnabledState {
|
|
800
|
+
NSBundle *bundle = [NSBundle mainBundle];
|
|
801
|
+
NSObject *plistValue = [bundle objectForInfoDictionaryKey:PW_COMMUNICATION_ENABLED_PLIST_KEY];
|
|
802
|
+
|
|
803
|
+
if (plistValue != nil) {
|
|
804
|
+
if ([plistValue isKindOfClass:[NSNumber class]]) {
|
|
805
|
+
return [(NSNumber *)plistValue boolValue];
|
|
806
|
+
} else if ([plistValue isKindOfClass:[NSString class]]) {
|
|
807
|
+
NSString *stringValue = [(NSString *)plistValue lowercaseString];
|
|
808
|
+
return [stringValue isEqualToString:@"true"] || [stringValue isEqualToString:@"yes"] || [stringValue isEqualToString:@"1"];
|
|
820
809
|
}
|
|
821
|
-
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
if ([[NSUserDefaults standardUserDefaults] objectForKey:PW_COMMUNICATION_ENABLED_KEY] != nil) {
|
|
813
|
+
return [[NSUserDefaults standardUserDefaults] boolForKey:PW_COMMUNICATION_ENABLED_KEY];
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
return YES;
|
|
822
817
|
}
|
|
823
818
|
|
|
819
|
+
|
|
824
820
|
RCT_EXPORT_METHOD(createLocalNotification:(NSDictionary *)params){
|
|
825
821
|
NSString *body = params[@"msg"];
|
|
826
822
|
NSUInteger delay = [params[@"seconds"] unsignedIntegerValue];
|
|
@@ -875,6 +871,14 @@ RCT_EXPORT_METHOD(clearNotificationCenter){
|
|
|
875
871
|
RCT_EXPORT_METHOD(enableHuaweiPushNotifications) {
|
|
876
872
|
// available in Android only
|
|
877
873
|
}
|
|
874
|
+
|
|
875
|
+
RCT_EXPORT_METHOD(registerSMSNumber:(NSString *)phoneNumber) {
|
|
876
|
+
[[Pushwoosh sharedInstance] registerSmsNumber:phoneNumber];
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
RCT_EXPORT_METHOD(registerWhatsappNumber:(NSString *)phoneNumber) {
|
|
880
|
+
[[Pushwoosh sharedInstance] registerWhatsappNumber:phoneNumber];
|
|
881
|
+
}
|
|
878
882
|
|
|
879
883
|
#pragma mark - PushNotificationDelegate
|
|
880
884
|
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
name: "🐞 Bug Report"
|
|
2
|
-
description: "Report us a bug"
|
|
3
|
-
title: "[Bug]: "
|
|
4
|
-
labels: ["bug"]
|
|
5
|
-
body:
|
|
6
|
-
- type: markdown
|
|
7
|
-
attributes:
|
|
8
|
-
value: |
|
|
9
|
-
Thank you for taking the time to create this issue.
|
|
10
|
-
|
|
11
|
-
The more detailed information filled below will help us to investigate the root cause of the issue faster and fix it.
|
|
12
|
-
This form is for React Native Plugin only. If this is a bug for another platform or framework — please create the issue in the corresponded [repository](https://github.com/orgs/Pushwoosh/repositories). We appreciate your cooperation!
|
|
13
|
-
- type: checkboxes
|
|
14
|
-
id: rtfm
|
|
15
|
-
attributes:
|
|
16
|
-
label: Documentation
|
|
17
|
-
description: "Have you checked the relevant integration guide: [Integrating React Native Plugin](https://docs.pushwoosh.com/platform-docs/pushwoosh-sdk/cross-platform-frameworks/react-native/integrating-react-native-plugin) which describes implementation process of the Pushwoosh SDK to your app and follow all the necessary steps?"
|
|
18
|
-
options:
|
|
19
|
-
- label: I've checked the guide, but it doesn't help me to resolve the issue.
|
|
20
|
-
required: true
|
|
21
|
-
- type: textarea
|
|
22
|
-
id: description
|
|
23
|
-
attributes:
|
|
24
|
-
label: Description
|
|
25
|
-
description: Short description of the issue. You can add screenshots and screencast to illustrate it.
|
|
26
|
-
placeholder: "Example: When receiving a push with Rich Media in a closed app, Rich Media is not shown."
|
|
27
|
-
validations:
|
|
28
|
-
required: true
|
|
29
|
-
- type: dropdown
|
|
30
|
-
id: severity
|
|
31
|
-
attributes:
|
|
32
|
-
label: Bug severity
|
|
33
|
-
description: |
|
|
34
|
-
How do you rate the severity of this bug?
|
|
35
|
-
For an objective assessment, please take into account how often this bug occurs in everyday app interaction, how serious the consequences of its occurrence (crash, warning, etc.), number of affected users, enviroment where it occurs (stage, production. etc.).
|
|
36
|
-
options:
|
|
37
|
-
- Low
|
|
38
|
-
- Normal
|
|
39
|
-
- High
|
|
40
|
-
- Urgent
|
|
41
|
-
validations:
|
|
42
|
-
required: true
|
|
43
|
-
- type: textarea
|
|
44
|
-
id: repro-steps
|
|
45
|
-
attributes:
|
|
46
|
-
label: Steps to Reproduce
|
|
47
|
-
description: Describe all the steps needed to reproduce the issue. If an issue is only reproducible under particular circumstances, put all required details here. E.g., if a push is not shown only for a specific API request, provide the full request body. Or, if an issue is reproducible with a particular Rich Media, deep link, etc. — specify it.
|
|
48
|
-
placeholder: |
|
|
49
|
-
1. Open the app;
|
|
50
|
-
2. Switch it to the background;
|
|
51
|
-
3. Received notification with "root_params" causes the app to crash.
|
|
52
|
-
This happens only if dependency XYZ v.1.2.3 is installed
|
|
53
|
-
validations:
|
|
54
|
-
required: true
|
|
55
|
-
- type: dropdown
|
|
56
|
-
id: affected-version
|
|
57
|
-
attributes:
|
|
58
|
-
label: Your Pushwoosh React Native Plugin version
|
|
59
|
-
description: Your React Native Plugin version which was integrated to the app. You may find it on the [releases page](https://github.com/Pushwoosh/pushwoosh-react-native-plugin/releases)
|
|
60
|
-
options:
|
|
61
|
-
- 6.1.41
|
|
62
|
-
- 6.1.40
|
|
63
|
-
- 6.1.40
|
|
64
|
-
- 6.1.41
|
|
65
|
-
- 6.1.39
|
|
66
|
-
- 6.1.38
|
|
67
|
-
- 6.1.37
|
|
68
|
-
- 6.1.36
|
|
69
|
-
- 6.1.35
|
|
70
|
-
- 6.1.34
|
|
71
|
-
- 6.1.32
|
|
72
|
-
- 6.1.31
|
|
73
|
-
- 6.1.30
|
|
74
|
-
- 6.1.29
|
|
75
|
-
- 6.1.28
|
|
76
|
-
- 6.1.27
|
|
77
|
-
- 6.1.26
|
|
78
|
-
- 6.1.25
|
|
79
|
-
- 6.1.23
|
|
80
|
-
- 6.1.22
|
|
81
|
-
- 6.1.21
|
|
82
|
-
- 6.1.20
|
|
83
|
-
- 6.1.19
|
|
84
|
-
- 6.1.18
|
|
85
|
-
- 6.1.17
|
|
86
|
-
- 6.1.16
|
|
87
|
-
- 6.1.15
|
|
88
|
-
- 6.1.14
|
|
89
|
-
- 6.1.13
|
|
90
|
-
- 6.1.12
|
|
91
|
-
- 6.1.11
|
|
92
|
-
- 6.1.10
|
|
93
|
-
- 6.1.9
|
|
94
|
-
- 6.1.8
|
|
95
|
-
- 6.1.7
|
|
96
|
-
- 6.1.6
|
|
97
|
-
- 6.1.5
|
|
98
|
-
- 6.1.4
|
|
99
|
-
- 6.1.3
|
|
100
|
-
- 6.1.2
|
|
101
|
-
- 6.1.1
|
|
102
|
-
- 6.0.10
|
|
103
|
-
- 6.0.9
|
|
104
|
-
- 6.0.8
|
|
105
|
-
- 6.0.7
|
|
106
|
-
- 6.0.6
|
|
107
|
-
- 6.0.5
|
|
108
|
-
- 6.0.4
|
|
109
|
-
- 6.0.3
|
|
110
|
-
- 6.0.2
|
|
111
|
-
- 6.0.1
|
|
112
|
-
- 6.0.0
|
|
113
|
-
- Other — specify it in the description
|
|
114
|
-
validations:
|
|
115
|
-
required: true
|
|
116
|
-
- type: input
|
|
117
|
-
id: last-worked
|
|
118
|
-
attributes:
|
|
119
|
-
label: Last worked Pushwoosh React Native Plugin version (if any)
|
|
120
|
-
description: Is there a version that worked well? If so, please specify.
|
|
121
|
-
- type: checkboxes
|
|
122
|
-
id: platforms-affected
|
|
123
|
-
attributes:
|
|
124
|
-
label: Affected platforms
|
|
125
|
-
description: Select the platforms on which the issue occurs. This helps us determine whether the root cause is core plugin or platform specific.
|
|
126
|
-
options:
|
|
127
|
-
- label: Android
|
|
128
|
-
- label: iOS
|
|
129
|
-
validations:
|
|
130
|
-
required: true
|
|
131
|
-
- type: textarea
|
|
132
|
-
id: platform-versions
|
|
133
|
-
attributes:
|
|
134
|
-
label: Affected OS versions and/or devices
|
|
135
|
-
description: Please specify device models and custom distributions (if any) on which this issue occurs. If the issue occurs when building, then specify the target platform.
|
|
136
|
-
placeholder: |
|
|
137
|
-
E.g. Android 13 on a Google Pixel 3a XL,
|
|
138
|
-
iOS 17.0.3 on an iPhone 14
|
|
139
|
-
MIUI 14.0.8.0 on Xiaomi 13 Ultra, etc.
|
|
140
|
-
validations:
|
|
141
|
-
required: true
|
|
142
|
-
- type: textarea
|
|
143
|
-
id: workaround
|
|
144
|
-
attributes:
|
|
145
|
-
label: Workaround
|
|
146
|
-
description: Have you found a workaround for this issue? Please tell us — this may help other people to continue their work while waiting for this issue to be resolved.
|
|
147
|
-
- type: textarea
|
|
148
|
-
id: logs
|
|
149
|
-
attributes:
|
|
150
|
-
label: Relevant log output
|
|
151
|
-
description: After reproducing the issue, copy device console logs and paste them here "as is". This code block will be formatted automatically, so no additional formatting is needed. If the issue occurs when building, then provide us building logs here.
|
|
152
|
-
render: shell
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: "💡 Feature request"
|
|
2
|
-
description: "Suggest us a good idea or improvement"
|
|
3
|
-
title: "[Feature]: "
|
|
4
|
-
labels: ["feature"]
|
|
5
|
-
body:
|
|
6
|
-
- type: markdown
|
|
7
|
-
attributes:
|
|
8
|
-
value: |
|
|
9
|
-
Thank you for taking the time to create this request.
|
|
10
|
-
|
|
11
|
-
This form is for React Native Plugin only. If this is a feature for another platform or framework — please create it in the corresponded [repository](https://github.com/orgs/Pushwoosh/repositories). We appreciate your cooperation!
|
|
12
|
-
|
|
13
|
-
- type: textarea
|
|
14
|
-
id: description
|
|
15
|
-
attributes:
|
|
16
|
-
label: Description
|
|
17
|
-
description: Please tell us what's on your mind. You can add screenshots and screencast to illustrate your request.
|
|
18
|
-
validations:
|
|
19
|
-
required: true
|
|
20
|
-
|
|
21
|
-
- type: textarea
|
|
22
|
-
id: suggestions
|
|
23
|
-
attributes:
|
|
24
|
-
label: Sugeestions
|
|
25
|
-
description: |
|
|
26
|
-
If you know how you can achieve what you want or you have any information that may help us to achieve this, you can add it here.
|
|
27
|
-
For example, links to repositories, discussion threads, documentation, code samples, etc.
|
|
28
|
-
|
|
29
|
-
- type: markdown
|
|
30
|
-
attributes:
|
|
31
|
-
value: Thank you for your feedback!
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
name: "❓ Question"
|
|
2
|
-
description: "Ask us a question"
|
|
3
|
-
title: "[Question]: "
|
|
4
|
-
labels: ["question"]
|
|
5
|
-
body:
|
|
6
|
-
- type: markdown
|
|
7
|
-
attributes:
|
|
8
|
-
value: |
|
|
9
|
-
Thank you for your question!
|
|
10
|
-
|
|
11
|
-
This form is for React Native Plugin only. If this is a question for another platform or framework — please create it in the corresponded [repository](https://github.com/orgs/Pushwoosh/repositories). We appreciate your cooperation!
|
|
12
|
-
|
|
13
|
-
- type: checkboxes
|
|
14
|
-
id: rtfm
|
|
15
|
-
attributes:
|
|
16
|
-
label: Documentation
|
|
17
|
-
description: "Have you checked the relevant integration guide: [Integrating React Native Plugin](https://docs.pushwoosh.com/platform-docs/pushwoosh-sdk/cross-platform-frameworks/react-native/integrating-react-native-plugin) which describes implementation process of the Pushwoosh SDK to your app and follow all the necessary steps?"
|
|
18
|
-
options:
|
|
19
|
-
- label: I've checked the guide, but I didn't find the information I needed there.
|
|
20
|
-
required: true
|
|
21
|
-
|
|
22
|
-
- type: textarea
|
|
23
|
-
id: question
|
|
24
|
-
attributes:
|
|
25
|
-
label: Question
|
|
26
|
-
description: How can we help you? Do you have any questions about the integration of the SDK or how it works? You can add screenshots and screencast to illustrate your request.
|
|
27
|
-
validations:
|
|
28
|
-
required: true
|