@selligent-marketing-cloud/selligent-react-native 4.0.2 → 4.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 +5 -5
- package/android/build.gradle +3 -3
- package/documentation/README.md +56 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@ This module supports the following SDK and tools:
|
|
|
10
10
|
|
|
11
11
|
| SDK | Version |
|
|
12
12
|
| ------------------------------------------------------------------------------ |---------|
|
|
13
|
-
| [Android SDK](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 4.
|
|
14
|
-
| [iOS SDK](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 3.8.
|
|
15
|
-
| ReactNative | 0.
|
|
16
|
-
| Expo SDK |
|
|
13
|
+
| [Android SDK](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 4.7.0 |
|
|
14
|
+
| [iOS SDK](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 3.8.7 |
|
|
15
|
+
| ReactNative | 0.81.4 |
|
|
16
|
+
| Expo SDK | 54 |
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
@@ -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.7"` 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
|
|
package/android/build.gradle
CHANGED
|
@@ -19,7 +19,7 @@ android {
|
|
|
19
19
|
compileSdk 34
|
|
20
20
|
|
|
21
21
|
defaultConfig {
|
|
22
|
-
minSdkVersion
|
|
22
|
+
minSdkVersion 23
|
|
23
23
|
targetSdkVersion 34
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -56,7 +56,7 @@ dependencies {
|
|
|
56
56
|
exclude group:'com.facebook.fbjni'
|
|
57
57
|
exclude group:'com.facebook.yoga'
|
|
58
58
|
}
|
|
59
|
-
implementation 'com.selligent.sdk:selligent_mobile_sdk:4.
|
|
59
|
+
implementation 'com.selligent.sdk:selligent_mobile_sdk:4.7.0'
|
|
60
60
|
implementation 'com.google.code.gson:gson:2.10.1'
|
|
61
61
|
implementation 'com.google.firebase:firebase-messaging:23.4.1'
|
|
62
62
|
implementation 'androidx.work:work-runtime:2.9.0'
|
|
@@ -64,7 +64,7 @@ dependencies {
|
|
|
64
64
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
65
65
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
|
|
66
66
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
|
67
|
-
implementation 'com.selligent.sdk:selligent_mobile_reactnative_sdk:3.8.
|
|
67
|
+
implementation 'com.selligent.sdk:selligent_mobile_reactnative_sdk:3.8.3'
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
def loadSelligentSettings(variant) {
|
package/documentation/README.md
CHANGED
|
@@ -140,7 +140,43 @@ Follow the [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/m
|
|
|
140
140
|
|
|
141
141
|
**For iOS**:
|
|
142
142
|
|
|
143
|
-
1. For push notifications you need to delegate some of the `AppDelegate
|
|
143
|
+
1. For push notifications you need to delegate some of the `AppDelegate` methods to the SDK:
|
|
144
|
+
|
|
145
|
+
Swift
|
|
146
|
+
|
|
147
|
+
```swift
|
|
148
|
+
// Import the SDK
|
|
149
|
+
import RNSelligentMobileSDK
|
|
150
|
+
|
|
151
|
+
// Use UNUserNotificationCenterDelegate
|
|
152
|
+
@UIApplicationMain
|
|
153
|
+
public class AppDelegate: ExpoAppDelegate, UNUserNotificationCenterDelegate {
|
|
154
|
+
|
|
155
|
+
// In didFinishLaunchingWithOptions function
|
|
156
|
+
UNUserNotificationCenter.current().delegate = self
|
|
157
|
+
RNSelligent.configureWithLaunchOptions(launchOptions ?? [:])
|
|
158
|
+
|
|
159
|
+
// Notification delegates
|
|
160
|
+
override public func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
|
161
|
+
RNSelligent.didRegisterForRemoteNotifications(withDeviceToken: deviceToken)
|
|
162
|
+
super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
override public func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
|
|
166
|
+
RNSelligent.didFailToRegisterForRemoteNotificationsWithError(error)
|
|
167
|
+
super.application(application, didFailToRegisterForRemoteNotificationsWithError: error)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping(UNNotificationPresentationOptions) -> Void) {
|
|
171
|
+
RNSelligent.willPresentNotification(notification, withCompletionHandler: completionHandler)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
|
175
|
+
RNSelligent.didReceiveNotificationResponse(response, withCompletionHandler: completionHandler)
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Objective-C
|
|
144
180
|
|
|
145
181
|
```objc
|
|
146
182
|
// In AppDelegate.h
|
|
@@ -207,20 +243,21 @@ Follow the [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/m
|
|
|
207
243
|
```javascript
|
|
208
244
|
import Selligent from "@selligent-marketing-cloud/selligent-react-native"; // Add Marigold Engage import
|
|
209
245
|
|
|
210
|
-
|
|
211
|
-
Selligent.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
246
|
+
if (Platform.OS === "ios") {
|
|
247
|
+
Selligent.registerForProvisionalRemoteNotification(() => {
|
|
248
|
+
// success callback
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
Selligent.enableNotifications(
|
|
253
|
+
(response) => {
|
|
254
|
+
// success callback
|
|
255
|
+
},
|
|
256
|
+
(error) => {
|
|
257
|
+
// error callback
|
|
258
|
+
},
|
|
259
|
+
true
|
|
260
|
+
)
|
|
224
261
|
```
|
|
225
262
|
|
|
226
263
|
### Rich Push Notifications
|
|
@@ -409,7 +446,9 @@ Selligent.subscribeToEvents(
|
|
|
409
446
|
|
|
410
447
|
## In-App Messages
|
|
411
448
|
|
|
412
|
-
|
|
449
|
+
In-App messages are messages retrieved periodically by the SDK.
|
|
450
|
+
|
|
451
|
+
They are retrieved when the app becomes active (ie. at startup, when going from background to foreground and when the orientation changes) ONLY if the last refresh is older than the value [inAppMessageRefreshType](#inappmessagerefreshtype) in the `selligent.json`.
|
|
413
452
|
|
|
414
453
|
You can later call the `Selligent.enableInAppMessages` function (if you want) to further optin/optout from the functionality; this function expects an `enabled` parameter that can either be a boolean or an [enum](#inappmessagerefreshtype) value.
|
|
415
454
|
|
|
@@ -561,6 +600,7 @@ In the other hand, you can also use the native methods `RNSelligent/willPresentN
|
|
|
561
600
|
// OR
|
|
562
601
|
// #import <RNSelligentMobileSDK/RNSelligentMobileSDK-Swift.h>
|
|
563
602
|
// #import <MapKit/MapKit.h>
|
|
603
|
+
// #import <WebKit/WebKit.h>
|
|
564
604
|
// #import <SelligentMobileSDK/SMHelperSwift.h>
|
|
565
605
|
|
|
566
606
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"name": "@selligent-marketing-cloud/selligent-react-native",
|
|
6
6
|
"title": "Marigold Engage React Native",
|
|
7
|
-
"version": "4.0
|
|
7
|
+
"version": "4.2.0",
|
|
8
8
|
"description": "React Native wrapper for the Marigold Engage Android and iOS SDKs",
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"repository": {
|