@adobe/react-native-aepmessaging 7.1.1 → 7.2.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/README.md +66 -2
- package/android/src/main/java/com/adobe/marketing/mobile/reactnative/messaging/RCTAEPMessagingConstants.java +19 -0
- package/android/src/main/java/com/adobe/marketing/mobile/reactnative/messaging/RCTAEPMessagingModule.java +151 -18
- package/android/src/main/java/com/adobe/marketing/mobile/reactnative/messaging/RCTAEPMessagingUtil.java +1 -1
- package/dist/Messaging.d.ts +17 -0
- package/dist/Messaging.js +27 -6
- package/dist/Messaging.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/models/ContentCard.d.ts +6 -1
- package/dist/models/ContentCard.js +9 -0
- package/dist/models/ContentCard.js.map +1 -1
- package/dist/models/HTMLProposition.d.ts +6 -2
- package/dist/models/HTMLProposition.js +9 -0
- package/dist/models/HTMLProposition.js.map +1 -1
- package/dist/models/JSONProposition.d.ts +12 -0
- package/dist/models/{JSONPropositionItem.js → JSONProposition.js} +10 -1
- package/dist/models/JSONProposition.js.map +1 -0
- package/dist/models/Message.d.ts +14 -0
- package/dist/models/Message.js +43 -0
- package/dist/models/Message.js.map +1 -1
- package/dist/models/MessagingProposition.d.ts +10 -3
- package/dist/models/MessagingProposition.js +45 -0
- package/dist/models/MessagingProposition.js.map +1 -1
- package/dist/models/MessagingPropositionItem.d.ts +3 -2
- package/dist/models/PropositionItem.d.ts +83 -0
- package/dist/models/PropositionItem.js +78 -0
- package/dist/models/PropositionItem.js.map +1 -0
- package/ios/src/RCTAEPMessaging.mm +13 -0
- package/ios/src/RCTAEPMessaging.swift +123 -6
- package/ios/src/RCTAEPMessagingConstants.swift +5 -1
- package/ios/src/RCTAEPMessagingDataBridge.swift +19 -0
- package/package.json +2 -2
- package/src/Messaging.ts +34 -12
- package/src/index.ts +13 -5
- package/src/models/ContentCard.ts +12 -1
- package/src/models/HTMLProposition.ts +15 -6
- package/src/models/{JSONPropositionItem.ts → JSONProposition.ts} +15 -6
- package/src/models/Message.ts +51 -1
- package/src/models/MessagingProposition.ts +45 -3
- package/src/models/MessagingPropositionItem.ts +6 -2
- package/src/models/PropositionItem.ts +135 -0
- package/tutorials/In-App Messaging.md +67 -0
- package/dist/models/JSONPropositionItem.d.ts +0 -8
- package/dist/models/JSONPropositionItem.js.map +0 -1
package/README.md
CHANGED
|
@@ -201,6 +201,53 @@ for (let item in proposition.items) {
|
|
|
201
201
|
}
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
|
|
205
|
+
### PropositionItem.track
|
|
206
|
+
|
|
207
|
+
A unified tracking API is available for any proposition item (Content Cards, HTML, JSON, code-based items). You can use the same track() method regardless of content type, making your code more consistent and maintainable.
|
|
208
|
+
|
|
209
|
+
#### Using PropositionItem.track (recommended)
|
|
210
|
+
|
|
211
|
+
**Syntax**
|
|
212
|
+
|
|
213
|
+
```javascript
|
|
214
|
+
// Track display event
|
|
215
|
+
propositionItem.track(MessagingEdgeEventType.DISPLAY);
|
|
216
|
+
|
|
217
|
+
// Track interaction with custom data + event + optional tokens
|
|
218
|
+
propositionItem.track(
|
|
219
|
+
interaction /* string | null */,
|
|
220
|
+
MessagingEdgeEventType.INTERACT /* enum value */,
|
|
221
|
+
[/* tokens */] /* string[] | null */
|
|
222
|
+
);
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
When using `getPropositionsForSurfaces`, the returned objects can be wrapped with `MessagingProposition` to get typed items and convenient tracking via `PropositionItem.track(...)`.
|
|
226
|
+
|
|
227
|
+
```javascript
|
|
228
|
+
import { Messaging, MessagingProposition, MessagingEdgeEventType } from '@adobe/react-native-aepmessaging';
|
|
229
|
+
|
|
230
|
+
const SURFACES = ['mobileapp://my-surface'];
|
|
231
|
+
const messages = await Messaging.getPropositionsForSurfaces(SURFACES);
|
|
232
|
+
|
|
233
|
+
for (const surface of SURFACES) {
|
|
234
|
+
const propositions = messages[surface] || [];
|
|
235
|
+
|
|
236
|
+
for (const proposition of propositions) {
|
|
237
|
+
const msgProp = new MessagingProposition(proposition);
|
|
238
|
+
|
|
239
|
+
if (msgProp.items.length > 0) {
|
|
240
|
+
const propositionItem = msgProp.items[0];
|
|
241
|
+
|
|
242
|
+
// Track interaction with custom data
|
|
243
|
+
propositionItem.track('content_card_clicked', MessagingEdgeEventType.INTERACT, null);
|
|
244
|
+
// Track with tokens for sub-item tracking
|
|
245
|
+
propositionItem.track('button_click', MessagingEdgeEventType.INTERACT, ['token-1', 'token-2']);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
204
251
|
### getLatestMessage
|
|
205
252
|
|
|
206
253
|
Retrieves the most recently displayed message object
|
|
@@ -340,6 +387,20 @@ var message: Message;
|
|
|
340
387
|
message.clear();
|
|
341
388
|
```
|
|
342
389
|
|
|
390
|
+
### handleJavascriptMessage
|
|
391
|
+
|
|
392
|
+
Registers a javascript interface for the provided handler name to the WebView associated with the InAppMessage presentation to handle Javascript messages. When the registered handlers are executed via the HTML the result will be passed back to the associated handler.
|
|
393
|
+
|
|
394
|
+
**Syntax**
|
|
395
|
+
|
|
396
|
+
```typescript
|
|
397
|
+
handleJavascriptMessage(handlerName: string, handler: (content: string) => void);
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Example**
|
|
401
|
+
|
|
402
|
+
It can be used for the native handling of JavaScript events. Please refer to the [tutorial](./tutorials/In-App%20Messaging.md#native-handling-of-javascript-events) for more information.
|
|
403
|
+
|
|
343
404
|
## Programmatically control the display of in-app messages
|
|
344
405
|
|
|
345
406
|
App developers can now create a type `MessagingDelegate` in order to be alerted when specific events occur during the lifecycle of an in-app message.
|
|
@@ -440,6 +501,8 @@ function otherWorkflowFinished() {
|
|
|
440
501
|
|
|
441
502
|
### trackContentCardDisplay
|
|
442
503
|
|
|
504
|
+
Deprecated in 7.2.0: Use `Proposition.track(...)` instead. This API will be removed in a future release.
|
|
505
|
+
|
|
443
506
|
Tracks a Display interaction with the given ContentCard
|
|
444
507
|
|
|
445
508
|
**Syntax**
|
|
@@ -449,6 +512,8 @@ Messaging.trackContentCardDisplay(proposition, contentCard);
|
|
|
449
512
|
|
|
450
513
|
### trackContentCardInteraction
|
|
451
514
|
|
|
515
|
+
Deprecated in 7.2.0: Use `Proposition.track(...)` instead. This API will be removed in a future release.
|
|
516
|
+
|
|
452
517
|
Tracks a Click interaction with the given ContentCard
|
|
453
518
|
|
|
454
519
|
**Syntax**
|
|
@@ -458,5 +523,4 @@ Messaging.trackContentCardInteraction(proposition, contentCard);
|
|
|
458
523
|
|
|
459
524
|
|
|
460
525
|
## Tutorials
|
|
461
|
-
[
|
|
462
|
-
|
|
526
|
+
[Native handling of Javascript Events](./tutorials/In-App%20Messaging.md)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
4
|
+
"License"); you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
7
|
+
or agreed to in writing, software distributed under the License is
|
|
8
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
9
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
10
|
+
language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
package com.adobe.marketing.mobile.reactnative.messaging;
|
|
13
|
+
|
|
14
|
+
class RCTAEPMessagingConstants {
|
|
15
|
+
static final String MESSAGE_ID_KEY = "messageId";
|
|
16
|
+
static final String HANDLER_NAME_KEY = "handlerName";
|
|
17
|
+
static final String CONTENT_KEY = "content";
|
|
18
|
+
static final String ON_JAVASCRIPT_MESSAGE_EVENT = "onJavascriptMessage";
|
|
19
|
+
}
|
|
@@ -14,23 +14,24 @@ package com.adobe.marketing.mobile.reactnative.messaging;
|
|
|
14
14
|
import static com.adobe.marketing.mobile.reactnative.messaging.RCTAEPMessagingUtil.convertMessageToMap;
|
|
15
15
|
|
|
16
16
|
import android.app.Activity;
|
|
17
|
+
import android.util.Log;
|
|
17
18
|
|
|
18
19
|
import androidx.annotation.NonNull;
|
|
20
|
+
import androidx.annotation.Nullable;
|
|
19
21
|
|
|
20
22
|
import com.adobe.marketing.mobile.AdobeCallback;
|
|
21
23
|
import com.adobe.marketing.mobile.AdobeCallbackWithError;
|
|
22
24
|
import com.adobe.marketing.mobile.AdobeError;
|
|
23
|
-
import com.adobe.marketing.mobile.LoggingMode;
|
|
24
25
|
import com.adobe.marketing.mobile.Message;
|
|
25
26
|
import com.adobe.marketing.mobile.Messaging;
|
|
26
27
|
import com.adobe.marketing.mobile.MessagingEdgeEventType;
|
|
27
|
-
import com.adobe.marketing.mobile.MobileCore;
|
|
28
28
|
import com.adobe.marketing.mobile.messaging.MessagingUtils;
|
|
29
29
|
import com.adobe.marketing.mobile.messaging.Proposition;
|
|
30
30
|
import com.adobe.marketing.mobile.messaging.PropositionItem;
|
|
31
31
|
import com.adobe.marketing.mobile.messaging.Surface;
|
|
32
32
|
import com.adobe.marketing.mobile.services.ServiceProvider;
|
|
33
33
|
import com.adobe.marketing.mobile.services.ui.InAppMessage;
|
|
34
|
+
import com.adobe.marketing.mobile.services.ui.message.InAppMessageEventHandler;
|
|
34
35
|
import com.adobe.marketing.mobile.services.ui.Presentable;
|
|
35
36
|
import com.adobe.marketing.mobile.services.ui.PresentationDelegate;
|
|
36
37
|
import com.facebook.react.bridge.Arguments;
|
|
@@ -42,14 +43,56 @@ import com.facebook.react.bridge.ReadableArray;
|
|
|
42
43
|
import com.facebook.react.bridge.ReadableMap;
|
|
43
44
|
import com.facebook.react.bridge.WritableMap;
|
|
44
45
|
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
46
|
+
import java.util.ArrayList;
|
|
45
47
|
import java.util.HashMap;
|
|
46
48
|
import java.util.List;
|
|
47
49
|
import java.util.Map;
|
|
48
50
|
import java.util.concurrent.CountDownLatch;
|
|
51
|
+
import java.util.concurrent.ConcurrentHashMap;
|
|
52
|
+
|
|
53
|
+
|
|
49
54
|
|
|
50
55
|
public final class RCTAEPMessagingModule
|
|
51
56
|
extends ReactContextBaseJavaModule implements PresentationDelegate {
|
|
57
|
+
// We cache uuid -> Proposition (not PropositionItem) for iOS parity: storing items on iOS lost
|
|
58
|
+
// weak parent references. Propositions currently contain a single item, so using the first item
|
|
59
|
+
// for tracking is valid.
|
|
60
|
+
private final Map<String, Proposition> propositionItemByUuid = new ConcurrentHashMap<>();
|
|
52
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Parses the given Proposition and extracts the activity ID.
|
|
64
|
+
*
|
|
65
|
+
* Expected location: scopeDetails.activity.id in the proposition's event data.
|
|
66
|
+
* Returns null when any of the nested structures are missing or the id is not a String.
|
|
67
|
+
*/
|
|
68
|
+
private String extractActivityId(Proposition proposition) {
|
|
69
|
+
try {
|
|
70
|
+
Map<String, Object> eventData = proposition.toEventData();
|
|
71
|
+
if (eventData == null) {
|
|
72
|
+
Log.d(TAG, "[MessagingBridge] Proposition toEventData() returned null; cannot extract activity.id");
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
Object scopeDetailsObj = eventData.get("scopeDetails");
|
|
76
|
+
if (!(scopeDetailsObj instanceof Map)) return null;
|
|
77
|
+
Map<String, Object> scopeDetails = (Map<String, Object>) scopeDetailsObj;
|
|
78
|
+
Object activityObj = scopeDetails.get("activity");
|
|
79
|
+
if (!(activityObj instanceof Map)) {
|
|
80
|
+
Log.d(TAG, "[MessagingBridge] Missing activity under scopeDetails; cannot extract activity.id");
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
Map<String, Object> activity = (Map<String, Object>) activityObj;
|
|
84
|
+
Object id = activity.get("id");
|
|
85
|
+
if (id instanceof String) {
|
|
86
|
+
return (String) id;
|
|
87
|
+
} else {
|
|
88
|
+
Log.d(TAG, "[MessagingBridge] Missing activity.id or not a String; skipping uuid cache mapping");
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
} catch (Exception e) {
|
|
92
|
+
Log.d(TAG, "[MessagingBridge] Exception extracting activity.id: " + e.getMessage(), e);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
53
96
|
private static final String TAG = "RCTAEPMessagingModule";
|
|
54
97
|
private final Map<String, Message> messageCache = new HashMap<>();
|
|
55
98
|
private final ReactApplicationContext reactContext;
|
|
@@ -57,6 +100,7 @@ public final class RCTAEPMessagingModule
|
|
|
57
100
|
private boolean shouldShowMessage = false;
|
|
58
101
|
private CountDownLatch latch = new CountDownLatch(1);
|
|
59
102
|
private Message latestMessage = null;
|
|
103
|
+
private final Map<String, Presentable<?>> presentableCache = new HashMap<>();
|
|
60
104
|
|
|
61
105
|
public RCTAEPMessagingModule(ReactApplicationContext reactContext) {
|
|
62
106
|
super(reactContext);
|
|
@@ -100,21 +144,37 @@ public final class RCTAEPMessagingModule
|
|
|
100
144
|
final Promise promise) {
|
|
101
145
|
String bundleId = this.reactContext.getPackageName();
|
|
102
146
|
Messaging.getPropositionsForSurfaces(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
147
|
+
RCTAEPMessagingUtil.convertSurfaces(surfaces),
|
|
148
|
+
new AdobeCallbackWithError<Map<Surface, List<Proposition>>>() {
|
|
149
|
+
@Override
|
|
150
|
+
public void fail(final AdobeError adobeError) {
|
|
151
|
+
promise.reject(adobeError.getErrorName(),
|
|
152
|
+
"Unable to get Propositions");
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@Override
|
|
156
|
+
public void call(
|
|
157
|
+
Map<Surface, List<Proposition>> propositionsMap) {
|
|
158
|
+
// Build UUID->Proposition map keyed by scopeDetails.activity.id
|
|
159
|
+
try {
|
|
160
|
+
for (Map.Entry<Surface, List<Proposition>> entry : propositionsMap.entrySet()) {
|
|
161
|
+
List<Proposition> propositions = entry.getValue();
|
|
162
|
+
if (propositions == null) continue;
|
|
163
|
+
for (Proposition proposition : propositions) {
|
|
164
|
+
try {
|
|
165
|
+
String key = extractActivityId(proposition);
|
|
166
|
+
if (key != null) {
|
|
167
|
+
propositionItemByUuid.put(key, proposition);
|
|
168
|
+
}
|
|
169
|
+
} catch (Throwable ignore) {}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
} catch (Throwable ignore) {}
|
|
173
|
+
|
|
174
|
+
promise.resolve(RCTAEPMessagingUtil.convertSurfacePropositions(
|
|
175
|
+
propositionsMap, bundleId));
|
|
176
|
+
}
|
|
177
|
+
});
|
|
118
178
|
}
|
|
119
179
|
|
|
120
180
|
@ReactMethod
|
|
@@ -131,6 +191,8 @@ public final class RCTAEPMessagingModule
|
|
|
131
191
|
public void updatePropositionsForSurfaces(ReadableArray surfaces) {
|
|
132
192
|
Messaging.updatePropositionsForSurfaces(
|
|
133
193
|
RCTAEPMessagingUtil.convertSurfaces(surfaces));
|
|
194
|
+
propositionItemByUuid.clear();
|
|
195
|
+
|
|
134
196
|
}
|
|
135
197
|
|
|
136
198
|
// Message Methods
|
|
@@ -175,11 +237,33 @@ public final class RCTAEPMessagingModule
|
|
|
175
237
|
}
|
|
176
238
|
}
|
|
177
239
|
|
|
240
|
+
@ReactMethod
|
|
241
|
+
public void handleJavascriptMessage(final String messageId, final String handlerName) {
|
|
242
|
+
Presentable<?> presentable = presentableCache.get(messageId);
|
|
243
|
+
if (presentable == null || !(presentable.getPresentation() instanceof InAppMessage)) {
|
|
244
|
+
Log.w(TAG, "handleJavascriptMessage: No presentable found for messageId: " + messageId);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
Presentable<InAppMessage> inAppMessagePresentable = (Presentable<InAppMessage>) presentable;
|
|
249
|
+
InAppMessageEventHandler eventHandler = inAppMessagePresentable.getPresentation().getEventHandler();
|
|
250
|
+
|
|
251
|
+
eventHandler.handleJavascriptMessage(handlerName, content -> {
|
|
252
|
+
Map<String, String> params = new HashMap<>();
|
|
253
|
+
params.put(RCTAEPMessagingConstants.MESSAGE_ID_KEY, messageId);
|
|
254
|
+
params.put(RCTAEPMessagingConstants.HANDLER_NAME_KEY, handlerName);
|
|
255
|
+
params.put(RCTAEPMessagingConstants.CONTENT_KEY, content);
|
|
256
|
+
emitEvent(RCTAEPMessagingConstants.ON_JAVASCRIPT_MESSAGE_EVENT, params);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
178
260
|
// Messaging Delegate functions
|
|
179
261
|
@Override
|
|
180
262
|
public void onShow(final Presentable<?> presentable) {
|
|
181
263
|
if (!(presentable.getPresentation() instanceof InAppMessage)) return;
|
|
182
264
|
Message message = MessagingUtils.getMessageForPresentable((Presentable<InAppMessage>) presentable);
|
|
265
|
+
presentableCache.put(message.getId(), presentable);
|
|
266
|
+
|
|
183
267
|
if (message != null) {
|
|
184
268
|
Map<String, String> data =
|
|
185
269
|
convertMessageToMap(message);
|
|
@@ -191,6 +275,8 @@ public final class RCTAEPMessagingModule
|
|
|
191
275
|
public void onDismiss(final Presentable<?> presentable) {
|
|
192
276
|
if (!(presentable.getPresentation() instanceof InAppMessage)) return;
|
|
193
277
|
Message message = MessagingUtils.getMessageForPresentable((Presentable<InAppMessage>) presentable);
|
|
278
|
+
presentableCache.remove(message.getId());
|
|
279
|
+
|
|
194
280
|
if (message != null) {
|
|
195
281
|
Map<String, String> data =
|
|
196
282
|
convertMessageToMap(message);
|
|
@@ -233,7 +319,6 @@ public final class RCTAEPMessagingModule
|
|
|
233
319
|
if (shouldSaveMessage) {
|
|
234
320
|
messageCache.put(message.getId(), message);
|
|
235
321
|
}
|
|
236
|
-
|
|
237
322
|
return shouldShowMessage;
|
|
238
323
|
}
|
|
239
324
|
|
|
@@ -295,4 +380,52 @@ public final class RCTAEPMessagingModule
|
|
|
295
380
|
}
|
|
296
381
|
}
|
|
297
382
|
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Tracks interactions with a PropositionItem using the provided interaction and event type.
|
|
386
|
+
* This method is used by the React Native PropositionItem.track() method.
|
|
387
|
+
*
|
|
388
|
+
* @param interaction A custom string value to be recorded in the interaction (nullable)
|
|
389
|
+
* @param eventType The MessagingEdgeEventType numeric value
|
|
390
|
+
* @param tokens Array containing the sub-item tokens for recording interaction (nullable)
|
|
391
|
+
*/
|
|
392
|
+
@ReactMethod
|
|
393
|
+
public void trackPropositionItem(String uuid, @Nullable String interaction, int eventType, @Nullable ReadableArray tokens) {
|
|
394
|
+
try {
|
|
395
|
+
// Convert eventType int to MessagingEdgeEventType enum
|
|
396
|
+
final MessagingEdgeEventType edgeEventType = RCTAEPMessagingUtil.getEventType(eventType);
|
|
397
|
+
if (edgeEventType == null) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
// Resolve PropositionItem by UUID
|
|
401
|
+
if (uuid == null) {
|
|
402
|
+
Log.d(TAG, "[MessagingBridge] Null uuid provided");
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
final Proposition proposition = propositionItemByUuid.get(uuid);
|
|
406
|
+
if (proposition == null) {
|
|
407
|
+
Log.d(TAG, "[MessagingBridge] No cached proposition for uuid=" + uuid);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
final List<PropositionItem> items = proposition.getItems();
|
|
411
|
+
if (items == null || items.isEmpty()) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
final PropositionItem propositionItem = items.get(0);
|
|
415
|
+
|
|
416
|
+
// Convert ReadableArray tokens -> List<String> (empty list if none)
|
|
417
|
+
List<String> tokenList = new ArrayList<>();
|
|
418
|
+
if (tokens != null) {
|
|
419
|
+
for (int i = 0; i < tokens.size(); i++) {
|
|
420
|
+
tokenList.add(tokens.getString(i));
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
Log.d(TAG, "[MessagingBridge] Tracking (direct) uuid=" + uuid + ", interaction=" + interaction + ", tokens=" + tokenList + ", eventType=" + edgeEventType.name());
|
|
424
|
+
propositionItem.track(interaction, edgeEventType, tokenList);
|
|
425
|
+
|
|
426
|
+
} catch (Exception e) {
|
|
427
|
+
Log.d(TAG, "Error tracking PropositionItem for uuid: " + uuid + ", error: " + e.getMessage(), e);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
298
431
|
}
|
package/dist/Messaging.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface NativeMessagingModule {
|
|
|
13
13
|
updatePropositionsForSurfaces: (surfaces: string[]) => void;
|
|
14
14
|
trackContentCardDisplay: (proposition: MessagingProposition, contentCard: ContentCard) => void;
|
|
15
15
|
trackContentCardInteraction: (proposition: MessagingProposition, contentCard: ContentCard) => void;
|
|
16
|
+
trackPropositionItem: (itemId: string, interaction: string | null, eventType: number, tokens: string[] | null) => void;
|
|
16
17
|
}
|
|
17
18
|
declare class Messaging {
|
|
18
19
|
/**
|
|
@@ -43,8 +44,24 @@ declare class Messaging {
|
|
|
43
44
|
* @returns A record of surface names with their corresponding propositions
|
|
44
45
|
*/
|
|
45
46
|
static getPropositionsForSurfaces(surfaces: string[]): Promise<Record<string, MessagingProposition[]>>;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use PropositionItem.track(...) instead.
|
|
49
|
+
*/
|
|
46
50
|
static trackContentCardDisplay(proposition: MessagingProposition, contentCard: ContentCard): void;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use PropositionItem.track(...) instead.
|
|
53
|
+
*/
|
|
47
54
|
static trackContentCardInteraction(proposition: MessagingProposition, contentCard: ContentCard): void;
|
|
55
|
+
/**
|
|
56
|
+
* Tracks interactions with a PropositionItem using the provided interaction and event type.
|
|
57
|
+
* This method is used internally by the PropositionItem.track() method.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} itemId - The unique identifier of the PropositionItem
|
|
60
|
+
* @param {string | null} interaction - A custom string value to be recorded in the interaction
|
|
61
|
+
* @param {number} eventType - The MessagingEdgeEventType numeric value
|
|
62
|
+
* @param {string[] | null} tokens - Array containing the sub-item tokens for recording interaction
|
|
63
|
+
*/
|
|
64
|
+
static trackPropositionItem(itemId: string, interaction: string | null, eventType: number, tokens: string[] | null): void;
|
|
48
65
|
/**
|
|
49
66
|
* Function to set the UI Message delegate to listen the Message lifecycle events.
|
|
50
67
|
* @returns A function to unsubscribe from all event listeners
|
package/dist/Messaging.js
CHANGED
|
@@ -63,12 +63,30 @@ class Messaging {
|
|
|
63
63
|
return yield RCTAEPMessaging.getPropositionsForSurfaces(surfaces);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use PropositionItem.track(...) instead.
|
|
68
|
+
*/
|
|
66
69
|
static trackContentCardDisplay(proposition, contentCard) {
|
|
67
70
|
RCTAEPMessaging.trackContentCardDisplay(proposition, contentCard);
|
|
68
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated Use PropositionItem.track(...) instead.
|
|
74
|
+
*/
|
|
69
75
|
static trackContentCardInteraction(proposition, contentCard) {
|
|
70
76
|
RCTAEPMessaging.trackContentCardInteraction(proposition, contentCard);
|
|
71
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Tracks interactions with a PropositionItem using the provided interaction and event type.
|
|
80
|
+
* This method is used internally by the PropositionItem.track() method.
|
|
81
|
+
*
|
|
82
|
+
* @param {string} itemId - The unique identifier of the PropositionItem
|
|
83
|
+
* @param {string | null} interaction - A custom string value to be recorded in the interaction
|
|
84
|
+
* @param {number} eventType - The MessagingEdgeEventType numeric value
|
|
85
|
+
* @param {string[] | null} tokens - Array containing the sub-item tokens for recording interaction
|
|
86
|
+
*/
|
|
87
|
+
static trackPropositionItem(itemId, interaction, eventType, tokens) {
|
|
88
|
+
RCTAEPMessaging.trackPropositionItem(itemId, interaction, eventType, tokens);
|
|
89
|
+
}
|
|
72
90
|
/**
|
|
73
91
|
* Function to set the UI Message delegate to listen the Message lifecycle events.
|
|
74
92
|
* @returns A function to unsubscribe from all event listeners
|
|
@@ -76,22 +94,25 @@ class Messaging {
|
|
|
76
94
|
static setMessagingDelegate(delegate) {
|
|
77
95
|
messagingDelegate = delegate;
|
|
78
96
|
const eventEmitter = new react_native_1.NativeEventEmitter(RCTAEPMessaging);
|
|
79
|
-
eventEmitter.addListener('onShow', (message) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onShow) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, message); });
|
|
97
|
+
eventEmitter.addListener('onShow', (message) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onShow) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, new Message_1.default(message)); });
|
|
80
98
|
eventEmitter.addListener('onDismiss', (message) => {
|
|
81
99
|
var _a;
|
|
82
|
-
|
|
100
|
+
const messageInstance = new Message_1.default(message);
|
|
101
|
+
messageInstance._clearJavascriptMessageHandlers();
|
|
102
|
+
(_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onDismiss) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, messageInstance);
|
|
83
103
|
});
|
|
84
104
|
eventEmitter.addListener('shouldShowMessage', (message) => {
|
|
85
105
|
var _a, _b, _c, _d;
|
|
86
|
-
const
|
|
87
|
-
const
|
|
106
|
+
const messageInstance = new Message_1.default(message);
|
|
107
|
+
const shouldShowMessage = (_b = (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.shouldShowMessage) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, messageInstance)) !== null && _b !== void 0 ? _b : true;
|
|
108
|
+
const shouldSaveMessage = (_d = (_c = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.shouldSaveMessage) === null || _c === void 0 ? void 0 : _c.call(messagingDelegate, messageInstance)) !== null && _d !== void 0 ? _d : false;
|
|
88
109
|
RCTAEPMessaging.setMessageSettings(shouldShowMessage, shouldSaveMessage);
|
|
89
110
|
});
|
|
90
111
|
if (react_native_1.Platform.OS === 'ios') {
|
|
91
|
-
eventEmitter.addListener('urlLoaded', (event) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.urlLoaded) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, event.url, event.message); });
|
|
112
|
+
eventEmitter.addListener('urlLoaded', (event) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.urlLoaded) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, event.url, new Message_1.default(event.message)); });
|
|
92
113
|
}
|
|
93
114
|
if (react_native_1.Platform.OS === 'android') {
|
|
94
|
-
eventEmitter.addListener('onContentLoaded', (event) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onContentLoaded) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, event.message); });
|
|
115
|
+
eventEmitter.addListener('onContentLoaded', (event) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onContentLoaded) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, new Message_1.default(event.message)); });
|
|
95
116
|
}
|
|
96
117
|
RCTAEPMessaging.setMessagingDelegate();
|
|
97
118
|
return () => {
|
package/dist/Messaging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Messaging.js","sourceRoot":"","sources":["../src/Messaging.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAEF,+CAKsB;AACtB,uEAAuC;
|
|
1
|
+
{"version":3,"file":"Messaging.js","sourceRoot":"","sources":["../src/Messaging.ts"],"names":[],"mappings":";AAAA;;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QACrD,eAAe,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;CACF;AAED,kBAAe,SAAS,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import Messaging from './Messaging';
|
|
2
|
-
import { ContentCard } from './models/ContentCard';
|
|
3
|
-
import { HTMLProposition } from './models/HTMLProposition';
|
|
2
|
+
import { ContentCard, ContentCardData } from './models/ContentCard';
|
|
4
3
|
import { InAppMessage } from './models/InAppMessage';
|
|
5
|
-
import {
|
|
4
|
+
import { HTMLProposition, HTMLPropositionData } from './models/HTMLProposition';
|
|
5
|
+
import { JSONPropositionItem, JSONPropositionData } from './models/JSONProposition';
|
|
6
6
|
import Message from './models/Message';
|
|
7
7
|
import { MessagingDelegate } from './models/MessagingDelegate';
|
|
8
8
|
import MessagingEdgeEventType from './models/MessagingEdgeEventType';
|
|
9
9
|
import { MessagingProposition } from './models/MessagingProposition';
|
|
10
10
|
import { MessagingPropositionItem } from './models/MessagingPropositionItem';
|
|
11
11
|
import { PersonalizationSchema } from './models/PersonalizationSchema';
|
|
12
|
+
import { PropositionItem, PropositionItemData } from './models/PropositionItem';
|
|
12
13
|
import { Activity, Characteristics } from './models/ScopeDetails';
|
|
13
|
-
export { Activity, Characteristics, ContentCard,
|
|
14
|
+
export { Activity, Characteristics, ContentCard, ContentCardData, InAppMessage, Messaging, Message, MessagingDelegate, MessagingEdgeEventType, MessagingProposition, MessagingPropositionItem, PersonalizationSchema, PropositionItem, PropositionItemData, HTMLProposition, HTMLPropositionData, JSONPropositionItem, JSONPropositionData, };
|
package/dist/index.js
CHANGED
|
@@ -11,14 +11,24 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
11
11
|
governing permissions and limitations under the License.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.PersonalizationSchema = exports.MessagingEdgeEventType = exports.Message = exports.Messaging = void 0;
|
|
14
|
+
exports.JSONPropositionItem = exports.HTMLProposition = exports.PropositionItem = exports.PersonalizationSchema = exports.MessagingProposition = exports.MessagingEdgeEventType = exports.Message = exports.Messaging = exports.ContentCard = void 0;
|
|
15
15
|
const tslib_1 = require("tslib");
|
|
16
16
|
const Messaging_1 = tslib_1.__importDefault(require("./Messaging"));
|
|
17
17
|
exports.Messaging = Messaging_1.default;
|
|
18
|
+
const ContentCard_1 = require("./models/ContentCard");
|
|
19
|
+
Object.defineProperty(exports, "ContentCard", { enumerable: true, get: function () { return ContentCard_1.ContentCard; } });
|
|
20
|
+
const HTMLProposition_1 = require("./models/HTMLProposition");
|
|
21
|
+
Object.defineProperty(exports, "HTMLProposition", { enumerable: true, get: function () { return HTMLProposition_1.HTMLProposition; } });
|
|
22
|
+
const JSONProposition_1 = require("./models/JSONProposition");
|
|
23
|
+
Object.defineProperty(exports, "JSONPropositionItem", { enumerable: true, get: function () { return JSONProposition_1.JSONPropositionItem; } });
|
|
18
24
|
const Message_1 = tslib_1.__importDefault(require("./models/Message"));
|
|
19
25
|
exports.Message = Message_1.default;
|
|
20
26
|
const MessagingEdgeEventType_1 = tslib_1.__importDefault(require("./models/MessagingEdgeEventType"));
|
|
21
27
|
exports.MessagingEdgeEventType = MessagingEdgeEventType_1.default;
|
|
28
|
+
const MessagingProposition_1 = require("./models/MessagingProposition");
|
|
29
|
+
Object.defineProperty(exports, "MessagingProposition", { enumerable: true, get: function () { return MessagingProposition_1.MessagingProposition; } });
|
|
22
30
|
const PersonalizationSchema_1 = require("./models/PersonalizationSchema");
|
|
23
31
|
Object.defineProperty(exports, "PersonalizationSchema", { enumerable: true, get: function () { return PersonalizationSchema_1.PersonalizationSchema; } });
|
|
32
|
+
const PropositionItem_1 = require("./models/PropositionItem");
|
|
33
|
+
Object.defineProperty(exports, "PropositionItem", { enumerable: true, get: function () { return PropositionItem_1.PropositionItem; } });
|
|
24
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;;AAEF,oEAAoC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;;AAEF,oEAAoC;AAsBlC,oBAtBK,mBAAS,CAsBL;AArBX,sDAAoE;AAkBlE,4FAlBO,yBAAW,OAkBP;AAfb,8DAAgF;AA2B9E,gGA3BO,iCAAe,OA2BP;AA1BjB,8DAAoF;AA4BlF,oGA5BO,qCAAmB,OA4BP;AA1BrB,uEAAuC;AAgBrC,kBAhBK,iBAAO,CAgBL;AAdT,qGAAqE;AAgBnE,iCAhBK,gCAAsB,CAgBL;AAfxB,wEAAqE;AAgBnE,qGAhBO,2CAAoB,OAgBP;AAdtB,0EAAuE;AAgBrE,sGAhBO,6CAAqB,OAgBP;AAfvB,8DAAgF;AAgB9E,gGAhBO,iCAAe,OAgBP"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
2
|
+
import { PropositionItem, PropositionItemData } from './PropositionItem';
|
|
2
3
|
type ContentCardTemplate = 'SmallImage';
|
|
3
4
|
type DismissButtonStyle = 'circle' | 'none' | 'simple';
|
|
4
|
-
export interface
|
|
5
|
+
export interface ContentCardData extends PropositionItemData {
|
|
5
6
|
id: string;
|
|
6
7
|
data: {
|
|
7
8
|
contentType: 'application/json';
|
|
@@ -43,4 +44,8 @@ export interface ContentCard {
|
|
|
43
44
|
};
|
|
44
45
|
schema: PersonalizationSchema.CONTENT_CARD;
|
|
45
46
|
}
|
|
47
|
+
export declare class ContentCard extends PropositionItem {
|
|
48
|
+
data: ContentCardData['data'];
|
|
49
|
+
constructor(contentCardData: ContentCardData);
|
|
50
|
+
}
|
|
46
51
|
export {};
|
|
@@ -11,4 +11,13 @@
|
|
|
11
11
|
language governing permissions and limitations under the License.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ContentCard = void 0;
|
|
15
|
+
const PropositionItem_1 = require("./PropositionItem");
|
|
16
|
+
class ContentCard extends PropositionItem_1.PropositionItem {
|
|
17
|
+
constructor(contentCardData) {
|
|
18
|
+
super(contentCardData);
|
|
19
|
+
this.data = contentCardData.data;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ContentCard = ContentCard;
|
|
14
23
|
//# sourceMappingURL=ContentCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentCard.js","sourceRoot":"","sources":["../../src/models/ContentCard.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
1
|
+
{"version":3,"file":"ContentCard.js","sourceRoot":"","sources":["../../src/models/ContentCard.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAGF,uDAAyE;AAoCzE,MAAa,WAAY,SAAQ,iCAAe;IAG9C,YAAY,eAAgC;QAC1C,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IACnC,CAAC;CAEF;AARD,kCAQC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { PropositionItem, PropositionItemData } from './PropositionItem';
|
|
3
|
+
export interface HTMLPropositionData extends PropositionItemData {
|
|
4
4
|
data: {
|
|
5
5
|
content: string;
|
|
6
6
|
};
|
|
7
7
|
schema: PersonalizationSchema.HTML_CONTENT;
|
|
8
8
|
}
|
|
9
|
+
export declare class HTMLProposition extends PropositionItem {
|
|
10
|
+
data: HTMLPropositionData['data'];
|
|
11
|
+
constructor(htmlData: HTMLPropositionData);
|
|
12
|
+
}
|
|
@@ -11,4 +11,13 @@
|
|
|
11
11
|
language governing permissions and limitations under the License.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.HTMLProposition = void 0;
|
|
15
|
+
const PropositionItem_1 = require("./PropositionItem");
|
|
16
|
+
class HTMLProposition extends PropositionItem_1.PropositionItem {
|
|
17
|
+
constructor(htmlData) {
|
|
18
|
+
super(htmlData);
|
|
19
|
+
this.data = htmlData.data;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.HTMLProposition = HTMLProposition;
|
|
14
23
|
//# sourceMappingURL=HTMLProposition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTMLProposition.js","sourceRoot":"","sources":["../../src/models/HTMLProposition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
1
|
+
{"version":3,"file":"HTMLProposition.js","sourceRoot":"","sources":["../../src/models/HTMLProposition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAGF,uDAAyE;AASzE,MAAa,eAAgB,SAAQ,iCAAe;IAGnD,YAAY,QAA6B;QACxC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC3B,CAAC;CACD;AAPD,0CAOC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
2
|
+
import { PropositionItem, PropositionItemData } from './PropositionItem';
|
|
3
|
+
export interface JSONPropositionData extends PropositionItemData {
|
|
4
|
+
data: {
|
|
5
|
+
content: any;
|
|
6
|
+
};
|
|
7
|
+
schema: PersonalizationSchema.JSON_CONTENT;
|
|
8
|
+
}
|
|
9
|
+
export declare class JSONPropositionItem extends PropositionItem {
|
|
10
|
+
data: JSONPropositionData['data'];
|
|
11
|
+
constructor(jsonData: JSONPropositionData);
|
|
12
|
+
}
|