cordova-plugin-reteno 2.0.4 → 2.1.0
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/android.md +2 -4
- package/docs/api.md +175 -191
- package/docs/ios.md +6 -6
- package/package.json +1 -1
- package/plugin.xml +2 -2
- package/src/android/reteno.gradle +1 -1
- package/src/ios/RetenoPlugin.swift +13 -3
- package/types/index.ts +14 -2
- package/www/cordova-plugin-reteno.js +393 -384
package/docs/android.md
CHANGED
|
@@ -35,8 +35,7 @@ Notes:
|
|
|
35
35
|
You can request it via the plugin API:
|
|
36
36
|
|
|
37
37
|
```js
|
|
38
|
-
RetenoPlugin
|
|
39
|
-
.requestNotificationPermission()
|
|
38
|
+
RetenoPlugin.requestNotificationPermission()
|
|
40
39
|
.then((grantedInt) => {
|
|
41
40
|
// grantedInt: 1 (granted) or 0 (declined)
|
|
42
41
|
})
|
|
@@ -50,8 +49,7 @@ RetenoPlugin
|
|
|
50
49
|
Initialize Reteno once during app startup:
|
|
51
50
|
|
|
52
51
|
```js
|
|
53
|
-
RetenoPlugin
|
|
54
|
-
.init()
|
|
52
|
+
RetenoPlugin.init()
|
|
55
53
|
.then(() => {
|
|
56
54
|
// initialized
|
|
57
55
|
})
|
package/docs/api.md
CHANGED
|
@@ -10,77 +10,77 @@ Notes:
|
|
|
10
10
|
|
|
11
11
|
### Initialization
|
|
12
12
|
|
|
13
|
-
| Method
|
|
14
|
-
|
|
|
15
|
-
| [init](../www/cordova-plugin-reteno.js)
|
|
16
|
-
| [requestNotificationPermission](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
17
|
-
| [setLifecycleTrackingOptions](../www/cordova-plugin-reteno.js)
|
|
13
|
+
| Method | Supported platform | Description |
|
|
14
|
+
| ---------------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| [init](../www/cordova-plugin-reteno.js) | iOS, Android | Initializes Reteno SDK. Accepts optional `RetenoInitializeOptions` with `accessKey`, `pauseInAppMessages`, `pausePushInAppMessages`, `inAppMessagesPauseBehaviour` (iOS), `lifecycleTrackingOptions`, `sessionDurationSeconds` (Android 2.9.4+, iOS 2.7.0+), `isAutomaticScreenReportingEnabled` (iOS; see note below) and `isDebugMode`. [Types](../types/index.ts) |
|
|
16
|
+
| [requestNotificationPermission](../www/cordova-plugin-reteno.js) | iOS, Android | Requests push permission (iOS) or `POST_NOTIFICATIONS` (Android 13+). Returns `0` or `1` on Android (`RequestNotificationPermissionResult`) in [types](../types/index.ts). |
|
|
17
|
+
| [setLifecycleTrackingOptions](../www/cordova-plugin-reteno.js) | iOS, Android | Configures automatic tracking for app lifecycle, push subscription, and session events. Android: applies immediately. iOS: supported only before initialization (stored and applied during `init(...)`). [Types](../types/index.ts) |
|
|
18
18
|
|
|
19
19
|
### User data
|
|
20
20
|
|
|
21
|
-
| Method
|
|
22
|
-
|
|
|
23
|
-
| [setUserAttributes](../www/cordova-plugin-reteno.js)
|
|
24
|
-
| [setAnonymousUserAttributes](../www/cordova-plugin-reteno.js)
|
|
25
|
-
| [setMultiAccountUserAttributes](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
21
|
+
| Method | Supported platform | Description |
|
|
22
|
+
| ---------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------ |
|
|
23
|
+
| [setUserAttributes](../www/cordova-plugin-reteno.js) | iOS, Android | Supports `marketId` (Android 2.9.5+, iOS 2.7.1+). Pass `""` to clear. [Types](../types/index.ts) |
|
|
24
|
+
| [setAnonymousUserAttributes](../www/cordova-plugin-reteno.js) | iOS, Android | Supports `marketId` (Android 2.9.5+, iOS 2.7.1+). Pass `""` to clear. [Types](../types/index.ts) |
|
|
25
|
+
| [setMultiAccountUserAttributes](../www/cordova-plugin-reteno.js) | iOS, Android | Supports `marketId` (Android 2.9.5+, iOS 2.7.1+). Pass `""` to clear. [Types](../types/index.ts) |
|
|
26
26
|
|
|
27
27
|
### Event tracking
|
|
28
28
|
|
|
29
|
-
| Method
|
|
30
|
-
|
|
|
31
|
-
| [logEvent](../www/cordova-plugin-reteno.js)
|
|
32
|
-
| [logEcommerceEvent](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
33
|
-
| [logScreenView](../www/cordova-plugin-reteno.js)
|
|
34
|
-
| [forcePushData](../www/cordova-plugin-reteno.js)
|
|
29
|
+
| Method | Supported platform | Description |
|
|
30
|
+
| ---------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| [logEvent](../www/cordova-plugin-reteno.js) | iOS, Android | [Types](../types/index.ts) |
|
|
32
|
+
| [logEcommerceEvent](../www/cordova-plugin-reteno.js) | iOS, Android | Tracks ecommerce activity (product views, cart updates, orders, search requests, etc.). [Types](../types/index.ts) |
|
|
33
|
+
| [logScreenView](../www/cordova-plugin-reteno.js) | iOS, Android | Logs a screen view for manual tracking. |
|
|
34
|
+
| [forcePushData](../www/cordova-plugin-reteno.js) | iOS, Android | Forces Reteno to sync queued data. On iOS the plugin performs a technical `logEvent(..., forcePush: true)` call under the hood. |
|
|
35
35
|
|
|
36
36
|
### Push notifications
|
|
37
37
|
|
|
38
|
-
| Method
|
|
39
|
-
|
|
|
40
|
-
| [setDeviceToken](../www/cordova-plugin-reteno.js)
|
|
41
|
-
| [getInitialNotification](../www/cordova-plugin-reteno.js)
|
|
42
|
-
| [setOnRetenoPushReceivedListener](../www/cordova-plugin-reteno.js)
|
|
43
|
-
| [removeOnRetenoPushReceivedListener](../www/cordova-plugin-reteno.js)
|
|
44
|
-
| [setOnRetenoNotificationClickedListener](../www/cordova-plugin-reteno.js)
|
|
45
|
-
| [removeOnRetenoNotificationClickedListener](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
46
|
-
| [setOnRetenoPushDismissedListener](../www/cordova-plugin-reteno.js)
|
|
47
|
-
| [removeOnRetenoPushDismissedListener](../www/cordova-plugin-reteno.js)
|
|
48
|
-
| [setOnRetenoCustomPushReceivedListener](../www/cordova-plugin-reteno.js)
|
|
49
|
-
| [removeOnRetenoCustomPushReceivedListener](../www/cordova-plugin-reteno.js)
|
|
50
|
-
| [setOnRetenoPushButtonClickedListener](../www/cordova-plugin-reteno.js)
|
|
51
|
-
| [removeOnRetenoPushButtonClickedListener](../www/cordova-plugin-reteno.js)
|
|
52
|
-
| [setNotificationActionHandler](../www/cordova-plugin-reteno.js)
|
|
53
|
-
| [setWillPresentNotificationOptions](../www/cordova-plugin-reteno.js)
|
|
54
|
-
| [setDidReceiveNotificationResponseHandler](../www/cordova-plugin-reteno.js)
|
|
55
|
-
| [updateDefaultNotificationChannel](../www/cordova-plugin-reteno.js)
|
|
38
|
+
| Method | Supported platform | Description |
|
|
39
|
+
| ---------------------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
40
|
+
| [setDeviceToken](../www/cordova-plugin-reteno.js) | iOS, Android | Forwards the device token to Reteno (use when another plugin owns push callbacks/token, e.g. Firebasex messaging enabled). |
|
|
41
|
+
| [getInitialNotification](../www/cordova-plugin-reteno.js) | iOS, Android | Returns push notification that triggered creating app instance. |
|
|
42
|
+
| [setOnRetenoPushReceivedListener](../www/cordova-plugin-reteno.js) | iOS, Android | Sets listener for newly received push notification. |
|
|
43
|
+
| [removeOnRetenoPushReceivedListener](../www/cordova-plugin-reteno.js) | iOS, Android | Removes listener for push notification received events. |
|
|
44
|
+
| [setOnRetenoNotificationClickedListener](../www/cordova-plugin-reteno.js) | iOS, Android | Sets listener for notification click events. |
|
|
45
|
+
| [removeOnRetenoNotificationClickedListener](../www/cordova-plugin-reteno.js) | iOS, Android | Removes listener for notification click events. |
|
|
46
|
+
| [setOnRetenoPushDismissedListener](../www/cordova-plugin-reteno.js) | Android | Sets listener for push dismissed (swipe) events. |
|
|
47
|
+
| [removeOnRetenoPushDismissedListener](../www/cordova-plugin-reteno.js) | Android | Removes listener for push dismissed (swipe) events. |
|
|
48
|
+
| [setOnRetenoCustomPushReceivedListener](../www/cordova-plugin-reteno.js) | Android | Sets listener for custom push received events. |
|
|
49
|
+
| [removeOnRetenoCustomPushReceivedListener](../www/cordova-plugin-reteno.js) | Android | Removes listener for custom push received events. |
|
|
50
|
+
| [setOnRetenoPushButtonClickedListener](../www/cordova-plugin-reteno.js) | iOS, Android | Sets listener for push notification action button click events. Emits `reteno-push-button-clicked`. [Types](../types/index.ts) |
|
|
51
|
+
| [removeOnRetenoPushButtonClickedListener](../www/cordova-plugin-reteno.js) | iOS, Android | Removes listener for push notification action button click events. |
|
|
52
|
+
| [setNotificationActionHandler](../www/cordova-plugin-reteno.js) | iOS, Android | On iOS, installs the native action button handler when both `enabled` (default: `true`) and `emitEvent` are true — e.g. `{ emitEvent: true }` or `{ enabled: true, emitEvent: true }`. Any other value (e.g. `false`, `null`, `true`, `{ enabled: true }`) clears the handler. On Android, this is a no-op (button clicks are detected automatically). [Types](../types/index.ts) |
|
|
53
|
+
| [setWillPresentNotificationOptions](../www/cordova-plugin-reteno.js) | iOS | Sets presentation options for foreground notifications. Optionally emits `reteno-push-received`. [Types](../types/index.ts) |
|
|
54
|
+
| [setDidReceiveNotificationResponseHandler](../www/cordova-plugin-reteno.js) | iOS | Enables a response handler for notification taps. Optionally emits `reteno-notification-clicked`. [Types](../types/index.ts) |
|
|
55
|
+
| [updateDefaultNotificationChannel](../www/cordova-plugin-reteno.js) | Android | Updates the default notification channel name and description for existing users. [Types](../types/index.ts) |
|
|
56
56
|
|
|
57
57
|
### In-app messages
|
|
58
58
|
|
|
59
|
-
| Method
|
|
60
|
-
|
|
|
61
|
-
| [pauseInAppMessages](../www/cordova-plugin-reteno.js)
|
|
62
|
-
| [setInAppMessagesPauseBehaviour](../www/cordova-plugin-reteno.js)
|
|
63
|
-
| [setOnInAppLifecycleCallback](../www/cordova-plugin-reteno.js)
|
|
64
|
-
| [setOnInAppMessageCustomDataReceivedListener](../www/cordova-plugin-reteno.js)
|
|
65
|
-
| [removeOnInAppMessageCustomDataReceivedListener](../www/cordova-plugin-reteno.js) | Android
|
|
59
|
+
| Method | Supported platform | Description |
|
|
60
|
+
| --------------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| [pauseInAppMessages](../www/cordova-plugin-reteno.js) | iOS, Android | Pauses or resumes in-app messages at runtime. Pass `true` to pause, `false` to resume. |
|
|
62
|
+
| [setInAppMessagesPauseBehaviour](../www/cordova-plugin-reteno.js) | iOS, Android | Sets how paused in-app messages are handled: `SKIP_IN_APPS` or `POSTPONE_IN_APPS`. [Types](../types/index.ts) |
|
|
63
|
+
| [setOnInAppLifecycleCallback](../www/cordova-plugin-reteno.js) | iOS, Android | Subscribes to in-app status/lifecycle events (beforeDisplay, onDisplay, beforeClose, afterClose, onError). Pass `null` to unsubscribe. [Types](../types/index.ts) |
|
|
64
|
+
| [setOnInAppMessageCustomDataReceivedListener](../www/cordova-plugin-reteno.js) | Android | Sets listener for in-app message custom data events. |
|
|
65
|
+
| [removeOnInAppMessageCustomDataReceivedListener](../www/cordova-plugin-reteno.js) | Android | Removes listener for in-app message custom data events. |
|
|
66
66
|
|
|
67
67
|
### App Inbox
|
|
68
68
|
|
|
69
|
-
| Method
|
|
70
|
-
|
|
|
71
|
-
| [getAppInboxMessages](../www/cordova-plugin-reteno.js)
|
|
72
|
-
| [getAppInboxMessagesCount](../www/cordova-plugin-reteno.js)
|
|
73
|
-
| [subscribeOnMessagesCountChanged](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
74
|
-
| [unsubscribeMessagesCountChanged](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
75
|
-
| [markAsOpened](../www/cordova-plugin-reteno.js)
|
|
76
|
-
| [markAllMessagesAsOpened](../www/cordova-plugin-reteno.js)
|
|
69
|
+
| Method | Supported platform | Description |
|
|
70
|
+
| ------------------------------------------------------------------ | ------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| [getAppInboxMessages](../www/cordova-plugin-reteno.js) | iOS, Android | Fetches App Inbox messages with pagination. Returns `{ messages, totalPages }`. [Types](../types/index.ts) |
|
|
72
|
+
| [getAppInboxMessagesCount](../www/cordova-plugin-reteno.js) | iOS, Android | Fetches count of App Inbox messages. Returns a number. |
|
|
73
|
+
| [subscribeOnMessagesCountChanged](../www/cordova-plugin-reteno.js) | iOS, Android | Subscribes to App Inbox messages count changes. |
|
|
74
|
+
| [unsubscribeMessagesCountChanged](../www/cordova-plugin-reteno.js) | iOS, Android | Unsubscribes from App Inbox messages count changes. |
|
|
75
|
+
| [markAsOpened](../www/cordova-plugin-reteno.js) | iOS, Android | Marks an App Inbox message as opened. |
|
|
76
|
+
| [markAllMessagesAsOpened](../www/cordova-plugin-reteno.js) | iOS, Android | Marks all App Inbox messages as opened. |
|
|
77
77
|
|
|
78
78
|
### Recommendations
|
|
79
79
|
|
|
80
|
-
| Method
|
|
81
|
-
|
|
|
82
|
-
| [getRecommendations](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
83
|
-
| [logRecommendations](../www/cordova-plugin-reteno.js) | iOS, Android
|
|
80
|
+
| Method | Supported platform | Description |
|
|
81
|
+
| ----------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| [getRecommendations](../www/cordova-plugin-reteno.js) | iOS, Android | Fetches product or category recommendations. Returns `{ recoms: [...] }`. [Types](../types/index.ts) |
|
|
83
|
+
| [logRecommendations](../www/cordova-plugin-reteno.js) | iOS, Android | Sends recommendation impressions or clicks. [Types](../types/index.ts) |
|
|
84
84
|
|
|
85
85
|
### init example
|
|
86
86
|
|
|
@@ -142,31 +142,30 @@ RetenoPlugin.init({ lifecycleTrackingOptions: { sessionEventsEnabled: false } })
|
|
|
142
142
|
```js
|
|
143
143
|
// `externalUserId` is required and must be a non-empty string.
|
|
144
144
|
// `user` is optional (you can omit it or pass null).
|
|
145
|
-
RetenoPlugin.setUserAttributes(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
postcode: '01001',
|
|
161
|
-
},
|
|
162
|
-
fields: [{ key: 'plan', value: 'premium' }],
|
|
145
|
+
RetenoPlugin.setUserAttributes({
|
|
146
|
+
externalUserId: 'user-123',
|
|
147
|
+
user: {
|
|
148
|
+
userAttributes: {
|
|
149
|
+
email: 'john.doe@example.com',
|
|
150
|
+
phone: '+1234567890',
|
|
151
|
+
firstName: 'John',
|
|
152
|
+
lastName: 'Doe',
|
|
153
|
+
languageCode: 'en',
|
|
154
|
+
timeZone: 'Europe/Kyiv',
|
|
155
|
+
address: {
|
|
156
|
+
region: 'Kyivska',
|
|
157
|
+
town: 'Kyiv',
|
|
158
|
+
address: 'Khreshchatyk St, 1',
|
|
159
|
+
postcode: '01001',
|
|
163
160
|
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
groupNamesExclude: ['unsubscribed'],
|
|
161
|
+
fields: [{ key: 'plan', value: 'premium' }],
|
|
162
|
+
marketId: 'market_1',
|
|
167
163
|
},
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
subscriptionKeys: ['news', 'promotions'],
|
|
165
|
+
groupNamesInclude: ['beta-testers'],
|
|
166
|
+
groupNamesExclude: ['unsubscribed'],
|
|
167
|
+
},
|
|
168
|
+
})
|
|
170
169
|
.then(() => console.log('setUserAttributes: OK'))
|
|
171
170
|
.catch((err) => console.error('setUserAttributes: ERROR', err));
|
|
172
171
|
```
|
|
@@ -176,21 +175,20 @@ RetenoPlugin.setUserAttributes(
|
|
|
176
175
|
```js
|
|
177
176
|
// Anonymous attributes are used before contact identification.
|
|
178
177
|
// Note: Unlike setUserAttributes, this payload does NOT include phone/email.
|
|
179
|
-
RetenoPlugin.setAnonymousUserAttributes(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
)
|
|
178
|
+
RetenoPlugin.setAnonymousUserAttributes({
|
|
179
|
+
firstName: 'John',
|
|
180
|
+
lastName: 'Doe',
|
|
181
|
+
languageCode: 'en',
|
|
182
|
+
timeZone: 'Europe/Kyiv',
|
|
183
|
+
address: {
|
|
184
|
+
region: 'Kyivska',
|
|
185
|
+
town: 'Kyiv',
|
|
186
|
+
address: 'Khreshchatyk St, 1',
|
|
187
|
+
postcode: '01001',
|
|
188
|
+
},
|
|
189
|
+
fields: [{ key: 'utm_source', value: 'google' }],
|
|
190
|
+
marketId: 'market_1',
|
|
191
|
+
})
|
|
194
192
|
.then(() => console.log('setAnonymousUserAttributes: OK'))
|
|
195
193
|
.catch((err) => console.error('setAnonymousUserAttributes: ERROR', err));
|
|
196
194
|
```
|
|
@@ -206,31 +204,30 @@ RetenoPlugin.setAnonymousUserAttributes(
|
|
|
206
204
|
// 1 token per device behavior.
|
|
207
205
|
// `externalUserId` is required and must be a non-empty string.
|
|
208
206
|
// `user` is required and must be an object.
|
|
209
|
-
RetenoPlugin.setMultiAccountUserAttributes(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
postcode: '01001',
|
|
225
|
-
},
|
|
226
|
-
fields: [{ key: 'plan', value: 'premium' }],
|
|
207
|
+
RetenoPlugin.setMultiAccountUserAttributes({
|
|
208
|
+
externalUserId: 'user-123',
|
|
209
|
+
user: {
|
|
210
|
+
userAttributes: {
|
|
211
|
+
email: 'john.doe@example.com',
|
|
212
|
+
phone: '+1234567890',
|
|
213
|
+
firstName: 'John',
|
|
214
|
+
lastName: 'Doe',
|
|
215
|
+
languageCode: 'en',
|
|
216
|
+
timeZone: 'Europe/Kyiv',
|
|
217
|
+
address: {
|
|
218
|
+
region: 'Kyivska',
|
|
219
|
+
town: 'Kyiv',
|
|
220
|
+
address: 'Khreshchatyk St, 1',
|
|
221
|
+
postcode: '01001',
|
|
227
222
|
},
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
groupNamesExclude: ['unsubscribed'],
|
|
223
|
+
fields: [{ key: 'plan', value: 'premium' }],
|
|
224
|
+
marketId: 'market_1',
|
|
231
225
|
},
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
subscriptionKeys: ['news', 'promotions'],
|
|
227
|
+
groupNamesInclude: ['beta-testers'],
|
|
228
|
+
groupNamesExclude: ['unsubscribed'],
|
|
229
|
+
},
|
|
230
|
+
})
|
|
234
231
|
.then(() => console.log('setMultiAccountUserAttributes: OK'))
|
|
235
232
|
.catch((err) => console.error('setMultiAccountUserAttributes: ERROR', err));
|
|
236
233
|
```
|
|
@@ -243,12 +240,10 @@ RetenoPlugin.setMultiAccountUserAttributes(
|
|
|
243
240
|
// Android: applies immediately.
|
|
244
241
|
// iOS: this works only BEFORE SDK initialization (before calling init()).
|
|
245
242
|
// Deprecated: sessionEventsEnabled (if used) toggles both sessionStart and sessionEnd.
|
|
246
|
-
RetenoPlugin.setLifecycleTrackingOptions(
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
)
|
|
243
|
+
RetenoPlugin.setLifecycleTrackingOptions({
|
|
244
|
+
sessionStartEventsEnabled: true,
|
|
245
|
+
sessionEndEventsEnabled: true,
|
|
246
|
+
})
|
|
252
247
|
.then(() => console.log('setLifecycleTrackingOptions: OK'))
|
|
253
248
|
.catch((err) => console.error('setLifecycleTrackingOptions: ERROR', err));
|
|
254
249
|
```
|
|
@@ -267,17 +262,15 @@ Invalid values (anything except `'ALL'`, `'NONE'`, or an object with known field
|
|
|
267
262
|
Payload type: `LogEventPayload` in [types](../types/index.ts).
|
|
268
263
|
|
|
269
264
|
```js
|
|
270
|
-
RetenoPlugin.logEvent(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
)
|
|
265
|
+
RetenoPlugin.logEvent({
|
|
266
|
+
eventName: 'purchase',
|
|
267
|
+
// Optional ISO 8601 string. If omitted, current time is used.
|
|
268
|
+
date: new Date().toISOString(),
|
|
269
|
+
parameters: [
|
|
270
|
+
{ name: 'orderId', value: 'A-123' },
|
|
271
|
+
{ name: 'amount', value: '19.99' },
|
|
272
|
+
],
|
|
273
|
+
})
|
|
281
274
|
.then(() => console.log('logEvent: OK'))
|
|
282
275
|
.catch((err) => console.error('logEvent: ERROR', err));
|
|
283
276
|
```
|
|
@@ -365,9 +358,7 @@ RetenoPlugin.logEcommerceEvent({
|
|
|
365
358
|
### logScreenView example
|
|
366
359
|
|
|
367
360
|
```js
|
|
368
|
-
RetenoPlugin.logScreenView(
|
|
369
|
-
'HomeScreen'
|
|
370
|
-
)
|
|
361
|
+
RetenoPlugin.logScreenView('HomeScreen')
|
|
371
362
|
.then(() => console.log('logScreenView: OK'))
|
|
372
363
|
.catch((err) => console.error('logScreenView: ERROR', err));
|
|
373
364
|
```
|
|
@@ -375,8 +366,7 @@ RetenoPlugin.logScreenView(
|
|
|
375
366
|
### forcePushData example
|
|
376
367
|
|
|
377
368
|
```js
|
|
378
|
-
RetenoPlugin
|
|
379
|
-
.forcePushData()
|
|
369
|
+
RetenoPlugin.forcePushData()
|
|
380
370
|
.then(() => console.log('forcePushData: OK'))
|
|
381
371
|
.catch((err) => console.error('forcePushData: ERROR', err));
|
|
382
372
|
```
|
|
@@ -468,13 +458,13 @@ RetenoPlugin.setOnInAppMessageCustomDataReceivedListener(function (event) {
|
|
|
468
458
|
If you obtain a token outside this plugin (for example via another plugin/SDK), you can forward it to Reteno so it can register the device for push.
|
|
469
459
|
|
|
470
460
|
Notes:
|
|
461
|
+
|
|
471
462
|
- On Android, if Reteno receives FCM callbacks directly, you generally don't need to call `setDeviceToken`.
|
|
472
463
|
- On iOS with Firebase, prefer the default `IOS_DEVICE_TOKEN_HANDLING_MODE=manual` flow with automatic forwarding in `init()`, described in [iOS docs](./ios.md#using-fcm-firebase-cloud-messaging-on-ios).
|
|
473
464
|
|
|
474
465
|
```js
|
|
475
466
|
// 1) Initialize Reteno first.
|
|
476
|
-
RetenoPlugin
|
|
477
|
-
.init()
|
|
467
|
+
RetenoPlugin.init()
|
|
478
468
|
.then(() => {
|
|
479
469
|
// Forward token from your token source (replace this with your integration).
|
|
480
470
|
getFcmTokenFromSomewhere(
|
|
@@ -567,12 +557,10 @@ Updates the default notification channel parameters for existing users on Androi
|
|
|
567
557
|
Payload type: `NotificationChannelConfig` in [types](../types/index.ts).
|
|
568
558
|
|
|
569
559
|
```js
|
|
570
|
-
RetenoPlugin.updateDefaultNotificationChannel(
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}
|
|
575
|
-
)
|
|
560
|
+
RetenoPlugin.updateDefaultNotificationChannel({
|
|
561
|
+
name: 'New Channel Name',
|
|
562
|
+
description: 'New Channel Description',
|
|
563
|
+
})
|
|
576
564
|
.then(() => console.log('updateDefaultNotificationChannel: OK'))
|
|
577
565
|
.catch((err) => console.error('updateDefaultNotificationChannel: ERROR', err));
|
|
578
566
|
```
|
|
@@ -584,17 +572,21 @@ Fetches paginated App Inbox messages. Payload type: `GetAppInboxMessagesPayload`
|
|
|
584
572
|
Returns `AppInboxMessages`: `{ messages: AppInboxMessage[], totalPages: number }`.
|
|
585
573
|
|
|
586
574
|
```js
|
|
587
|
-
RetenoPlugin.getAppInboxMessages(
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
)
|
|
575
|
+
RetenoPlugin.getAppInboxMessages({
|
|
576
|
+
page: 1,
|
|
577
|
+
pageSize: 20,
|
|
578
|
+
status: 'UNOPENED', // optional: 'OPENED' | 'UNOPENED'
|
|
579
|
+
})
|
|
594
580
|
.then((result) => {
|
|
595
581
|
// result.messages — array of AppInboxMessage objects
|
|
596
582
|
// result.totalPages — total number of pages
|
|
597
|
-
console.log(
|
|
583
|
+
console.log(
|
|
584
|
+
'getAppInboxMessages: OK',
|
|
585
|
+
result.messages.length,
|
|
586
|
+
'of',
|
|
587
|
+
result.totalPages,
|
|
588
|
+
'pages'
|
|
589
|
+
);
|
|
598
590
|
})
|
|
599
591
|
.catch((err) => console.error('getAppInboxMessages: ERROR', err));
|
|
600
592
|
```
|
|
@@ -661,13 +653,11 @@ Returns `RecommendationsResponse`: `{ recoms: RecommendationItem[] }`. Each item
|
|
|
661
653
|
|
|
662
654
|
```js
|
|
663
655
|
// Product-based recommendations.
|
|
664
|
-
RetenoPlugin.getRecommendations(
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
670
|
-
)
|
|
656
|
+
RetenoPlugin.getRecommendations({
|
|
657
|
+
recomVariantId: 'variant-id',
|
|
658
|
+
productIds: ['product-1', 'product-2'],
|
|
659
|
+
fields: ['name', 'price', 'image', 'link'],
|
|
660
|
+
})
|
|
671
661
|
.then((result) => {
|
|
672
662
|
// result.recoms — array of recommendation items
|
|
673
663
|
// each item has productId + requested fields (name, price, etc.)
|
|
@@ -678,27 +668,23 @@ RetenoPlugin.getRecommendations(
|
|
|
678
668
|
|
|
679
669
|
```js
|
|
680
670
|
// Category-based recommendations.
|
|
681
|
-
RetenoPlugin.getRecommendations(
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
687
|
-
)
|
|
671
|
+
RetenoPlugin.getRecommendations({
|
|
672
|
+
recomVariantId: 'variant-id',
|
|
673
|
+
categoryId: 'category-1',
|
|
674
|
+
fields: ['name', 'price'],
|
|
675
|
+
})
|
|
688
676
|
.then((result) => console.log('getRecommendations: OK', result))
|
|
689
677
|
.catch((err) => console.error('getRecommendations: ERROR', err));
|
|
690
678
|
```
|
|
691
679
|
|
|
692
680
|
```js
|
|
693
681
|
// With filters.
|
|
694
|
-
RetenoPlugin.getRecommendations(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
}
|
|
701
|
-
)
|
|
682
|
+
RetenoPlugin.getRecommendations({
|
|
683
|
+
recomVariantId: 'variant-id',
|
|
684
|
+
productIds: ['product-1'],
|
|
685
|
+
fields: ['name', 'price'],
|
|
686
|
+
filters: [{ name: 'category', values: ['shoes', 'boots'] }],
|
|
687
|
+
})
|
|
702
688
|
.then((result) => console.log('getRecommendations: OK', result))
|
|
703
689
|
.catch((err) => console.error('getRecommendations: ERROR', err));
|
|
704
690
|
```
|
|
@@ -708,23 +694,21 @@ RetenoPlugin.getRecommendations(
|
|
|
708
694
|
Sends recommendation events. Payload type: `LogRecommendationsPayload` in [types](../types/index.ts).
|
|
709
695
|
|
|
710
696
|
```js
|
|
711
|
-
RetenoPlugin.logRecommendations(
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
)
|
|
697
|
+
RetenoPlugin.logRecommendations({
|
|
698
|
+
recomVariantId: 'variant-id',
|
|
699
|
+
recomEvents: [
|
|
700
|
+
{
|
|
701
|
+
recomEventType: 'IMPRESSIONS',
|
|
702
|
+
occurred: new Date().toISOString(),
|
|
703
|
+
productId: 'product-1',
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
recomEventType: 'CLICKS',
|
|
707
|
+
occurred: new Date().toISOString(),
|
|
708
|
+
productId: 'product-2',
|
|
709
|
+
},
|
|
710
|
+
],
|
|
711
|
+
})
|
|
728
712
|
.then(() => console.log('logRecommendations: OK'))
|
|
729
713
|
.catch((err) => console.error('logRecommendations: ERROR', err));
|
|
730
714
|
```
|
package/docs/ios.md
CHANGED
|
@@ -78,7 +78,6 @@ target 'App' do
|
|
|
78
78
|
end
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
|
|
82
81
|
## Add Notification Content Extension (NCE) — Images Carousel
|
|
83
82
|
|
|
84
83
|
The Notification Content Extension is required for rich push notifications with an **Images Carousel**.
|
|
@@ -86,7 +85,7 @@ It provides the `UNNotificationContentExtension` entry point that renders a cust
|
|
|
86
85
|
|
|
87
86
|
Official guide: https://docs.reteno.com/reference/ios-images-carousel
|
|
88
87
|
|
|
89
|
-
### Create the extension target
|
|
88
|
+
### Create the extension target _(manual Xcode step)_
|
|
90
89
|
|
|
91
90
|
In Xcode: **File → New → Target → Notification Content Extension**. Name it `NotificationContentExtension`.
|
|
92
91
|
|
|
@@ -130,7 +129,7 @@ Open `NotificationContentExtension/Info.plist` as source code and replace the `N
|
|
|
130
129
|
|
|
131
130
|
Make sure the NCE **Deployment Target** in Xcode matches the main app target (iOS 15.0+). A mismatch is the most common reason carousel images fail to display.
|
|
132
131
|
|
|
133
|
-
### Embed App Extensions — Copy only when installing
|
|
132
|
+
### Embed App Extensions — Copy only when installing _(manual Xcode step)_
|
|
134
133
|
|
|
135
134
|
> **This step must be done manually in Xcode** — it cannot be automated.
|
|
136
135
|
> Official guide (Troubleshooting → "Turn off Copy Only when Installing"): https://docs.reteno.com/reference/ios-images-carousel
|
|
@@ -307,6 +306,7 @@ If your app calls `FirebaseApp.configure()` without this file, Firebase will cra
|
|
|
307
306
|
Nothing to do. Firebase iOS SDK uses **method swizzling** by default — it automatically intercepts `didRegisterForRemoteNotificationsWithDeviceToken` and forwards the APNS token to Firebase without any AppDelegate code.
|
|
308
307
|
|
|
309
308
|
When `IOS_DEVICE_TOKEN_HANDLING_MODE` is set to `manual`, the plugin:
|
|
309
|
+
|
|
310
310
|
1. Calls `FirebaseApp.configure()` automatically on `init()` if not already called and `GoogleService-Info.plist` is present.
|
|
311
311
|
2. Subscribes to FCM token updates and forwards them to Reteno once Firebase is configured.
|
|
312
312
|
|
|
@@ -381,7 +381,7 @@ await RetenoPlugin.init({
|
|
|
381
381
|
});
|
|
382
382
|
|
|
383
383
|
// Runtime pause/resume
|
|
384
|
-
await RetenoPlugin.pauseInAppMessages(true);
|
|
384
|
+
await RetenoPlugin.pauseInAppMessages(true); // pause
|
|
385
385
|
await RetenoPlugin.pauseInAppMessages(false); // resume
|
|
386
386
|
```
|
|
387
387
|
|
|
@@ -403,7 +403,7 @@ Set presentation options for foreground notifications:
|
|
|
403
403
|
```js
|
|
404
404
|
await RetenoPlugin.setWillPresentNotificationOptions({
|
|
405
405
|
options: ['badge', 'sound', 'banner'],
|
|
406
|
-
emitEvent: true
|
|
406
|
+
emitEvent: true,
|
|
407
407
|
});
|
|
408
408
|
```
|
|
409
409
|
|
|
@@ -414,7 +414,7 @@ Enable a response handler for notification taps:
|
|
|
414
414
|
```js
|
|
415
415
|
await RetenoPlugin.setDidReceiveNotificationResponseHandler({
|
|
416
416
|
enabled: true,
|
|
417
|
-
emitEvent: true
|
|
417
|
+
emitEvent: true,
|
|
418
418
|
});
|
|
419
419
|
```
|
|
420
420
|
|
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="cordova-plugin-reteno" version="2.0
|
|
2
|
+
<plugin id="cordova-plugin-reteno" version="2.1.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
|
|
3
3
|
<name>cordova-plugin-reteno</name>
|
|
4
4
|
<engines>
|
|
5
5
|
<engine name="cordova-android" version=">=12.0.0" />
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
<podspec>
|
|
60
60
|
<pods>
|
|
61
|
-
<pod name="Reteno" spec="2.7.
|
|
61
|
+
<pod name="Reteno" spec="2.7.1" />
|
|
62
62
|
<pod name="FirebaseMessaging" />
|
|
63
63
|
</pods>
|
|
64
64
|
</podspec>
|