@selligent-marketing-cloud/selligent-react-native 2.7.0 → 2.10.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/CHANGELOG.md +52 -0
- package/README.md +241 -16
- package/RNSelligent.podspec +1 -0
- package/android/build/generated/source/buildConfig/debug/com/selligent/BuildConfig.java +12 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +9 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +4 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +6535 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastDataFactory$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastDataFactory.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventDataParser.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/ButtonBroadcastEventDataParser.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/ClearCacheIntervalValue.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/Event.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/EventReceiver.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/EventType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/GCMTokenBroadcastEventDataParser.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageBroadcastEventDataParser.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageRefreshType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$5.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligentPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/RemoteMessageDisplayType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/SMEventFactory$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/SMEventFactory.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/SMSettingsFactory.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/selligent/Settings.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +11 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +9 -0
- package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +18 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +4893 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +25 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +35 -43
- package/android/libs/sdk-release.aar +0 -0
- package/android/src/main/java/com/selligent/RNSelligent.java +15 -0
- package/android/src/main/java/com/selligent/SMSettingsFactory.java +4 -0
- package/android/src/main/java/com/selligent/Settings.java +33 -0
- package/constants.d.ts +12 -0
- package/constants.js +24 -0
- package/index.d.ts +6 -0
- package/index.js +32 -0
- package/ios/ClientSettings.h +1 -0
- package/ios/ClientSettings.m +2 -0
- package/ios/EnumMapper.h +2 -0
- package/ios/EnumMapper.m +2 -0
- package/ios/LocationAuthorisationStatus.h +6 -0
- package/ios/LocationAuthorisationType.h +4 -0
- package/ios/RNSelligent.m +14 -0
- package/ios/SMManagerSetting+ClientSettings.m +5 -0
- package/ios/include/SMEvent.h +1 -1
- package/ios/include/SMHelper.h +6 -3
- package/ios/include/SMManager+InAppMessage.h +2 -2
- package/ios/include/SMManager+Location.h +41 -0
- package/ios/include/SMManager+UserNotification.h +16 -3
- package/ios/include/SMManager.h +1 -1
- package/ios/include/SMManagerInAppMessageDelegate.h +2 -2
- package/ios/include/SMManagerSetting+Location.h +27 -0
- package/ios/include/SMManagerSetting.h +2 -2
- package/ios/include/SMNSNotification.h +4 -10
- package/ios/include/SMRemoteMessageDisplayType.h +2 -2
- package/ios/libSelligentMobile.a +0 -0
- package/package.json +3 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.10.0] - 12 September 2022
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Add section on application lifecycle management split between `AppDelegate` and `SceneDelegate` with regards to Selligent push notification handling on iOS 15+ in README
|
|
7
|
+
- Add a couple of markdown code language identifiers for syntax highlightinh in README
|
|
8
|
+
- Add disclaimer concerning this module's incompatibility with React Native's new architecture in README
|
|
9
|
+
- Add disclaimer plot project's minimum version upgrade to `3.5.0` for `iOS` in README
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Add version 3.10.1 of the Android SDK to `android/libs`
|
|
13
|
+
- Add version 2.7.7 of the iOS SDK static library to `/ios`
|
|
14
|
+
- Change development dependency versions of `react` and `react-native` to `18.1.0` and `^0.70.0`, respectively
|
|
15
|
+
- Upgrade the `compileSdkVersion` and `targetSdkVersion` to `32` in `android/build.gradle`
|
|
16
|
+
- Upgrade the Android Gradle Plugin version to `7.2.2`
|
|
17
|
+
- Upgrade the `om.google.code.gson:gson` and `androidx.work:work-runtime` dependencies to `2.8.9` and `2.7.1` respectively in `android/build.gradle`
|
|
18
|
+
- Change used native SDK version numbers to `3.10.1` and `2.7.7` for Android and iOS respectively in README
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- Fix typos in README
|
|
22
|
+
|
|
23
|
+
## [2.9.0] - 20 May 2022
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- Add possibility to set the app's notification channel's ID, name and description on `Android` via `notificationChannelId`, `notificationChannelName`, and `notificationChannelDescription` settings keys in `selligent.json`.
|
|
27
|
+
- Add comment to README about rich push notification method invocation deprecation on iOS.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Add version 3.9.0 of the Android SDK to `android/libs`
|
|
31
|
+
- Add version 2.7.4 of the iOS SDK static library to `/ios`
|
|
32
|
+
- Change used native SDK version numbers to `3.9.0` and `2.7.4` for Android and iOS respectively in README
|
|
33
|
+
|
|
34
|
+
## [2.8.0] - 18 February 2022
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
- Re-add plotProjects dependency for Android in `android/build.gradle`
|
|
38
|
+
- Re-add geolocation native module functions (`enableGeolocation`, `isGeoLocationEnabled`) for Android
|
|
39
|
+
- Re-add geofencing header files for iOS in `ios/include` and module files in `ios/`
|
|
40
|
+
- Re-add plotProjects and geolocation documentation to README
|
|
41
|
+
- Add documentation regarding the Gradle build tool version and Gradle version compatability
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
- Add version 3.8.1 of the Android SDK to `android/libs`
|
|
45
|
+
- Swap the deprecated maven plugin and its archiving capabilities for the maven-publish plugin in `android/build.gradle`
|
|
46
|
+
- Add version 2.7.2 of the iOS SDK static library to `ios/`
|
|
47
|
+
- Change used native SDK version numbers to `3.8.1` and `2.7.2` for Android and iOS respectively in README
|
|
48
|
+
- Bump the react-native library to `0.67.2` in `package.json`
|
|
49
|
+
- Bump wrapper version to `2.8.0` in `package.json`
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
- Fix typos in README as duly noted in https://github.com/SelligentMarketingCloud/MobileSDK-ReactNative/issues/25
|
package/README.md
CHANGED
|
@@ -7,14 +7,16 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
7
7
|
- Android
|
|
8
8
|
- iOS
|
|
9
9
|
|
|
10
|
-
> _**
|
|
10
|
+
> _**IMPORTANT:** Since version 2.6.0 of this module we require your app to use the Android Gradle Plugin version 4.2.0 or higher in order to build on Android. This is the default Android Gradle Plugin version since React Native version 0.64.0 but can be manually increased in older versions of React Native._
|
|
11
|
+
|
|
12
|
+
> _**IMPORTANT** Since version 2.10.0 of this module, we support React Native v0.70, but NOT REACT NATIVE'S NEW ARCHITECTURE! The following library contains React native modules, that are tailored to and can only be used in React Native's legacy architecture, that will be deprecated in the future when the new architecture will be stable._
|
|
11
13
|
|
|
12
14
|
This module uses the native Selligent SDKs:
|
|
13
15
|
|
|
14
16
|
| SDK | Version |
|
|
15
17
|
| ----------------------------------------------------------------------- | ------- |
|
|
16
|
-
| [Android](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 3.
|
|
17
|
-
| [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 2.7.
|
|
18
|
+
| [Android](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 3.10.1 |
|
|
19
|
+
| [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 2.7.7 |
|
|
18
20
|
|
|
19
21
|
## ToC
|
|
20
22
|
|
|
@@ -57,6 +59,7 @@ This module uses the native Selligent SDKs:
|
|
|
57
59
|
| clientId | string | Yes | Both |
|
|
58
60
|
| privateKey | string | Yes | Both |
|
|
59
61
|
| clearCacheIntervalValue | enum [Selligent.ClearCacheIntervalValue](#selligentclearcacheintervalvalue) | No | Both |
|
|
62
|
+
| configureLocationServices | boolean | No | Both |
|
|
60
63
|
| inAppMessageRefreshType | enum [Selligent.InAppMessageRefreshType](#selligentinappmessagerefreshtype) | No | Both |
|
|
61
64
|
| addInAppMessageFromPushToInAppMessageList | boolean | No | Both |
|
|
62
65
|
| remoteMessageDisplayType | enum [Selligent.RemoteMessagesDisplayType](#selligentremotemessagesdisplaytype) | No | Both |
|
|
@@ -69,6 +72,9 @@ This module uses the native Selligent SDKs:
|
|
|
69
72
|
| loadCacheAsynchronously | boolean | No | Android Only |
|
|
70
73
|
| fullyQualifiedNotificationActivityClassName | string | No | Android Only |
|
|
71
74
|
| notificationIconColor | string | No | Android Only |
|
|
75
|
+
| notificationChannelId | string | No | Android Only |
|
|
76
|
+
| notificationChannelName | string | No | Android Only |
|
|
77
|
+
| notificationChannelDescription | string | No | Android Only |
|
|
72
78
|
|
|
73
79
|
|
|
74
80
|
|
|
@@ -87,13 +93,13 @@ This module uses the native Selligent SDKs:
|
|
|
87
93
|
> maven { url 'https://developer.huawei.com/repo/' }
|
|
88
94
|
> }
|
|
89
95
|
> dependencies {
|
|
90
|
-
> classpath
|
|
96
|
+
> classpath 'com.huawei.agconnect:agcp:1.6.0.300'
|
|
91
97
|
> }
|
|
92
98
|
> }
|
|
93
99
|
>
|
|
94
100
|
> allProjects: {
|
|
95
101
|
> repositories: {
|
|
96
|
-
> maven
|
|
102
|
+
> maven { url 'https://developer.huawei.com/repo/' }
|
|
97
103
|
> }
|
|
98
104
|
> }
|
|
99
105
|
>
|
|
@@ -103,7 +109,7 @@ This module uses the native Selligent SDKs:
|
|
|
103
109
|
>
|
|
104
110
|
> ```gradle
|
|
105
111
|
>
|
|
106
|
-
> apply plugin 'com.huawei.agconnect'
|
|
112
|
+
> apply plugin: 'com.huawei.agconnect'
|
|
107
113
|
>
|
|
108
114
|
> dependencies {
|
|
109
115
|
> api 'com.huawei.hms:base:6.2.0.300'
|
|
@@ -125,13 +131,17 @@ This module uses the native Selligent SDKs:
|
|
|
125
131
|
project(':selligent-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@selligent-marketing-cloud/selligent-react-native/android')
|
|
126
132
|
```
|
|
127
133
|
|
|
128
|
-
3. Add the following in the `android/build.gradle` file:
|
|
134
|
+
3. Add the following in the `android/build.gradle` file, and make sure the the the Gradle version in `android/gradle/wrapper/gradle-wrapper.properties` is >= 6.7.1:
|
|
129
135
|
|
|
130
136
|
```groovy
|
|
137
|
+
// android/build.gradle
|
|
138
|
+
|
|
131
139
|
buildscript {
|
|
132
140
|
...
|
|
133
141
|
dependencies {
|
|
134
142
|
...
|
|
143
|
+
// Make sure your Gradle plugin version is >= 4.2.0
|
|
144
|
+
classpath("com.android.tools.build:gradle:4.2.0")
|
|
135
145
|
// Add the following:
|
|
136
146
|
classpath 'com.google.gms:google-services:4.3.3'
|
|
137
147
|
}
|
|
@@ -144,10 +154,22 @@ This module uses the native Selligent SDKs:
|
|
|
144
154
|
flatDir {
|
|
145
155
|
dirs "$rootDir/../node_modules/@selligent-marketing-cloud/selligent-react-native/android/libs"
|
|
146
156
|
}
|
|
157
|
+
|
|
158
|
+
// Add the following:
|
|
159
|
+
maven {
|
|
160
|
+
url 'https://maven-repo.plotprojects.com'
|
|
161
|
+
}
|
|
147
162
|
}
|
|
148
163
|
}
|
|
149
164
|
```
|
|
150
165
|
|
|
166
|
+
```groovy
|
|
167
|
+
// android/gradle/wrapper/gradle-wrapper.properties
|
|
168
|
+
...
|
|
169
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
|
170
|
+
...
|
|
171
|
+
```
|
|
172
|
+
|
|
151
173
|
4. Add the following in the `android/app/build.gradle` file:
|
|
152
174
|
|
|
153
175
|
```groovy
|
|
@@ -208,13 +230,17 @@ This module uses the native Selligent SDKs:
|
|
|
208
230
|
project(':selligent-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@selligent-marketing-cloud/selligent-react-native/android')
|
|
209
231
|
```
|
|
210
232
|
|
|
211
|
-
3. Add the following in the `android/build.gradle` file:
|
|
233
|
+
3. Add the following in the `android/build.gradle` file, and make sure the the the Gradle version in `android/gradle/wrapper/gradle-wrapper.properties` is >= 6.7.1:
|
|
212
234
|
|
|
213
235
|
```groovy
|
|
236
|
+
// android/build.gradle
|
|
237
|
+
|
|
214
238
|
buildscript {
|
|
215
239
|
...
|
|
216
240
|
dependencies {
|
|
217
241
|
...
|
|
242
|
+
// Make sure your Gradle plugin version is >= 4.2.0
|
|
243
|
+
classpath("com.android.tools.build:gradle:4.2.0")
|
|
218
244
|
// Add the following:
|
|
219
245
|
classpath 'com.google.gms:google-services:4.3.3'
|
|
220
246
|
}
|
|
@@ -227,10 +253,22 @@ This module uses the native Selligent SDKs:
|
|
|
227
253
|
flatDir {
|
|
228
254
|
dirs "$rootDir/../node_modules/@selligent-marketing-cloud/selligent-react-native/android/libs"
|
|
229
255
|
}
|
|
256
|
+
|
|
257
|
+
// Add the following:
|
|
258
|
+
maven {
|
|
259
|
+
url 'https://maven-repo.plotprojects.com'
|
|
260
|
+
}
|
|
230
261
|
}
|
|
231
262
|
}
|
|
232
263
|
```
|
|
233
264
|
|
|
265
|
+
```groovy
|
|
266
|
+
// android/gradle/wrapper/gradle-wrapper.properties
|
|
267
|
+
...
|
|
268
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
|
269
|
+
...
|
|
270
|
+
```
|
|
271
|
+
|
|
234
272
|
4. Add the following in the `android/app/build.gradle` file:
|
|
235
273
|
|
|
236
274
|
```groovy
|
|
@@ -264,7 +302,7 @@ This module uses the native Selligent SDKs:
|
|
|
264
302
|
|
|
265
303
|
Add the following properties to the `selligent.json` file:
|
|
266
304
|
|
|
267
|
-
```
|
|
305
|
+
```json
|
|
268
306
|
"notificationSmallIcon": "ic_notification",
|
|
269
307
|
"notificationLargeIcon": "ic_notification"
|
|
270
308
|
```
|
|
@@ -296,16 +334,18 @@ Add the following properties to the `selligent.json` file:
|
|
|
296
334
|
|
|
297
335
|
5. Create a `Podfile` (if there isn't one already) in the `/ios` folder and add the following:
|
|
298
336
|
|
|
337
|
+
> **IMPORTANT:** Since v2.7.5 of the iOS SDK, the minimum PlotPlugin version is 3.5.0!
|
|
338
|
+
|
|
299
339
|
```ruby
|
|
300
340
|
target 'REPLACEWITHYOURTARGETNAME'
|
|
301
|
-
pod 'PlotPlugin', '3.
|
|
341
|
+
pod 'PlotPlugin', '3.5.0'
|
|
302
342
|
```
|
|
303
343
|
|
|
304
344
|
6. Execute `pod install` in the `/ios` folder
|
|
305
345
|
|
|
306
346
|
7. From now on open the `.xcworkspace` file to make changes in Xcode
|
|
307
347
|
|
|
308
|
-
8. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.
|
|
348
|
+
8. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.mm`
|
|
309
349
|
|
|
310
350
|
```objective-c
|
|
311
351
|
#import <RNSelligent.h>
|
|
@@ -323,9 +363,9 @@ Add the following properties to the `selligent.json` file:
|
|
|
323
363
|
|
|
324
364
|
2. Execute `pod install` in the `/ios` folder
|
|
325
365
|
|
|
326
|
-
3. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.
|
|
366
|
+
3. Bootstrap the SDK in the `application:didFinishLaunchingWithOptions:` of the `AppDelegate.mm`
|
|
327
367
|
|
|
328
|
-
```
|
|
368
|
+
```objc
|
|
329
369
|
#import <RNSelligent.h>
|
|
330
370
|
[RNSelligent configureWithLaunchOptions:launchOptions];
|
|
331
371
|
```
|
|
@@ -334,12 +374,15 @@ Add the following properties to the `selligent.json` file:
|
|
|
334
374
|
|
|
335
375
|
#### Push notifications
|
|
336
376
|
|
|
337
|
-
1. For push notifications you need to delegate some of the `AppDelegate.
|
|
377
|
+
1. For push notifications you need to delegate some of the `AppDelegate.mm` methods to the SDK:
|
|
338
378
|
|
|
339
|
-
```
|
|
379
|
+
```objc
|
|
340
380
|
#import "AppDelegate.h"
|
|
341
381
|
#import <React/RCTBundleURLProvider.h>
|
|
342
382
|
#import <React/RCTRootView.h>
|
|
383
|
+
|
|
384
|
+
#import <React/RCTAppSetupUtils.h>
|
|
385
|
+
|
|
343
386
|
#import <RNSelligent.h>
|
|
344
387
|
|
|
345
388
|
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
|
|
@@ -405,11 +448,115 @@ Add the following properties to the `selligent.json` file:
|
|
|
405
448
|
Make sure you add your `appGroupId` to the `selligent.json`.
|
|
406
449
|
> **IMPORTANT!** make sure your `appGroupId` has the following structure or it will not work: `group.{MAIN_APP_BUNDLE_ID}`
|
|
407
450
|
|
|
451
|
+
> **IMPORTANT!** Since v2.9.0, `-(void)didReceiveNotification:(UNNotification *)notification` of `SMManager+RemoteNotification` has become deprecated. You will need to invoke `-(void)didReceiveNotification:(UNNotification *)notification withContext` instead. Consult [**the iOS documentation**](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/master/Documentation#start-the-sdk-from-inside-the-extension-1) for more details.
|
|
452
|
+
|
|
453
|
+
4. Starting from iOS 13, Apple split up the application lifecycle logic between `AppDelegate` and `SceneDelegate`.
|
|
454
|
+
This was done in order to enable multi-window support that was introduced in iPad-OS. The `AppDelegate` is responsible for application lifecycle handling and setup of services, while `SceneDelegate` is responsible for updating the UI (windows and scenes).
|
|
455
|
+
|
|
456
|
+
However, this split in responsibilites has given rise to issues with Sellgent's default push notification behavior __since iOS 15__, which shows an alert containing the notification's content, or its associated in-app content. Starting from iOS 15, you should add a separate `SceneDelegate`, that you connect to your `AppDelegate`, which handles the UI updating logic:
|
|
457
|
+
|
|
458
|
+
``` objc
|
|
459
|
+
// SceneDelegate.h
|
|
460
|
+
|
|
461
|
+
#ifndef SceneDelegate_h
|
|
462
|
+
#define SceneDelegate_h
|
|
463
|
+
|
|
464
|
+
#import <UIKit/UIKit.h>
|
|
465
|
+
#import <React/RCTBridgeDelegate.h>
|
|
466
|
+
|
|
467
|
+
@interface SceneDelegate : UIResponder <UIWindowSceneDelegate, RCTBridgeDelegate>
|
|
468
|
+
@end
|
|
469
|
+
|
|
470
|
+
#endif /* SceneDelegate_h */
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
``` objc
|
|
474
|
+
// SceneDelegate.mm
|
|
475
|
+
|
|
476
|
+
#import "SceneDelegate.h"
|
|
477
|
+
|
|
478
|
+
#import <React/RCTBridge.h>
|
|
479
|
+
#import <React/RCTBundleURLProvider.h>
|
|
480
|
+
#import <React/RCTRootView.h>
|
|
481
|
+
|
|
482
|
+
#import <React/RCTAppSetupUtils.h>
|
|
483
|
+
|
|
484
|
+
@implementation SceneDelegate
|
|
485
|
+
|
|
486
|
+
#if defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
487
|
+
|
|
488
|
+
@synthesize window = _window;
|
|
489
|
+
|
|
490
|
+
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions API_AVAILABLE(ios(13.0)){
|
|
491
|
+
RCTAppSetupPrepareApp([ UIApplication sharedApplication]);
|
|
492
|
+
// ...
|
|
493
|
+
// other react native setup code
|
|
494
|
+
// ...
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
499
|
+
{
|
|
500
|
+
#if DEBUG
|
|
501
|
+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
|
502
|
+
#else
|
|
503
|
+
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
|
|
504
|
+
#endif
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
#endif
|
|
508
|
+
|
|
509
|
+
@end
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
``` objc
|
|
514
|
+
// AppDelegate.mm
|
|
515
|
+
// Other imports...
|
|
516
|
+
#import "SceneDelegate.h"
|
|
517
|
+
|
|
518
|
+
@implementation AppDelegate
|
|
519
|
+
|
|
520
|
+
#if defined(__IPHONE_13_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
521
|
+
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options API_AVAILABLE(ios(13.0)){
|
|
522
|
+
UISceneConfiguration *configuration = [[UISceneConfiguration alloc] init];
|
|
523
|
+
configuration.delegateClass = SceneDelegate.class;
|
|
524
|
+
|
|
525
|
+
return configuration;
|
|
526
|
+
}
|
|
527
|
+
#endif
|
|
528
|
+
|
|
529
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
|
|
530
|
+
[self _prepareForPushNotifications];
|
|
531
|
+
[RNSelligent configureWithLaunchOptions:launchOptions];
|
|
532
|
+
//
|
|
533
|
+
|
|
534
|
+
if (@available(iOS 13.0, *)) {
|
|
535
|
+
return YES;
|
|
536
|
+
}
|
|
537
|
+
// ...
|
|
538
|
+
//react native setup code
|
|
539
|
+
// ...
|
|
540
|
+
|
|
541
|
+
return YES;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
// Other AppDelegate methods, as defined above...
|
|
546
|
+
|
|
547
|
+
@end
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
#### Geolocation
|
|
552
|
+
|
|
553
|
+
For geolocation services, follow section [**Geolocation**](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/master/Documentation#geolocation), of the native documentation. You also need to configure several permissions described [**here**](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/master/Documentation#permission-for-geolocation).
|
|
554
|
+
|
|
408
555
|
#### Deeplinking
|
|
409
556
|
|
|
410
557
|
You can catch the deeplinks 2 ways:
|
|
411
558
|
|
|
412
|
-
1. Native in AppDelegate.
|
|
559
|
+
1. Native in AppDelegate.mm, add the following (example code that logs the URL)
|
|
413
560
|
|
|
414
561
|
```
|
|
415
562
|
-(BOOL)application:(UIApplication*) application openURL:(NSURL*) url sourceApplication:(NSString*) sourceApplication annotation:(id) annotation
|
|
@@ -533,6 +680,10 @@ You can catch the deeplinks 2 ways:
|
|
|
533
680
|
|
|
534
681
|
- [Selligent.getVersionLib(successCallback)](#selligentgetversionlibsuccesscallback)
|
|
535
682
|
- [getVersionLib example](#getversionlib-example)
|
|
683
|
+
- [Selligent.enableGeolocation(successCallback, errorCallback, enabled)](#selligentenablegeolocationsuccesscallback-errorcallback-enabled)
|
|
684
|
+
- [enableGeolocation example](#enablegeolocation-example)
|
|
685
|
+
- [Selligent.isGeolocationEnabled(successCallback)](#selligentisgeolocationenabledsuccesscallback)
|
|
686
|
+
- [isGeolocationEnabled example](#isgeolocationenabled-example)
|
|
536
687
|
- [Selligent.getDeviceId(successCallback)](#selligentgetdeviceidsuccesscallback)
|
|
537
688
|
- [getDeviceId example](#getdeviceid-example)
|
|
538
689
|
- [Selligent.enableNotifications(successCallback, errorCallback, enabled)](#selligentenablenotificationssuccesscallback-errorcallback-enabled)
|
|
@@ -599,6 +750,8 @@ You can catch the deeplinks 2 ways:
|
|
|
599
750
|
- [SelligentConstants.RemoteMessagesDisplayType](#selligentconstantsremotemessagesdisplaytype)
|
|
600
751
|
- [SelligentConstants.iOSLogLevel](#selligentconstantsiosloglevel)
|
|
601
752
|
- [SelligentConstants.iOSBackgroundFetchResult](#selligentconstantsiosbackgroundfetchresult)
|
|
753
|
+
- [SelligentConstants.iOSLocationAuthorisationStatus](#selligentconstantsioslocationauthorisationstatus)
|
|
754
|
+
- [SelligentConstants.iOSLocationAuthorisationType](#selligentconstantsioslocationauthorisationtype)
|
|
602
755
|
- [SelligentConstants.EventType](#selligentconstantseventtype)
|
|
603
756
|
- [SelligentConstants.iOSNotificationButtonType](#selligentconstantsiosnotificationbuttontype)
|
|
604
757
|
- [SelligentConstants.BroadcastEventType](#selligentconstantsbroadcasteventtype)
|
|
@@ -624,6 +777,50 @@ Selligent.getVersionLib((versionLib) => {
|
|
|
624
777
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
625
778
|
</div>
|
|
626
779
|
|
|
780
|
+
#### Selligent.enableGeolocation(successCallback, errorCallback, enabled)
|
|
781
|
+
|
|
782
|
+
Enable or disable geolocation services.
|
|
783
|
+
|
|
784
|
+
The `enabled` parameter is a required boolean to enable or disable geolocation services.
|
|
785
|
+
|
|
786
|
+
##### enableGeolocation example
|
|
787
|
+
|
|
788
|
+
```javascript
|
|
789
|
+
Selligent.enableGeolocation(
|
|
790
|
+
(response) => { // success callback
|
|
791
|
+
...
|
|
792
|
+
},
|
|
793
|
+
(error) => { // error callback
|
|
794
|
+
...
|
|
795
|
+
},
|
|
796
|
+
true
|
|
797
|
+
);
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
<div align="right">
|
|
801
|
+
<b><a href="#api-reference">back to API ToC</a></b>
|
|
802
|
+
</div>
|
|
803
|
+
|
|
804
|
+
#### Selligent.isGeolocationEnabled(successCallback)
|
|
805
|
+
|
|
806
|
+
Check if geolocation services are enabled or disabled.
|
|
807
|
+
|
|
808
|
+
The response of the success callback is a boolean stating geolocation services are enabled or disabled.
|
|
809
|
+
|
|
810
|
+
##### isGeolocationEnabled example
|
|
811
|
+
|
|
812
|
+
```javascript
|
|
813
|
+
Selligent.isGeolocationEnabled(
|
|
814
|
+
(response) => { // success callback
|
|
815
|
+
...
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
<div align="right">
|
|
821
|
+
<b><a href="#api-reference">back to API ToC</a></b>
|
|
822
|
+
</div>
|
|
823
|
+
|
|
627
824
|
#### Selligent.getDeviceId(successCallback)
|
|
628
825
|
|
|
629
826
|
Returns the device id.
|
|
@@ -1491,6 +1688,34 @@ Description of the possible results of a background fetch on iOS.
|
|
|
1491
1688
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1492
1689
|
</div>
|
|
1493
1690
|
|
|
1691
|
+
#### SelligentConstants.iOSLocationAuthorisationStatus
|
|
1692
|
+
|
|
1693
|
+
Description of the possible status of use of location services on a device.
|
|
1694
|
+
|
|
1695
|
+
| Name | Type | Value | Description |
|
|
1696
|
+
| -------------- | ------ | ----- | ----------------------------------------------- |
|
|
1697
|
+
| UNKNOWN | number | 70 | Status of use of location services is unknown |
|
|
1698
|
+
| REFUSED | number | 71 | Use of location services is refused |
|
|
1699
|
+
| GRANTED_IN_USE | number | 72 | Use of location services is granted when in use |
|
|
1700
|
+
| GRANTED_ALWAYS | number | 72 | Use of location services is always granted |
|
|
1701
|
+
|
|
1702
|
+
<div align="right">
|
|
1703
|
+
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1704
|
+
</div>
|
|
1705
|
+
|
|
1706
|
+
#### SelligentConstants.iOSLocationAuthorisationType
|
|
1707
|
+
|
|
1708
|
+
Defines the level of request for the authorisation of usage of location services on a device.
|
|
1709
|
+
|
|
1710
|
+
| Name | Type | Value | Description |
|
|
1711
|
+
| ------ | ------ | ----- | --------------------------------------------------------- |
|
|
1712
|
+
| IN_USE | number | 80 | Request authorisation when location services are in use |
|
|
1713
|
+
| ALWAYS | number | 81 | Always request the authorisation of the location services |
|
|
1714
|
+
|
|
1715
|
+
<div align="right">
|
|
1716
|
+
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1717
|
+
</div>
|
|
1718
|
+
|
|
1494
1719
|
#### SelligentConstants.EventType
|
|
1495
1720
|
|
|
1496
1721
|
Defines the type of an event.
|
package/RNSelligent.podspec
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automatically generated file. DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
package com.selligent;
|
|
5
|
+
|
|
6
|
+
public final class BuildConfig {
|
|
7
|
+
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
|
+
public static final String LIBRARY_PACKAGE_NAME = "com.selligent";
|
|
9
|
+
public static final String BUILD_TYPE = "debug";
|
|
10
|
+
// Selligent settings
|
|
11
|
+
public static final String SELLIGENT_SETTINGS = "{\"url\":\"https://mobile.emsecure.net/mobilepush/api/\",\"clientId\":\"4acaf646-ef68-4b78-9a30-8412d3007cba\",\"privateKey\":\"TzYgBoYF+I1fZ+1Tapdpz+XQXKyLUZocDzmWV1kBYHKIQ8WWWXL61/m7FWo8mY6hSrAMVUoH1EaViq7+dgQ9Jg==\",\"fullyQualifiedNotificationActivityClassName\":\"com.selligentdevapprn.MainActivity\",\"inAppMessageRefreshType\":11,\"configureLocationServices\":true,\"notificationSmallIcon\":\"ic_notification\",\"notificationLargeIcon\":\"ic_notification\",\"notificationIconColor\":\"#FF0000\",\"appGroupId\":\"group.be.appfoundry.selligent.reactnative.development.app\",\"notificationChannelId\":\"SMChannel001\",\"notificationChannelName\":\"SMDefaultChannel\",\"notificationChannelDescription\":\"\",\"shouldClearBadge\":true,\"shouldDisplayRemoteNotification\":true,\"clearCacheIntervalValue\":1}";
|
|
12
|
+
}
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"artifactType": {
|
|
4
|
+
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
|
|
5
|
+
"kind": "Directory"
|
|
6
|
+
},
|
|
7
|
+
"applicationId": "com.selligent",
|
|
8
|
+
"variantName": "debug",
|
|
9
|
+
"elements": [
|
|
10
|
+
{
|
|
11
|
+
"type": "SINGLE",
|
|
12
|
+
"filters": [],
|
|
13
|
+
"attributes": [],
|
|
14
|
+
"outputFile": "AndroidManifest.xml"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"elementType": "File"
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
Binary file
|