pushwoosh-react-native-plugin 6.1.41 → 6.1.42
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 +20 -0
- package/index.d.ts +4 -0
- package/index.js +33 -0
- 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 +10 -0
- package/src/ios/PushwooshPlugin/Pushwoosh.m +8 -0
- 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
|
@@ -62,6 +62,8 @@ DeviceEventEmitter.addListener('pushOpened', (e: Event) => {
|
|
|
62
62
|
<tr class="even"><td><a href="#setcommunicationenabled">setCommunicationEnabled()</a></td></tr>
|
|
63
63
|
<tr class="even"><td><a href="#removealldevicedata">removeAllDeviceData()</a></td></tr>
|
|
64
64
|
<tr class="even"><td><a href="#enableHuaweiPushNotifications">enableHuaweiPushNotifications()</a></td></tr>
|
|
65
|
+
<tr class="even"><td><a href="#registersmsnumber">registerSMSNumber(phoneNumber)</a></td></tr>
|
|
66
|
+
<tr class="even"><td><a href="#registerwhatsappnumber">registerWhatsappNumber(phoneNumber)</a></td></tr>
|
|
65
67
|
<tr>
|
|
66
68
|
<th align="left" colspan="2"><strong>Events</strong></th>
|
|
67
69
|
</tr>
|
|
@@ -491,6 +493,24 @@ enableHuaweiPushNotifications()
|
|
|
491
493
|
**[android]**
|
|
492
494
|
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>.
|
|
493
495
|
|
|
496
|
+
### registerSMSNumber
|
|
497
|
+
|
|
498
|
+
```js
|
|
499
|
+
registerSMSNumber(phoneNumber)
|
|
500
|
+
```
|
|
501
|
+
**[android, ios]**
|
|
502
|
+
Registers phone number associated to the current user.
|
|
503
|
+
SMS numbers must be in E.164 format (e.g., "+1234567890") and be valid.
|
|
504
|
+
|
|
505
|
+
### registerWhatsappNumber
|
|
506
|
+
|
|
507
|
+
```js
|
|
508
|
+
registerWhatsappNumber(phoneNumber)
|
|
509
|
+
```
|
|
510
|
+
**[android, ios]**
|
|
511
|
+
Registers WhatsApp number associated to the current user.
|
|
512
|
+
WhatsApp numbers must be in E.164 format (e.g., "+1234567890") and be valid.
|
|
513
|
+
|
|
494
514
|
### pushReceived
|
|
495
515
|
|
|
496
516
|
```js
|
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;
|
|
@@ -88,6 +91,7 @@ declare module 'pushwoosh-react-native-plugin' {
|
|
|
88
91
|
isAvailableGDPR(success: (isAvailable: boolean) => void): void;
|
|
89
92
|
setCommunicationEnabled(enabled: boolean, success?: () => void, fail?: (error: Error) => void): void;
|
|
90
93
|
removeAllDeviceData(success?: () => void, fail?: (error: Error) => void): void;
|
|
94
|
+
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
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
|
//
|
|
@@ -620,6 +652,7 @@ class PushNotification {
|
|
|
620
652
|
enableHuaweiPushNotifications() {
|
|
621
653
|
PushwooshModule.enableHuaweiPushNotifications();
|
|
622
654
|
}
|
|
655
|
+
|
|
623
656
|
}
|
|
624
657
|
|
|
625
658
|
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.42"
|
|
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.4'
|
|
19
19
|
s.dependency 'PushwooshInboxUIXCFramework'
|
|
20
20
|
end
|
package/src/android/build.gradle
CHANGED
|
@@ -580,6 +580,16 @@ public class PushwooshPlugin extends ReactContextBaseJavaModule implements Lifec
|
|
|
580
580
|
Pushwoosh.getInstance().enableHuaweiPushNotifications();
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
+
@ReactMethod
|
|
584
|
+
public void registerSMSNumber(String phoneNumber) {
|
|
585
|
+
Pushwoosh.getInstance().registerSMSNumber(phoneNumber);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
@ReactMethod
|
|
589
|
+
public void registerWhatsappNumber(String phoneNumber) {
|
|
590
|
+
Pushwoosh.getInstance().registerWhatsappNumber(phoneNumber);
|
|
591
|
+
}
|
|
592
|
+
|
|
583
593
|
///
|
|
584
594
|
/// LifecycleEventListener callbacks
|
|
585
595
|
///
|
|
@@ -875,6 +875,14 @@ RCT_EXPORT_METHOD(clearNotificationCenter){
|
|
|
875
875
|
RCT_EXPORT_METHOD(enableHuaweiPushNotifications) {
|
|
876
876
|
// available in Android only
|
|
877
877
|
}
|
|
878
|
+
|
|
879
|
+
RCT_EXPORT_METHOD(registerSMSNumber:(NSString *)phoneNumber) {
|
|
880
|
+
[[Pushwoosh sharedInstance] registerSmsNumber:phoneNumber];
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
RCT_EXPORT_METHOD(registerWhatsappNumber:(NSString *)phoneNumber) {
|
|
884
|
+
[[Pushwoosh sharedInstance] registerWhatsappNumber:phoneNumber];
|
|
885
|
+
}
|
|
878
886
|
|
|
879
887
|
#pragma mark - PushNotificationDelegate
|
|
880
888
|
|
|
@@ -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
|