@adobe/react-native-aepmessaging 6.0.3 → 6.0.4
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/RCTAEPMessaging.podspec +2 -22
- package/README.md +51 -46
- package/dist/Messaging.js +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/models/ContentCard.d.ts +46 -0
- package/dist/models/ContentCard.js +14 -0
- package/dist/models/ContentCard.js.map +1 -0
- package/dist/models/HTMLProposition.d.ts +8 -0
- package/dist/models/HTMLProposition.js +14 -0
- package/dist/models/HTMLProposition.js.map +1 -0
- package/dist/models/InAppMessage.d.ts +15 -0
- package/dist/models/InAppMessage.js +14 -0
- package/dist/models/InAppMessage.js.map +1 -0
- package/dist/models/JSONPropositionItem.d.ts +8 -0
- package/dist/models/JSONPropositionItem.js +14 -0
- package/dist/models/JSONPropositionItem.js.map +1 -0
- package/dist/models/Message.js.map +1 -1
- package/dist/models/MessagingEdgeEventType.js +0 -1
- package/dist/models/MessagingEdgeEventType.js.map +1 -1
- package/dist/models/MessagingProposition.d.ts +5 -5
- package/dist/models/MessagingProposition.js +2 -12
- package/dist/models/MessagingProposition.js.map +1 -1
- package/dist/models/MessagingPropositionItem.d.ts +5 -8
- package/dist/models/PersonalizationSchema.d.ts +9 -0
- package/dist/models/PersonalizationSchema.js +25 -0
- package/dist/models/PersonalizationSchema.js.map +1 -0
- package/dist/models/ScopeDetails.d.ts +13 -0
- package/dist/models/ScopeDetails.js +14 -0
- package/dist/models/ScopeDetails.js.map +1 -0
- package/ios/src/RCTAEPMessaging.swift +7 -3
- package/ios/src/RCTAEPMessagingDataBridge.swift +3 -20
- package/package.json +2 -2
- package/src/Messaging.ts +1 -1
- package/src/index.ts +14 -1
- package/src/models/ContentCard.ts +47 -0
- package/src/models/HTMLProposition.ts +21 -0
- package/src/models/InAppMessage.ts +28 -0
- package/src/models/JSONPropositionItem.ts +21 -0
- package/src/models/Message.ts +1 -1
- package/src/models/MessagingDelegate.ts +1 -1
- package/src/models/MessagingEdgeEventType.ts +8 -8
- package/src/models/MessagingProposition.ts +8 -19
- package/src/models/MessagingPropositionItem.ts +10 -8
- package/src/models/PersonalizationSchema.ts +21 -0
- package/src/models/ScopeDetails.ts +27 -0
package/RCTAEPMessaging.podspec
CHANGED
|
@@ -15,26 +15,6 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
|
|
18
|
-
s.dependency "
|
|
19
|
-
|
|
20
|
-
if respond_to?(:install_modules_dependencies, true)
|
|
21
|
-
install_modules_dependencies(s)
|
|
22
|
-
else
|
|
23
|
-
s.dependency "React-Core"
|
|
24
|
-
|
|
25
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
26
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
27
|
-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
28
|
-
s.pod_target_xcconfig = {
|
|
29
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
30
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
31
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
32
|
-
}
|
|
33
|
-
s.dependency "React-Codegen"
|
|
34
|
-
s.dependency "RCT-Folly"
|
|
35
|
-
s.dependency "RCTRequired"
|
|
36
|
-
s.dependency "RCTTypeSafety"
|
|
37
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
38
|
-
end
|
|
39
|
-
end
|
|
18
|
+
s.dependency "React"
|
|
19
|
+
s.dependency "AEPMessaging", ">= 5.3.0", "< 6.0.0"
|
|
40
20
|
end
|
package/README.md
CHANGED
|
@@ -114,8 +114,8 @@ import {
|
|
|
114
114
|
Messaging,
|
|
115
115
|
MessagingDelegate,
|
|
116
116
|
MessagingEdgeEventType,
|
|
117
|
-
Message
|
|
118
|
-
} from
|
|
117
|
+
Message
|
|
118
|
+
} from '@adobe/react-native-aepmessaging';
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
## API reference
|
|
@@ -134,7 +134,7 @@ extensionVersion(): Promise<string>
|
|
|
134
134
|
|
|
135
135
|
```javascript
|
|
136
136
|
Messaging.extensionVersion().then((version) =>
|
|
137
|
-
console.log(
|
|
137
|
+
console.log('AdobeExperienceSDK: Messaging version: ' + version)
|
|
138
138
|
);
|
|
139
139
|
```
|
|
140
140
|
|
|
@@ -153,11 +153,11 @@ Handling push notifications must be done in native (Android/iOS) code for the Re
|
|
|
153
153
|
|
|
154
154
|
The AEPMessaging extension's push messaging APIs must be called from the native Android/iOS project of React Native app.
|
|
155
155
|
|
|
156
|
-
###### [iOS API usage](https://github.com/adobe/aepsdk-messaging-ios/blob/main/Documentation/sources/usage.md)
|
|
156
|
+
###### [iOS API usage](https://github.com/adobe/aepsdk-messaging-ios/blob/main/Documentation/sources/push-messaging/developer-documentation/api-usage.md)
|
|
157
157
|
|
|
158
158
|
##### [Android API usage](https://github.com/adobe/aepsdk-messaging-android/blob/main/Documentation/sources/api-usage.md)
|
|
159
159
|
|
|
160
|
-
In Android, [MessagingPushPayload](https://github.com/adobe/aepsdk-messaging-android/blob/main/Documentation/sources/
|
|
160
|
+
In Android, [MessagingPushPayload](https://github.com/adobe/aepsdk-messaging-android/blob/main/Documentation/sources/push-notification/manual-handling-and-tracking.md) can be used for getting the notification attributes like title, body, and action. These are useful for push notification creation.
|
|
161
161
|
|
|
162
162
|
## In-app messages API reference
|
|
163
163
|
|
|
@@ -168,13 +168,13 @@ Initiates a network call to retrieve remote in-app message definitions.
|
|
|
168
168
|
**Syntax**
|
|
169
169
|
|
|
170
170
|
```javascript
|
|
171
|
-
refreshInAppMessages()
|
|
171
|
+
refreshInAppMessages();
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
**Example**
|
|
175
175
|
|
|
176
176
|
```javascript
|
|
177
|
-
Messaging.refreshInAppMessages()
|
|
177
|
+
Messaging.refreshInAppMessages();
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
### setMessagingDelegate
|
|
@@ -205,24 +205,20 @@ const messagingDelegate = {
|
|
|
205
205
|
|
|
206
206
|
urlLoaded(url: string, message: Message) {
|
|
207
207
|
// Action after message loads an URL
|
|
208
|
-
}
|
|
208
|
+
}
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
Messaging.setMessagingDelegate(messagingDelegate)
|
|
211
|
+
Messaging.setMessagingDelegate(messagingDelegate);
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
|
|
216
214
|
**Example**
|
|
217
215
|
|
|
218
216
|
```javascript
|
|
219
217
|
const messagingDelegate = {
|
|
220
|
-
|
|
221
218
|
shouldShowMessage(message: Message) {
|
|
222
|
-
Messaging.saveMessage(message)
|
|
219
|
+
Messaging.saveMessage(message);
|
|
223
220
|
return false;
|
|
224
|
-
}
|
|
225
|
-
|
|
221
|
+
}
|
|
226
222
|
};
|
|
227
223
|
```
|
|
228
224
|
|
|
@@ -239,12 +235,13 @@ updatePropositionsForSurfaces(surfaces: string[])
|
|
|
239
235
|
**Example**
|
|
240
236
|
|
|
241
237
|
```javascript
|
|
242
|
-
Messaging.updatePropositionsForSurfaces([
|
|
238
|
+
Messaging.updatePropositionsForSurfaces(['mobileapp://my-surface']);
|
|
243
239
|
```
|
|
244
240
|
|
|
245
241
|
### getPropositionsForSurfaces
|
|
246
242
|
|
|
247
|
-
Retrieves the previously fetched (and cached) feeds content from the SDK for the provided surfaces. If the feeds content for one or more surfaces isn't previously cached in the SDK, it will not be retrieved from Adobe Journey Optimizer via the Experience Edge network.
|
|
243
|
+
Retrieves the previously fetched (and cached) feeds content from the SDK for the provided surfaces. If the feeds content for one or more surfaces isn't previously cached in the SDK, it will not be retrieved from Adobe Journey Optimizer via the Experience Edge network. This can be used in order to retrieve code based experiences, content
|
|
244
|
+
cards and other proposition types.
|
|
248
245
|
|
|
249
246
|
**Syntax**
|
|
250
247
|
|
|
@@ -255,8 +252,19 @@ getPropositionsForSurfaces(surfaces: string[])
|
|
|
255
252
|
**Example**
|
|
256
253
|
|
|
257
254
|
```javascript
|
|
258
|
-
const propositions = Messaging.getPropositionsForSurfaces([
|
|
259
|
-
console.log(propositions)
|
|
255
|
+
const propositions = Messaging.getPropositionsForSurfaces(['my-surface']);
|
|
256
|
+
console.log(propositions);
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Once propositions have been retrieved, their items will be typed to allow you to easily figure out what type they are using their schema property
|
|
260
|
+
|
|
261
|
+
```javascript
|
|
262
|
+
for (let item in proposition.items) {
|
|
263
|
+
if (item.schema === PersonalizationSchema.CONTENT_CARD) {
|
|
264
|
+
// Proposition Item is a content card, and will be fully typed
|
|
265
|
+
console.log(item.data.content);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
260
268
|
```
|
|
261
269
|
|
|
262
270
|
### getLatestMessage
|
|
@@ -266,14 +274,14 @@ Retrieves the most recently displayed message object
|
|
|
266
274
|
**Syntax**
|
|
267
275
|
|
|
268
276
|
```javascript
|
|
269
|
-
Messaging.getLatestMessage()
|
|
277
|
+
Messaging.getLatestMessage();
|
|
270
278
|
```
|
|
271
279
|
|
|
272
280
|
**Example**
|
|
273
281
|
|
|
274
282
|
```javascript
|
|
275
|
-
const message = Messaging.getLatestMessage()
|
|
276
|
-
console.log(message.id)
|
|
283
|
+
const message = Messaging.getLatestMessage();
|
|
284
|
+
console.log(message.id);
|
|
277
285
|
```
|
|
278
286
|
|
|
279
287
|
### getCachedMessages
|
|
@@ -283,14 +291,14 @@ Retrieves a list of all messages that have been cached in-memory
|
|
|
283
291
|
**Syntax**
|
|
284
292
|
|
|
285
293
|
```javascript
|
|
286
|
-
Messaging.getCachedMessages()
|
|
294
|
+
Messaging.getCachedMessages();
|
|
287
295
|
```
|
|
288
296
|
|
|
289
297
|
**Example**
|
|
290
298
|
|
|
291
299
|
```javascript
|
|
292
|
-
const messages = Messaging.getCachedMessages()
|
|
293
|
-
messages.forEach(message => message.clear())
|
|
300
|
+
const messages = Messaging.getCachedMessages();
|
|
301
|
+
messages.forEach((message) => message.clear());
|
|
294
302
|
```
|
|
295
303
|
|
|
296
304
|
### setMessageSettings
|
|
@@ -306,10 +314,9 @@ Messaging.setMessageSettings(shouldShowMessage: boolean, shouldSaveMessage: bool
|
|
|
306
314
|
**Example**
|
|
307
315
|
|
|
308
316
|
```javascript
|
|
309
|
-
Messaging.setMessageSettings(true, false)
|
|
317
|
+
Messaging.setMessageSettings(true, false);
|
|
310
318
|
```
|
|
311
319
|
|
|
312
|
-
|
|
313
320
|
## Handling In App Messages using Message Object
|
|
314
321
|
|
|
315
322
|
The `Message` object passed to the `MessagingDelegate` contains the following functions to handle a message:
|
|
@@ -321,14 +328,14 @@ Signals to the `UIService` that the message should be shown.
|
|
|
321
328
|
**Syntax**
|
|
322
329
|
|
|
323
330
|
```javascript
|
|
324
|
-
show()
|
|
331
|
+
show();
|
|
325
332
|
```
|
|
326
333
|
|
|
327
334
|
**Example**
|
|
328
335
|
|
|
329
336
|
```javascript
|
|
330
|
-
var message: Message
|
|
331
|
-
message.show()
|
|
337
|
+
var message: Message;
|
|
338
|
+
message.show();
|
|
332
339
|
```
|
|
333
340
|
|
|
334
341
|
### dismiss
|
|
@@ -344,8 +351,8 @@ dismiss(((suppressAutoTrack: ?boolean) = false))
|
|
|
344
351
|
**Example**
|
|
345
352
|
|
|
346
353
|
```javascript
|
|
347
|
-
var message: Message
|
|
348
|
-
message.dismiss(true)
|
|
354
|
+
var message: Message;
|
|
355
|
+
message.dismiss(true);
|
|
349
356
|
```
|
|
350
357
|
|
|
351
358
|
### track
|
|
@@ -362,7 +369,7 @@ track(interaction: ?string, eventType: MessagingEdgeEventType)
|
|
|
362
369
|
|
|
363
370
|
```javascript
|
|
364
371
|
var message: Message;
|
|
365
|
-
message.track(
|
|
372
|
+
message.track('sample text', MessagingEdgeEventType.IN_APP_DISMISS);
|
|
366
373
|
```
|
|
367
374
|
|
|
368
375
|
### handleJavascriptMessage
|
|
@@ -379,7 +386,7 @@ handleJavascriptMessage(name: string) : Promise<?any>
|
|
|
379
386
|
|
|
380
387
|
```javascript
|
|
381
388
|
var message: Message;
|
|
382
|
-
message.handleJavascriptMessage(
|
|
389
|
+
message.handleJavascriptMessage('test').then((data) => {});
|
|
383
390
|
```
|
|
384
391
|
|
|
385
392
|
### setAutoTrack
|
|
@@ -396,7 +403,7 @@ setAutoTrack(autoTrack: boolean)
|
|
|
396
403
|
|
|
397
404
|
```javascript
|
|
398
405
|
var message: Message;
|
|
399
|
-
message.setAutoTrack(true)
|
|
406
|
+
message.setAutoTrack(true);
|
|
400
407
|
```
|
|
401
408
|
|
|
402
409
|
### clear
|
|
@@ -406,14 +413,14 @@ Clears the reference to the in-memory cached `Message` object. This function mus
|
|
|
406
413
|
**Syntax**
|
|
407
414
|
|
|
408
415
|
```javascript
|
|
409
|
-
clear()
|
|
416
|
+
clear();
|
|
410
417
|
```
|
|
411
418
|
|
|
412
419
|
**Example**
|
|
413
420
|
|
|
414
421
|
```javascript
|
|
415
|
-
var message: Message
|
|
416
|
-
message.clear()
|
|
422
|
+
var message: Message;
|
|
423
|
+
message.clear();
|
|
417
424
|
```
|
|
418
425
|
|
|
419
426
|
## Programmatically control the display of in-app messages
|
|
@@ -432,7 +439,7 @@ type MessagingDelegate = {
|
|
|
432
439
|
|
|
433
440
|
urlLoaded(url: string, message: Message): void, // iOS Only
|
|
434
441
|
|
|
435
|
-
onContentLoaded(message: Message): void
|
|
442
|
+
onContentLoaded(message: Message): void // Android Only
|
|
436
443
|
};
|
|
437
444
|
```
|
|
438
445
|
|
|
@@ -458,9 +465,8 @@ const messagingDelegate = {
|
|
|
458
465
|
|
|
459
466
|
onContentLoaded(message: Message) {
|
|
460
467
|
// Action after message loads content
|
|
461
|
-
}
|
|
468
|
+
}
|
|
462
469
|
};
|
|
463
|
-
|
|
464
470
|
```
|
|
465
471
|
|
|
466
472
|
### Controlling when the message should be shown to the end user.
|
|
@@ -471,7 +477,7 @@ Below is an example of when the developer may choose to suppress an in-app messa
|
|
|
471
477
|
|
|
472
478
|
```javascript
|
|
473
479
|
function shouldShowMessage(message: Message): boolean {
|
|
474
|
-
if (someOtherWorkflowStatus ==
|
|
480
|
+
if (someOtherWorkflowStatus == 'inProgress') {
|
|
475
481
|
return false;
|
|
476
482
|
}
|
|
477
483
|
|
|
@@ -486,12 +492,12 @@ Continuing with the above example, the developer has stored the message that was
|
|
|
486
492
|
var cachedMessage: Message;
|
|
487
493
|
|
|
488
494
|
function otherWorkflowFinished() {
|
|
489
|
-
anotherWorkflowStatus =
|
|
495
|
+
anotherWorkflowStatus = 'complete';
|
|
490
496
|
cachedMessage.show();
|
|
491
497
|
}
|
|
492
498
|
|
|
493
499
|
function shouldShowMessage(message: Message): boolean {
|
|
494
|
-
if (anotherWorkflowStatus ===
|
|
500
|
+
if (anotherWorkflowStatus === 'inProgress') {
|
|
495
501
|
// store the current message for later use
|
|
496
502
|
Messaging.saveMessage(message);
|
|
497
503
|
cachedMessage = message;
|
|
@@ -506,9 +512,8 @@ function shouldShowMessage(message: Message): boolean {
|
|
|
506
512
|
|
|
507
513
|
```javascript
|
|
508
514
|
function otherWorkflowFinished() {
|
|
509
|
-
anotherWorkflowStatus =
|
|
515
|
+
anotherWorkflowStatus = 'complete';
|
|
510
516
|
currentMessage.show();
|
|
511
517
|
currentMessage.clearMessage();
|
|
512
518
|
}
|
|
513
519
|
```
|
|
514
|
-
|
package/dist/Messaging.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
4
4
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
6
6
|
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import Messaging from './Messaging';
|
|
2
|
+
import { ContentCard } from './models/ContentCard';
|
|
3
|
+
import { HTMLProposition } from './models/HTMLProposition';
|
|
4
|
+
import { InAppMessage } from './models/InAppMessage';
|
|
5
|
+
import { JSONPropositionItem } from './models/JSONPropositionItem';
|
|
2
6
|
import Message from './models/Message';
|
|
3
7
|
import { MessagingDelegate } from './models/MessagingDelegate';
|
|
4
8
|
import MessagingEdgeEventType from './models/MessagingEdgeEventType';
|
|
5
9
|
import { MessagingProposition } from './models/MessagingProposition';
|
|
6
10
|
import { MessagingPropositionItem } from './models/MessagingPropositionItem';
|
|
7
|
-
|
|
11
|
+
import { PersonalizationSchema } from './models/PersonalizationSchema';
|
|
12
|
+
import { Activity, Characteristics } from './models/ScopeDetails';
|
|
13
|
+
export { Activity, Characteristics, ContentCard, HTMLProposition, InAppMessage, JSONPropositionItem, Messaging, Message, MessagingDelegate, MessagingEdgeEventType, MessagingProposition, MessagingPropositionItem, PersonalizationSchema, };
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ 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.
|
|
14
|
+
exports.PersonalizationSchema = exports.MessagingEdgeEventType = exports.Message = exports.Messaging = 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;
|
|
@@ -19,6 +19,6 @@ const Message_1 = tslib_1.__importDefault(require("./models/Message"));
|
|
|
19
19
|
exports.Message = Message_1.default;
|
|
20
20
|
const MessagingEdgeEventType_1 = tslib_1.__importDefault(require("./models/MessagingEdgeEventType"));
|
|
21
21
|
exports.MessagingEdgeEventType = MessagingEdgeEventType_1.default;
|
|
22
|
-
const
|
|
23
|
-
Object.defineProperty(exports, "
|
|
22
|
+
const PersonalizationSchema_1 = require("./models/PersonalizationSchema");
|
|
23
|
+
Object.defineProperty(exports, "PersonalizationSchema", { enumerable: true, get: function () { return PersonalizationSchema_1.PersonalizationSchema; } });
|
|
24
24
|
//# 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;AAoBlC,oBApBK,mBAAS,CAoBL;AAfX,uEAAuC;AAgBrC,kBAhBK,iBAAO,CAgBL;AAdT,qGAAqE;AAgBnE,iCAhBK,gCAAsB,CAgBL;AAbxB,0EAAuE;AAgBrE,sGAhBO,6CAAqB,OAgBP"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
2
|
+
type ContentCardTemplate = 'SmallImage';
|
|
3
|
+
type DismissButtonStyle = 'circle' | 'none' | 'simple';
|
|
4
|
+
export interface ContentCard {
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
contentType: 'application/json';
|
|
8
|
+
expiryDate: number;
|
|
9
|
+
publishedDate: number;
|
|
10
|
+
content: {
|
|
11
|
+
actionUrl: string;
|
|
12
|
+
body: {
|
|
13
|
+
content: string;
|
|
14
|
+
};
|
|
15
|
+
title: {
|
|
16
|
+
content: string;
|
|
17
|
+
};
|
|
18
|
+
buttons: Array<{
|
|
19
|
+
actionUrl: string;
|
|
20
|
+
id: string;
|
|
21
|
+
text: {
|
|
22
|
+
content: string;
|
|
23
|
+
};
|
|
24
|
+
interactId: string;
|
|
25
|
+
}>;
|
|
26
|
+
image: {
|
|
27
|
+
alt: string;
|
|
28
|
+
url: string;
|
|
29
|
+
};
|
|
30
|
+
dismissBtn: {
|
|
31
|
+
style: DismissButtonStyle;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
meta: {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
adobe: {
|
|
37
|
+
template: ContentCardTemplate;
|
|
38
|
+
};
|
|
39
|
+
dismissState: boolean;
|
|
40
|
+
readState: boolean;
|
|
41
|
+
surface: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
schema: PersonalizationSchema.CONTENT_CARD;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
4
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
5
|
+
"License"); you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
8
|
+
or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
10
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
11
|
+
language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
//# sourceMappingURL=ContentCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentCard.js","sourceRoot":"","sources":["../../src/models/ContentCard.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
4
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
5
|
+
"License"); you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
8
|
+
or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
10
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
11
|
+
language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
//# sourceMappingURL=HTMLProposition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HTMLProposition.js","sourceRoot":"","sources":["../../src/models/HTMLProposition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
2
|
+
export interface InAppMessage {
|
|
3
|
+
id: string;
|
|
4
|
+
schema: PersonalizationSchema.IN_APP;
|
|
5
|
+
data: {
|
|
6
|
+
content: string;
|
|
7
|
+
contentType: 'text/html';
|
|
8
|
+
expiryDate: number;
|
|
9
|
+
publishedDate: number;
|
|
10
|
+
meta?: Record<string, any>;
|
|
11
|
+
mobileParameters?: Record<string, any>;
|
|
12
|
+
webParameters?: Record<string, any>;
|
|
13
|
+
remoteAssets?: string[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
4
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
5
|
+
"License"); you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
8
|
+
or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
10
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
11
|
+
language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
//# sourceMappingURL=InAppMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InAppMessage.js","sourceRoot":"","sources":["../../src/models/InAppMessage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
4
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
5
|
+
"License"); you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
8
|
+
or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
10
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
11
|
+
language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
//# sourceMappingURL=JSONPropositionItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSONPropositionItem.js","sourceRoot":"","sources":["../../src/models/JSONPropositionItem.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;AAEF,+CAA6C;AAC7C,MAAM,eAAe,GAAG,4BAAa,CAAC,YAAY,CAAC;AAEnD,MAAM,OAAO;IAIX,YAAY,
|
|
1
|
+
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;AAEF,+CAA6C;AAC7C,MAAM,eAAe,GAAG,4BAAa,CAAC,YAAY,CAAC;AAEnD,MAAM,OAAO;IAIX,YAAY,EAAE,EAAE,EAAE,SAAS,GAAG,KAAK,EAAsC;QACvE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,SAAkB;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACH,IAAI;QACF,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,iBAA2B;QACjC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAmB,EAAE,SAAiB;QAC1C,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;CACF;AAED,kBAAe,OAAO,CAAC"}
|
|
@@ -20,6 +20,5 @@ var MessagingEdgeEventType;
|
|
|
20
20
|
MessagingEdgeEventType[MessagingEdgeEventType["PUSH_APPLICATION_OPENED"] = 4] = "PUSH_APPLICATION_OPENED";
|
|
21
21
|
MessagingEdgeEventType[MessagingEdgeEventType["PUSH_CUSTOM_ACTION"] = 5] = "PUSH_CUSTOM_ACTION";
|
|
22
22
|
})(MessagingEdgeEventType || (MessagingEdgeEventType = {}));
|
|
23
|
-
;
|
|
24
23
|
exports.default = MessagingEdgeEventType;
|
|
25
24
|
//# sourceMappingURL=MessagingEdgeEventType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagingEdgeEventType.js","sourceRoot":"","sources":["../../src/models/MessagingEdgeEventType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;AAEF,IAAK,sBAOJ;AAPD,WAAK,sBAAsB;
|
|
1
|
+
{"version":3,"file":"MessagingEdgeEventType.js","sourceRoot":"","sources":["../../src/models/MessagingEdgeEventType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;AAEF,IAAK,sBAOJ;AAPD,WAAK,sBAAsB;IACzB,yEAAW,CAAA;IACX,2EAAY,CAAA;IACZ,yEAAW,CAAA;IACX,yEAAW,CAAA;IACX,yGAA2B,CAAA;IAC3B,+FAAsB,CAAA;AACxB,CAAC,EAPI,sBAAsB,KAAtB,sBAAsB,QAO1B;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MessagingPropositionItem } from './MessagingPropositionItem';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ScopeDetails } from './ScopeDetails';
|
|
3
|
+
export interface MessagingProposition {
|
|
4
|
+
id: string;
|
|
5
5
|
scope: string;
|
|
6
|
-
scopeDetails:
|
|
7
|
-
|
|
6
|
+
scopeDetails: ScopeDetails;
|
|
7
|
+
items: MessagingPropositionItem[];
|
|
8
8
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessagingProposition = void 0;
|
|
4
2
|
/*
|
|
5
|
-
Copyright
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
6
4
|
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
7
5
|
"License"); you may not use this file except in compliance with the License.
|
|
8
6
|
You may obtain a copy of the License at
|
|
@@ -12,13 +10,5 @@ exports.MessagingProposition = void 0;
|
|
|
12
10
|
ANY KIND, either express or implied. See the License for the specific
|
|
13
11
|
language governing permissions and limitations under the License.
|
|
14
12
|
*/
|
|
15
|
-
|
|
16
|
-
constructor(uniqueId, scope, scopeDetails, items) {
|
|
17
|
-
this.uniqueId = uniqueId;
|
|
18
|
-
this.scope = scope;
|
|
19
|
-
this.scopeDetails = scopeDetails;
|
|
20
|
-
this.items = items;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.MessagingProposition = MessagingProposition;
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
14
|
//# sourceMappingURL=MessagingProposition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessagingProposition.js","sourceRoot":"","sources":["../../src/models/MessagingProposition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessagingProposition.js","sourceRoot":"","sources":["../../src/models/MessagingProposition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
schema: string;
|
|
7
|
-
uniqueId: string;
|
|
8
|
-
}
|
|
1
|
+
import { ContentCard } from './ContentCard';
|
|
2
|
+
import { HTMLProposition } from './HTMLProposition';
|
|
3
|
+
import { JSONPropositionItem } from './JSONPropositionItem';
|
|
4
|
+
import { InAppMessage } from './InAppMessage';
|
|
5
|
+
export type MessagingPropositionItem = ContentCard | HTMLProposition | InAppMessage | JSONPropositionItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum PersonalizationSchema {
|
|
2
|
+
CONTENT_CARD = "https://ns.adobe.com/personalization/message/content-card",
|
|
3
|
+
DEFAULT_CONTENT = "https://ns.adobe.com/personalization/default-content-item",
|
|
4
|
+
HTML_CONTENT = "https://ns.adobe.com/personalization/html-content-item",
|
|
5
|
+
IN_APP = "https://ns.adobe.com/personalization/message/in-app",
|
|
6
|
+
JSON_CONTENT = "https://ns.adobe.com/personalization/json-content-item",
|
|
7
|
+
NATIVE_ALERT = "https://ns.adobe.com/personalization/message/native-alert",
|
|
8
|
+
RULESET_ITEM = "https://ns.adobe.com/personalization/ruleset-item"
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
4
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
5
|
+
"License"); you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
8
|
+
or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
10
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
11
|
+
language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.PersonalizationSchema = void 0;
|
|
15
|
+
var PersonalizationSchema;
|
|
16
|
+
(function (PersonalizationSchema) {
|
|
17
|
+
PersonalizationSchema["CONTENT_CARD"] = "https://ns.adobe.com/personalization/message/content-card";
|
|
18
|
+
PersonalizationSchema["DEFAULT_CONTENT"] = "https://ns.adobe.com/personalization/default-content-item";
|
|
19
|
+
PersonalizationSchema["HTML_CONTENT"] = "https://ns.adobe.com/personalization/html-content-item";
|
|
20
|
+
PersonalizationSchema["IN_APP"] = "https://ns.adobe.com/personalization/message/in-app";
|
|
21
|
+
PersonalizationSchema["JSON_CONTENT"] = "https://ns.adobe.com/personalization/json-content-item";
|
|
22
|
+
PersonalizationSchema["NATIVE_ALERT"] = "https://ns.adobe.com/personalization/message/native-alert";
|
|
23
|
+
PersonalizationSchema["RULESET_ITEM"] = "https://ns.adobe.com/personalization/ruleset-item";
|
|
24
|
+
})(PersonalizationSchema = exports.PersonalizationSchema || (exports.PersonalizationSchema = {}));
|
|
25
|
+
//# sourceMappingURL=PersonalizationSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersonalizationSchema.js","sourceRoot":"","sources":["../../src/models/PersonalizationSchema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAEF,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,mGAA0E,CAAA;IAC1E,sGAA6E,CAAA;IAC7E,gGAAuE,CAAA;IACvE,uFAA8D,CAAA;IAC9D,gGAAuE,CAAA;IACvE,mGAA0E,CAAA;IAC1E,2FAAkE,CAAA;AACpE,CAAC,EARW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAQhC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Activity {
|
|
2
|
+
matchedSurfaces: string[];
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Characteristics {
|
|
6
|
+
eventToken: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ScopeDetails {
|
|
9
|
+
activity: Activity;
|
|
10
|
+
characteristics: Characteristics;
|
|
11
|
+
correlationID: string;
|
|
12
|
+
decisionProvider: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
4
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
5
|
+
"License"); you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
8
|
+
or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
10
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
11
|
+
language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
//# sourceMappingURL=ScopeDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeDetails.js","sourceRoot":"","sources":["../../src/models/ScopeDetails.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"}
|
|
@@ -71,13 +71,17 @@ public class RCTAEPMessaging: RCTEventEmitter, MessagingDelegate {
|
|
|
71
71
|
withResolver resolve: @escaping RCTPromiseResolveBlock,
|
|
72
72
|
withRejecter reject: @escaping RCTPromiseRejectBlock
|
|
73
73
|
) {
|
|
74
|
-
let surfacePaths = surfaces.map { Surface(path: $0) }
|
|
75
|
-
Messaging.getPropositionsForSurfaces(surfacePaths) {
|
|
74
|
+
let surfacePaths = surfaces.map { $0.isEmpty ? Surface() : Surface(path: $0) }
|
|
75
|
+
Messaging.getPropositionsForSurfaces(surfacePaths) { propositions, error in
|
|
76
76
|
guard error == nil else {
|
|
77
77
|
reject("Unable to Retrieve Propositions", nil, nil)
|
|
78
78
|
return
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
if (propositions != nil && propositions!.isEmpty) {
|
|
81
|
+
resolve([String: Any]());
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
resolve(RCTAEPMessagingDataBridge.transformPropositionDict(dict: propositions!))
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
|
|
@@ -15,33 +15,16 @@ import AEPMessaging
|
|
|
15
15
|
public class RCTAEPMessagingDataBridge: NSObject {
|
|
16
16
|
static func transformToMessage(message: Message) -> [String: Any] {
|
|
17
17
|
return [
|
|
18
|
-
"id": message.id, "autoTrack": message.autoTrack
|
|
18
|
+
"id": message.id, "autoTrack": message.autoTrack
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
static func transformPropositionDict(dict: [Surface: [Proposition]]) -> [String: [Any]]
|
|
22
|
+
static func transformPropositionDict(dict: [Surface: [Proposition]]) -> [String: [Any?]]
|
|
23
23
|
{
|
|
24
24
|
let bundleID = "mobileapp://" + Bundle.main.bundleIdentifier! + "/"
|
|
25
25
|
return dict.reduce(into: [:]) { result, element in
|
|
26
26
|
result[element.key.uri.replacingOccurrences(of: bundleID, with: "")] = element.value
|
|
27
|
-
.map({
|
|
27
|
+
.map({ $0.asDictionary() })
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
static func transformToProposition(proposition: Proposition) -> [String: Any?] {
|
|
32
|
-
return [
|
|
33
|
-
"scope": proposition.scope,
|
|
34
|
-
"uniqueId": proposition.uniqueId,
|
|
35
|
-
"items": proposition.items.map({ item in
|
|
36
|
-
[
|
|
37
|
-
"htmlContent": item.htmlContent,
|
|
38
|
-
"jsonContentArray": item.jsonContentArray,
|
|
39
|
-
"jsonContent": item.jsonContentDictionary,
|
|
40
|
-
"itemData": item.itemData as Any?,
|
|
41
|
-
"schema": item.schema,
|
|
42
|
-
"itemId": item.itemId
|
|
43
|
-
]
|
|
44
|
-
}),
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/react-native-aepmessaging",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "Adobe Experience Platform support for React Native apps.",
|
|
5
5
|
"homepage": "https://developer.adobe.com/client-sdks/documentation/",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"installConfig": {
|
|
40
40
|
"hoistingLimits": "dependencies"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "129d28814e8a2f46e59554ce976bd06d5b25aaea"
|
|
43
43
|
}
|
package/src/Messaging.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
3
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
package/src/index.ts
CHANGED
|
@@ -11,17 +11,30 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import Messaging from './Messaging';
|
|
14
|
+
import { ContentCard } from './models/ContentCard';
|
|
15
|
+
import { HTMLProposition } from './models/HTMLProposition';
|
|
16
|
+
import { InAppMessage } from './models/InAppMessage';
|
|
17
|
+
import { JSONPropositionItem } from './models/JSONPropositionItem';
|
|
14
18
|
import Message from './models/Message';
|
|
15
19
|
import { MessagingDelegate } from './models/MessagingDelegate';
|
|
16
20
|
import MessagingEdgeEventType from './models/MessagingEdgeEventType';
|
|
17
21
|
import { MessagingProposition } from './models/MessagingProposition';
|
|
18
22
|
import { MessagingPropositionItem } from './models/MessagingPropositionItem';
|
|
23
|
+
import { PersonalizationSchema } from './models/PersonalizationSchema';
|
|
24
|
+
import { Activity, Characteristics } from './models/ScopeDetails';
|
|
19
25
|
|
|
20
26
|
export {
|
|
27
|
+
Activity,
|
|
28
|
+
Characteristics,
|
|
29
|
+
ContentCard,
|
|
30
|
+
HTMLProposition,
|
|
31
|
+
InAppMessage,
|
|
32
|
+
JSONPropositionItem,
|
|
21
33
|
Messaging,
|
|
22
34
|
Message,
|
|
23
35
|
MessagingDelegate,
|
|
24
36
|
MessagingEdgeEventType,
|
|
25
37
|
MessagingProposition,
|
|
26
|
-
MessagingPropositionItem
|
|
38
|
+
MessagingPropositionItem,
|
|
39
|
+
PersonalizationSchema,
|
|
27
40
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 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
|
+
|
|
13
|
+
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
14
|
+
|
|
15
|
+
type ContentCardTemplate = 'SmallImage';
|
|
16
|
+
type DismissButtonStyle = 'circle' | 'none' | 'simple';
|
|
17
|
+
|
|
18
|
+
export interface ContentCard {
|
|
19
|
+
id: string;
|
|
20
|
+
data: {
|
|
21
|
+
contentType: 'application/json';
|
|
22
|
+
expiryDate: number;
|
|
23
|
+
publishedDate: number;
|
|
24
|
+
content: {
|
|
25
|
+
actionUrl: string;
|
|
26
|
+
|
|
27
|
+
body: { content: string };
|
|
28
|
+
title: { content: string };
|
|
29
|
+
buttons: Array<{
|
|
30
|
+
actionUrl: string;
|
|
31
|
+
id: string;
|
|
32
|
+
text: { content: string };
|
|
33
|
+
interactId: string;
|
|
34
|
+
}>;
|
|
35
|
+
image: { alt: string; url: string };
|
|
36
|
+
dismissBtn: { style: DismissButtonStyle };
|
|
37
|
+
};
|
|
38
|
+
meta: {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
adobe: { template: ContentCardTemplate };
|
|
41
|
+
dismissState: boolean;
|
|
42
|
+
readState: boolean;
|
|
43
|
+
surface: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
schema: PersonalizationSchema.CONTENT_CARD;
|
|
47
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 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
|
+
|
|
13
|
+
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
14
|
+
|
|
15
|
+
export interface HTMLProposition {
|
|
16
|
+
id: string;
|
|
17
|
+
data: {
|
|
18
|
+
content: string;
|
|
19
|
+
};
|
|
20
|
+
schema: PersonalizationSchema.HTML_CONTENT;
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 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
|
+
|
|
13
|
+
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
14
|
+
|
|
15
|
+
export interface InAppMessage {
|
|
16
|
+
id: string;
|
|
17
|
+
schema: PersonalizationSchema.IN_APP;
|
|
18
|
+
data: {
|
|
19
|
+
content: string;
|
|
20
|
+
contentType: 'text/html';
|
|
21
|
+
expiryDate: number;
|
|
22
|
+
publishedDate: number;
|
|
23
|
+
meta?: Record<string, any>;
|
|
24
|
+
mobileParameters?: Record<string, any>;
|
|
25
|
+
webParameters?: Record<string, any>;
|
|
26
|
+
remoteAssets?: string[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 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
|
+
|
|
13
|
+
import { PersonalizationSchema } from './PersonalizationSchema';
|
|
14
|
+
|
|
15
|
+
export interface JSONPropositionItem {
|
|
16
|
+
id: string;
|
|
17
|
+
data: {
|
|
18
|
+
content: string;
|
|
19
|
+
};
|
|
20
|
+
schema: PersonalizationSchema.JSON_CONTENT;
|
|
21
|
+
}
|
package/src/models/Message.ts
CHANGED
|
@@ -17,7 +17,7 @@ class Message {
|
|
|
17
17
|
id: string;
|
|
18
18
|
autoTrack: boolean;
|
|
19
19
|
|
|
20
|
-
constructor({id, autoTrack = false}: {id: string; autoTrack: boolean}) {
|
|
20
|
+
constructor({ id, autoTrack = false }: { id: string; autoTrack: boolean }) {
|
|
21
21
|
this.id = id;
|
|
22
22
|
this.autoTrack = autoTrack;
|
|
23
23
|
}
|
|
@@ -11,12 +11,12 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
enum MessagingEdgeEventType {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
14
|
+
DISMISS = 0,
|
|
15
|
+
INTERACT = 1,
|
|
16
|
+
TRIGGER = 2,
|
|
17
|
+
DISPLAY = 3,
|
|
18
|
+
PUSH_APPLICATION_OPENED = 4,
|
|
19
|
+
PUSH_CUSTOM_ACTION = 5
|
|
20
|
+
}
|
|
21
21
|
|
|
22
|
-
export default MessagingEdgeEventType;
|
|
22
|
+
export default MessagingEdgeEventType;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { MessagingPropositionItem } from './MessagingPropositionItem';
|
|
2
|
-
|
|
3
1
|
/*
|
|
4
|
-
Copyright
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
5
3
|
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
6
4
|
"License"); you may not use this file except in compliance with the License.
|
|
7
5
|
You may obtain a copy of the License at
|
|
@@ -12,21 +10,12 @@ import { MessagingPropositionItem } from './MessagingPropositionItem';
|
|
|
12
10
|
language governing permissions and limitations under the License.
|
|
13
11
|
*/
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
public uniqueId: string;
|
|
18
|
-
public scope: string;
|
|
19
|
-
public scopeDetails: Record<string, any>;
|
|
13
|
+
import { MessagingPropositionItem } from './MessagingPropositionItem';
|
|
14
|
+
import { ScopeDetails } from './ScopeDetails';
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
) {
|
|
27
|
-
this.uniqueId = uniqueId;
|
|
28
|
-
this.scope = scope;
|
|
29
|
-
this.scopeDetails = scopeDetails;
|
|
30
|
-
this.items = items;
|
|
31
|
-
}
|
|
16
|
+
export interface MessagingProposition {
|
|
17
|
+
id: string;
|
|
18
|
+
scope: string;
|
|
19
|
+
scopeDetails: ScopeDetails;
|
|
20
|
+
items: MessagingPropositionItem[];
|
|
32
21
|
}
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
import { ContentCard } from './ContentCard';
|
|
14
|
+
import { HTMLProposition } from './HTMLProposition';
|
|
15
|
+
import { JSONPropositionItem } from './JSONPropositionItem';
|
|
16
|
+
import { InAppMessage } from './InAppMessage';
|
|
17
|
+
|
|
18
|
+
export type MessagingPropositionItem =
|
|
19
|
+
| ContentCard
|
|
20
|
+
| HTMLProposition
|
|
21
|
+
| InAppMessage
|
|
22
|
+
| JSONPropositionItem;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 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
|
+
|
|
13
|
+
export enum PersonalizationSchema {
|
|
14
|
+
CONTENT_CARD = 'https://ns.adobe.com/personalization/message/content-card',
|
|
15
|
+
DEFAULT_CONTENT = 'https://ns.adobe.com/personalization/default-content-item',
|
|
16
|
+
HTML_CONTENT = 'https://ns.adobe.com/personalization/html-content-item',
|
|
17
|
+
IN_APP = 'https://ns.adobe.com/personalization/message/in-app',
|
|
18
|
+
JSON_CONTENT = 'https://ns.adobe.com/personalization/json-content-item',
|
|
19
|
+
NATIVE_ALERT = 'https://ns.adobe.com/personalization/message/native-alert',
|
|
20
|
+
RULESET_ITEM = 'https://ns.adobe.com/personalization/ruleset-item'
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 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
|
+
|
|
13
|
+
export interface Activity {
|
|
14
|
+
matchedSurfaces: string[];
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Characteristics {
|
|
19
|
+
eventToken: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ScopeDetails {
|
|
23
|
+
activity: Activity;
|
|
24
|
+
characteristics: Characteristics;
|
|
25
|
+
correlationID: string;
|
|
26
|
+
decisionProvider: string;
|
|
27
|
+
}
|