@selligent-marketing-cloud/selligent-react-native 3.5.0 → 3.5.1
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 +6 -6
- package/RNSelligentMapper.podspec +1 -1
- package/android/build.gradle +3 -3
- package/documentation/README.md +31 -32
- package/helpers.js +1 -1
- package/index.ios.js +1 -1
- package/index.js +10 -21
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Marigold Engage-ReactNative (selligent-react-native)
|
|
2
2
|
|
|
3
|
-
This module provides an API for the usage of the
|
|
3
|
+
This module provides an API for the usage of the Marigold Engage Mobile SDKs in React Native.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Marigold Engage-ReactNative Integration
|
|
6
6
|
|
|
7
7
|
This module supports the following SDK and tools:
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ This module supports the following SDK and tools:
|
|
|
11
11
|
| SDK | Version |
|
|
12
12
|
| ------------------------------------------------------------------------------ | ------- |
|
|
13
13
|
| [Android SDK](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 4.4.0 |
|
|
14
|
-
| [iOS SDK](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 3.8.
|
|
14
|
+
| [iOS SDK](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 3.8.1 |
|
|
15
15
|
| ReactNative | 0.72.4 |
|
|
16
16
|
| Expo SDK | 49 |
|
|
17
17
|
|
|
@@ -174,7 +174,7 @@ This module supports the following SDK and tools:
|
|
|
174
174
|
|
|
175
175
|
> Do not check the "copy if needed" option to make sure you only have to manage one selligent.json file
|
|
176
176
|
|
|
177
|
-
3. Add the native iOS SDK dependency in your Podfile: `s.dependency "SelligentMobileSDK/Framework", "3.8.
|
|
177
|
+
3. Add the native iOS SDK dependency in your Podfile: `s.dependency "SelligentMobileSDK/Framework", "3.8.1"` or download it manually from [here](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/master/Framework) and drag and drop it into you **Xcode project**.
|
|
178
178
|
|
|
179
179
|
4. Add the RNSelligentMapper pod in your Podfile: `pod 'RNSelligentMapper', :path => '../node_modules/@selligent-marketing-cloud/selligent-react-native/RNSelligentMapper.podspec'`.
|
|
180
180
|
|
|
@@ -187,7 +187,7 @@ This module supports the following SDK and tools:
|
|
|
187
187
|
```objective-c
|
|
188
188
|
@import RNSelligentMobileSDK;
|
|
189
189
|
|
|
190
|
-
// You can alternatively specify a different file name (without the extension) from where to load the
|
|
190
|
+
// You can alternatively specify a different file name (without the extension) from where to load the Marigold Engage configs (defaults to 'selligent')
|
|
191
191
|
// if (!launchOptions) {
|
|
192
192
|
// launchOptions = [NSMutableDictionary new];
|
|
193
193
|
// }
|
|
@@ -7,7 +7,7 @@ Pod::Spec.new do |s|
|
|
|
7
7
|
s.authors = package['author']
|
|
8
8
|
s.version = package["version"]
|
|
9
9
|
s.summary = package["description"]
|
|
10
|
-
s.description = "React Native wrapper mapper for the
|
|
10
|
+
s.description = "React Native wrapper mapper for the Marigold Engage Android and iOS SDKs"
|
|
11
11
|
s.homepage = package['homepage']
|
|
12
12
|
s.license = "MIT"
|
|
13
13
|
s.platform = :ios, "12.0"
|
package/android/build.gradle
CHANGED
|
@@ -85,7 +85,7 @@ def loadSelligentSettings(variant) {
|
|
|
85
85
|
File flavorFile = new File("$project.rootDir/../$currentFlavor/$defaultFileName")
|
|
86
86
|
|
|
87
87
|
if (variantFile.exists()) {
|
|
88
|
-
println("Reading
|
|
88
|
+
println("Reading Marigold Engage properties for variant ${variant.getName()} from $variantFile.path")
|
|
89
89
|
resultingSettings = ""
|
|
90
90
|
|
|
91
91
|
variantFile.eachLine { String line ->
|
|
@@ -93,7 +93,7 @@ def loadSelligentSettings(variant) {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
else if (currentFlavor != "" && flavorFile.exists()) {
|
|
96
|
-
println("Reading
|
|
96
|
+
println("Reading Marigold Engage properties for flavor $currentFlavor using $flavorFile.path")
|
|
97
97
|
resultingSettings = ""
|
|
98
98
|
|
|
99
99
|
flavorFile.eachLine { String line ->
|
|
@@ -101,7 +101,7 @@ def loadSelligentSettings(variant) {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
else if (defaultFile.exists()) {
|
|
104
|
-
println("Reading default
|
|
104
|
+
println("Reading default Marigold Engage properties from ${defaultFile.path} (no variant specific nor flavor $defaultFileName were found)")
|
|
105
105
|
resultingSettings = ""
|
|
106
106
|
|
|
107
107
|
defaultFile.eachLine { String line ->
|
package/documentation/README.md
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
Copyright
|
|
6
6
|
|
|
7
|
-
The contents of this manual cover material copyrighted by
|
|
7
|
+
The contents of this manual cover material copyrighted by Marigold. Marigold reserves all intellectual property rights on the manual, which should be treated as confidential information as defined under the agreed upon software licence/lease terms and conditions.
|
|
8
8
|
|
|
9
|
-
The use and distribution of this manual is strictly limited to authorised users of the
|
|
9
|
+
The use and distribution of this manual is strictly limited to authorised users of the Marigold Interactive Marketing Software (hereafter the "Software") and can only be used for the purpose of using the Software under the agreed upon software licence/lease terms and conditions. Upon termination of the right to use the Software, this manual and any copies made must either be returned to Marigold or be destroyed, at the latest two weeks after the right to use the Software has ended.
|
|
10
10
|
|
|
11
|
-
With the exception of the first sentence of the previous paragraph, no part of this manual may be reprinted or reproduced or distributed or utilised in any form or by any electronic, mechanical or other means, not known or hereafter invented, included photocopying and recording, or in any information storage or retrieval or distribution system, without the prior permission in writing from
|
|
11
|
+
With the exception of the first sentence of the previous paragraph, no part of this manual may be reprinted or reproduced or distributed or utilised in any form or by any electronic, mechanical or other means, not known or hereafter invented, included photocopying and recording, or in any information storage or retrieval or distribution system, without the prior permission in writing from Marigold.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Marigold will not be responsible or liable for any accidental or inevitable damage that may result from unauthorised access or modifications.
|
|
14
14
|
|
|
15
15
|
User is aware that this manual may contain errors or inaccuracies and that it may be revised without advance notice. This manual is updated frequently.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Marigold welcomes any recommendations or suggestions regarding the manual, as it helps to continuously improve the quality of our products and manuals.
|
|
18
18
|
|
|
19
19
|
## Table of Contents
|
|
20
20
|
|
|
@@ -28,7 +28,7 @@ Selligent welcomes any recommendations or suggestions regarding the manual, as i
|
|
|
28
28
|
- [Background Modes](#background-modes)
|
|
29
29
|
- [Universal Linking - iOS](#universal-linking---ios)
|
|
30
30
|
- [Notification helper methods](#notification-helper-methods)
|
|
31
|
-
- [Disable
|
|
31
|
+
- [Disable Marigold Engage Push Notifications](#disable-marigold-engage-push-notifications)
|
|
32
32
|
- [Display last remote notification](#display-last-remote-notification)
|
|
33
33
|
- [Display last remote notification content](#display-last-remote-notification-content)
|
|
34
34
|
- [Retrieve last remote notification](#retrieve-last-remote-notification)
|
|
@@ -63,9 +63,9 @@ The following properties can be used in the `selligent.json` to further configur
|
|
|
63
63
|
|
|
64
64
|
| Property | Type | Description |
|
|
65
65
|
| ------------------------------------------- | ------ | ------- |
|
|
66
|
-
| url | string | The
|
|
67
|
-
| clientId | string | The
|
|
68
|
-
| privateKey | string | The
|
|
66
|
+
| url | string | The Marigold Engage webservice url to be used to integrate with your Marigold Engage platform |
|
|
67
|
+
| clientId | string | The Marigold Engage client id to be used to integrate with your Marigold Engage platform |
|
|
68
|
+
| privateKey | string | The Marigold Engage private key to be used to integrate with your Marigold Engage platform |
|
|
69
69
|
| delayedPushAction | boolean| (iOS Only) Optin for a specific push action handling (wait for React UI to be ready) when coming from a push message and having the app killed |
|
|
70
70
|
| interceptSelligentUniversalLinks | boolean| (iOS Only) Optin to customly handle the execution of universal links coming from a Push/IAM [more information](#universal-linking---ios) |
|
|
71
71
|
| clearCacheIntervalValue | [enum](#clearcacheintervalvalue) | How much time the SDK will keep things in cache |
|
|
@@ -204,7 +204,7 @@ Follow the [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/m
|
|
|
204
204
|
3. Somewhere in your ReactNative app (normally done as soon as possible but can also be done when certain page is reached), you will need to call `Selligent.enableNotifications` to prompt the user for the push notification permission or the `Selligent.registerForProvisionalRemoteNotification` (This option is only available for iOS 12+) if you want to get a provisional permission before asking the user for the normal one.
|
|
205
205
|
|
|
206
206
|
```javascript
|
|
207
|
-
import Selligent from "@selligent-marketing-cloud/selligent-react-native"; // Add
|
|
207
|
+
import Selligent from "@selligent-marketing-cloud/selligent-react-native"; // Add Marigold Engage import
|
|
208
208
|
|
|
209
209
|
if (Platform.OS === 'ios') {
|
|
210
210
|
Selligent.enableNotifications(
|
|
@@ -272,14 +272,14 @@ This is because the JS layer is loaded **after** the native iOS SDK executes the
|
|
|
272
272
|
3. Add a call to `Selligent.executePushAction()` in your main `App.js` file, after adding the ReactNative linking handler (and after calling `Selligent.subscribeToEvents`, if being used)
|
|
273
273
|
|
|
274
274
|
```javascript
|
|
275
|
-
import Selligent from "@selligent-marketing-cloud/selligent-react-native" // Add
|
|
275
|
+
import Selligent from "@selligent-marketing-cloud/selligent-react-native" // Add Marigold Engage import
|
|
276
276
|
|
|
277
277
|
const App = () => {
|
|
278
278
|
// Deeplinking handling library (i.e Linking.getInitialURL() & Linking.addEventListener...)
|
|
279
279
|
useHandleDeepLink()
|
|
280
280
|
|
|
281
281
|
if (Platform.OS === 'ios') {
|
|
282
|
-
/* Tells the
|
|
282
|
+
/* Tells the Marigold Engage SDK to execute the action associated to the last push clicked, when using `delayedPushAction` feature.
|
|
283
283
|
If you are having problems with deeplinks or 'Push + InApp Message' where the splash screen gets stuck or the push action not visible,
|
|
284
284
|
make sure you control when the splash screen is dismissed (i.e https://docs.expo.dev/versions/latest/sdk/splash-screen/) and call this method afterwards (if the dismiss is async, call this method once the async process is completely finished)
|
|
285
285
|
*/
|
|
@@ -323,7 +323,7 @@ static BOOL launchedFromBackground = false;
|
|
|
323
323
|
|
|
324
324
|
By default, universal links in a button from a Push/IAM will open the default browser, to avoid this and catch them on the App and apply any logic you want, you will need to add a property `interceptSelligentUniversalLinks` in the `selligent.json` with `true` as value.
|
|
325
325
|
|
|
326
|
-
You can then subscribe to `SelligentConstants.BroadcastEventType.UNIVERSAL_LINK_EXECUTED` event through the `Selligent.subscribeToEvents` whose execution callback will get triggered when a `deeplink` button type is defined in
|
|
326
|
+
You can then subscribe to `SelligentConstants.BroadcastEventType.UNIVERSAL_LINK_EXECUTED` event through the `Selligent.subscribeToEvents` whose execution callback will get triggered when a `deeplink` button type is defined in Marigold Engage (whose URL scheme is `http` or `https`).
|
|
327
327
|
The response of the success callback is an object which contains information on the type of broadcast event and the data attached to it.
|
|
328
328
|
|
|
329
329
|
| Property | Type | Description |
|
|
@@ -353,9 +353,9 @@ Selligent.subscribeToEvents(
|
|
|
353
353
|
|
|
354
354
|
### Notification helper methods
|
|
355
355
|
|
|
356
|
-
#### Disable
|
|
356
|
+
#### Disable Marigold Engage Push Notifications
|
|
357
357
|
|
|
358
|
-
You can enable or disable
|
|
358
|
+
You can enable or disable Marigold Engage push notifications (not all push notifications for your app) by calling `Selligent.enableNotifications` anytime you want (do note that for iOS, the first call to this method will prompt the user for the push permission).
|
|
359
359
|
|
|
360
360
|
```javascript
|
|
361
361
|
Selligent.enableNotifications(
|
|
@@ -596,9 +596,9 @@ In the other hand, you can also use the native methods `RNSelligent/willPresentN
|
|
|
596
596
|
|
|
597
597
|
### IAM Helper methods
|
|
598
598
|
|
|
599
|
-
If you decide to display the AIM on your own (without `Selligent.displayMessage` and `Selligent.displayNotification`), listening for new messages with the `Selligent.subscribeToEvents` and/or getting the full list with `Selligent.getInAppMessages`. You will be able to build your own layout with the object provided from the mentioned functions and then you can use the helper methods described here to still push KPI statistics to the
|
|
599
|
+
If you decide to display the AIM on your own (without `Selligent.displayMessage` and `Selligent.displayNotification`), listening for new messages with the `Selligent.subscribeToEvents` and/or getting the full list with `Selligent.getInAppMessages`. You will be able to build your own layout with the object provided from the mentioned functions and then you can use the helper methods described here to still push KPI statistics to the Marigold Engage platform:
|
|
600
600
|
|
|
601
|
-
- setInAppMessageAsSeen: sets an IAM as seen and sends the corresponding `Opened` event to the
|
|
601
|
+
- setInAppMessageAsSeen: sets an IAM as seen and sends the corresponding `Opened` event to the Marigold Engage platform
|
|
602
602
|
|
|
603
603
|
```javascript
|
|
604
604
|
Selligent.setInAppMessageAsSeen(
|
|
@@ -634,7 +634,7 @@ If you decide to display the AIM on your own (without `Selligent.displayMessage`
|
|
|
634
634
|
)
|
|
635
635
|
```
|
|
636
636
|
|
|
637
|
-
- executeButtonAction: executes the action linked to an IAM button and sends the corresponding `Clicked` event to the
|
|
637
|
+
- executeButtonAction: executes the action linked to an IAM button and sends the corresponding `Clicked` event to the Marigold Engage platform
|
|
638
638
|
|
|
639
639
|
```javascript
|
|
640
640
|
Selligent.executeButtonAction(
|
|
@@ -655,11 +655,10 @@ The method accepts an `event` object which requires certain properties, dependin
|
|
|
655
655
|
| Property | Type | Description |
|
|
656
656
|
| ----------- | ------------------------------------- | ---------------- |
|
|
657
657
|
| type | [enum](#eventtype) | The type of event to send |
|
|
658
|
-
| email | string | The
|
|
659
|
-
| data | object | Additional data to
|
|
658
|
+
| email | string | The custom profile identifier (`mail` in our v1 platform) of the user as a String. |
|
|
659
|
+
| data | object | Additional data you want to provide to Marigold Engage (you can specify here a key/value pair to use as an alternative lookup for your device identification process) |
|
|
660
660
|
|
|
661
|
-
For events of type `SelligentConstants.EventType.CUSTOM` the `data` property is mandatory
|
|
662
|
-
For the rest of event types, the `email` property is mandatory.
|
|
661
|
+
For events of type `SelligentConstants.EventType.CUSTOM` the `data` property is mandatory.
|
|
663
662
|
|
|
664
663
|
```javascript
|
|
665
664
|
Selligent.sendEvent(
|
|
@@ -672,7 +671,7 @@ Selligent.sendEvent(
|
|
|
672
671
|
data: { // optional
|
|
673
672
|
description: "this is some extra information concerning this event"
|
|
674
673
|
},
|
|
675
|
-
email: "someone@somedomain.com"
|
|
674
|
+
email: "someone@somedomain.com"
|
|
676
675
|
}
|
|
677
676
|
)
|
|
678
677
|
Selligent.sendEvent(
|
|
@@ -693,7 +692,7 @@ Selligent.sendEvent(
|
|
|
693
692
|
|
|
694
693
|
### Get lib version
|
|
695
694
|
|
|
696
|
-
Returns the version of the installed native
|
|
695
|
+
Returns the version of the installed native Marigold Engage SDK (string).
|
|
697
696
|
|
|
698
697
|
```javascript
|
|
699
698
|
Selligent.getVersionLib((versionLib) => {
|
|
@@ -702,7 +701,7 @@ Selligent.getVersionLib((versionLib) => {
|
|
|
702
701
|
|
|
703
702
|
### Get device id
|
|
704
703
|
|
|
705
|
-
Returns the currently known
|
|
704
|
+
Returns the currently known Marigold Engage device Id (string).
|
|
706
705
|
|
|
707
706
|
```javascript
|
|
708
707
|
Selligent.getDeviceId((deviceId) => {
|
|
@@ -723,7 +722,7 @@ The `data` property is an object itself containing more information specific to
|
|
|
723
722
|
|
|
724
723
|
| Property | Type | Description |
|
|
725
724
|
| -------- | ------ | ------------------------------- |
|
|
726
|
-
| deviceId | string | The
|
|
725
|
+
| deviceId | string | The Marigold Engage id of the device |
|
|
727
726
|
|
|
728
727
|
### Logging
|
|
729
728
|
|
|
@@ -867,11 +866,11 @@ Defines the type of an event.
|
|
|
867
866
|
|
|
868
867
|
| Name | Type | Value | Description |
|
|
869
868
|
| --------------- | ------ | ----- | ----------------- |
|
|
870
|
-
| USER_REGISTER | number | 90 | Used to send a register event to the server with the custom email/profile identifier of the user, with the purpose of linking the device to an user and optionally storing some data at
|
|
871
|
-
| USER_UNREGISTER | number | 91 | Used to send an unregister event to the server with the custom email/profile identifier of the user, with the purpose of keeping track of a REGISTERED flag and optionally storing some data at
|
|
872
|
-
| USER_LOGIN | number | 92 | Used to send a login event to the server with the custom email/profile identifier of the user, with the purpose of linking the device to an user and optionally storing some data at
|
|
873
|
-
| USER_LOGOUT | number | 93 | Used to send a logout event to the server with the custom email/profile identifier of the user, with the purpose of keeping track of a LOGGED flag and optionally storing some data at
|
|
874
|
-
| CUSTOM | number | 94 | Used to send a custom event to the server, with the purpose of keeping track of storing some data at
|
|
869
|
+
| USER_REGISTER | number | 90 | Used to send a register event to the server with the custom email/profile identifier of the user, with the purpose of linking the device to an user and optionally storing some data at Marigold Engage platform side. This event will create a new user in your Marigold Engage database, if none was found (you can use an alternate key/value field to search for the user, in the data object, since by default the `email` one will use the `MAIL` column in your Marigold Engage database). |
|
|
870
|
+
| USER_UNREGISTER | number | 91 | Used to send an unregister event to the server with the custom email/profile identifier of the user, with the purpose of keeping track of a REGISTERED flag and optionally storing some data at Marigold Engage platform side (this event is not unlinking the user from the device (automatically), at the moment). |
|
|
871
|
+
| USER_LOGIN | number | 92 | Used to send a login event to the server with the custom email/profile identifier of the user, with the purpose of linking the device to an user and optionally storing some data at Marigold Engage platform side. This event will **NOT** create a new user in your Marigold Engage database, if none found. |
|
|
872
|
+
| USER_LOGOUT | number | 93 | Used to send a logout event to the server with the custom email/profile identifier of the user, with the purpose of keeping track of a LOGGED flag and optionally storing some data at Marigold Engage platform side (this event is not unlinking the user from the device (automatically), at the moment). |
|
|
873
|
+
| CUSTOM | number | 94 | Used to send a custom event to the server, with the purpose of keeping track of storing some data at Marigold Engage platform side. |
|
|
875
874
|
|
|
876
875
|
### NotificationButtonType
|
|
877
876
|
|
|
@@ -889,7 +888,7 @@ Defines the type of buttons for notifications or inapp messages.
|
|
|
889
888
|
| CUSTOM_ACTION_BROADCAST_EVENT | number | 107 | Sends a custom broadcast to the App |
|
|
890
889
|
| PASSBOOK | number | 111 | Opens a passbook URL |
|
|
891
890
|
| DEEPLINK | number | 112 | Executes a deeplink |
|
|
892
|
-
| SIMPLE | number | 113 | Nothing done except forwarding the corresponding `Clicked` event to the
|
|
891
|
+
| SIMPLE | number | 113 | Nothing done except forwarding the corresponding `Clicked` event to the Marigold Engage platform |
|
|
893
892
|
|
|
894
893
|
### BroadcastEventType
|
|
895
894
|
|
package/helpers.js
CHANGED
|
@@ -8,7 +8,7 @@ SelligentHelpers.WRONG_ARGUMENTS = "Insufficient/incorrect argument(s) passed to
|
|
|
8
8
|
SelligentHelpers.MORE_INFORMATION = "For more information view the documentation of this method.";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Function to check if the Native
|
|
11
|
+
* Function to check if the Native Marigold Engage SDK is found
|
|
12
12
|
*
|
|
13
13
|
* @param RNSelligent
|
|
14
14
|
*/
|
package/index.ios.js
CHANGED
|
@@ -86,7 +86,7 @@ export default {
|
|
|
86
86
|
},
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
* Tells the
|
|
89
|
+
* Tells the Marigold Engage SDK to execute the action associated to the last push clicked, when using `delayedPushAction` feature
|
|
90
90
|
*/
|
|
91
91
|
executePushAction: function () {
|
|
92
92
|
RNSelligent.executePushAction()
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import SelligentHelpers from './helpers'
|
|
|
5
5
|
const { RNSelligent } = NativeModules
|
|
6
6
|
export const RNSEventEmitter = new NativeEventEmitter(RNSelligent)
|
|
7
7
|
|
|
8
|
-
// Check if Native version of
|
|
8
|
+
// Check if Native version of Marigold Engage found
|
|
9
9
|
SelligentHelpers.isNativeSelligentFound(RNSelligent)
|
|
10
10
|
|
|
11
11
|
// to export the android methods without syntax sugar and/or javascript manipulation, use this line:
|
|
@@ -23,12 +23,12 @@ if (Platform.OS === 'android') {
|
|
|
23
23
|
// or export with syntax sugar and/or javascript manipulation:
|
|
24
24
|
export default Object.assign(
|
|
25
25
|
{
|
|
26
|
-
// Check if the
|
|
26
|
+
// Check if the Marigold Engage Module is loaded
|
|
27
27
|
_selligentLoaded: Boolean(RNSelligent),
|
|
28
28
|
// Basic SMManager
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Returns the version of the underlying
|
|
31
|
+
* Returns the version of the underlying Marigold Engage native SDK.
|
|
32
32
|
*
|
|
33
33
|
* @param {function} successCallback Callback function on success.
|
|
34
34
|
*/
|
|
@@ -200,26 +200,15 @@ export default Object.assign(
|
|
|
200
200
|
return
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (event.type === SelligentConstants.EventType.CUSTOM) {
|
|
206
|
-
// check if required options are valid
|
|
207
|
-
if (!SelligentHelpers.hasRequiredParameterAndMatchesType(event, 'data', 'object')) {
|
|
208
|
-
errorCallback(SelligentHelpers.wrongArgumentError('Expected an object with the key "data".'))
|
|
209
|
-
return
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// check if required options are valid
|
|
213
|
-
if (event.hasOwnProperty('email')) {
|
|
214
|
-
console.warn("Email prop is not used with \"custom\" event type and will be ignored.");
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
else if (!SelligentHelpers.hasRequiredParameterAndMatchesType(event, 'email', 'string')) {
|
|
218
|
-
errorCallback(SelligentHelpers.wrongArgumentError('Expected an object with the key "email".'))
|
|
203
|
+
if (!SelligentHelpers.hasOptionalParameterAndMatchesType(event, 'data', 'object')) {
|
|
204
|
+
errorCallback(SelligentHelpers.createTypeErrorMessage('data', event.data, 'object'))
|
|
219
205
|
return
|
|
220
206
|
}
|
|
221
|
-
|
|
222
|
-
|
|
207
|
+
else if (!SelligentHelpers.hasOptionalParameterAndMatchesType(event, 'email', 'string')) {
|
|
208
|
+
errorCallback(SelligentHelpers.createTypeErrorMessage('email', event.email, 'string'))
|
|
209
|
+
return
|
|
210
|
+
}
|
|
211
|
+
else if (!SelligentHelpers.hasOptionalParameterAndMatchesType(event, 'shouldCache', 'boolean')) {
|
|
223
212
|
errorCallback(SelligentHelpers.createTypeErrorMessage('shouldCache', event.shouldCache, 'boolean'))
|
|
224
213
|
return
|
|
225
214
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": {
|
|
3
|
-
"name": "
|
|
3
|
+
"name": "Marigold Engage <mobile@selligent.com>"
|
|
4
4
|
},
|
|
5
5
|
"name": "@selligent-marketing-cloud/selligent-react-native",
|
|
6
|
-
"title": "
|
|
7
|
-
"version": "3.5.
|
|
8
|
-
"description": "React Native wrapper for the
|
|
6
|
+
"title": "Marigold Engage React Native",
|
|
7
|
+
"version": "3.5.1",
|
|
8
|
+
"description": "React Native wrapper for the Marigold Engage Android and iOS SDKs",
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"jest-junit": "^16.0.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"test": "jest --coverage --reporters=jest-junit"
|
|
39
|
+
"test": "jest --coverage --reporters=jest-junit",
|
|
40
|
+
"local-test": "jest --coverage"
|
|
40
41
|
},
|
|
41
42
|
"files": [
|
|
42
43
|
"/RNSelligentMapper.podspec",
|