@selligent-marketing-cloud/selligent-react-native 2.4.0 → 2.8.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 +21 -0
- package/README.md +354 -245
- package/RNSelligent.podspec +4 -4
- 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 +16 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -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 +6408 -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/incremental/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/packageDebugResources/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 +16 -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 +4798 -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/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +43 -0
- package/android/build.gradle +38 -32
- package/android/libs/sdk-release.aar +0 -0
- package/android/src/main/java/com/selligent/RNSelligent.java +41 -3
- package/android/src/main/java/com/selligent/SMSettingsFactory.java +1 -0
- package/android/src/main/java/com/selligent/Settings.java +16 -0
- package/constants.d.ts +18 -0
- package/constants.js +30 -2
- package/index.android.js +42 -0
- package/index.d.ts +14 -6
- package/index.ios.js +12 -29
- package/index.js +13 -1
- package/ios/ClientSettings.h +2 -0
- package/ios/ClientSettings.m +4 -0
- package/ios/EnumMapper.h +3 -6
- package/ios/EnumMapper.m +8 -24
- package/ios/RNSelligent.m +25 -13
- package/ios/RemoteMessageDisplayType.h +5 -0
- package/ios/SMManagerSetting+ClientSettings.m +15 -4
- package/ios/SelligentReactNative.xcodeproj/project.pbxproj +4 -12
- package/ios/include/SMBaseMessage.h +8 -12
- package/ios/include/SMBlock.h +2 -2
- package/ios/include/SMClearCache.h +0 -2
- package/ios/include/SMContentAlignment.h +1 -2
- package/ios/include/SMDeviceInfos.h +10 -8
- package/ios/include/SMDisplayMode.h +1 -2
- package/ios/include/SMEvent.h +21 -17
- package/ios/include/SMEventUser.h +0 -1
- package/ios/include/SMEventUserLogin.h +11 -16
- package/ios/include/SMEventUserLogout.h +12 -16
- package/ios/include/SMEventUserRegistration.h +12 -17
- package/ios/include/SMEventUserUnregistration.h +12 -16
- package/ios/include/SMFailure.h +1 -6
- package/ios/include/SMHelper.h +12 -4
- package/ios/include/SMInAppContentHTMLViewController.h +11 -9
- package/ios/include/SMInAppContentImageViewController.h +6 -6
- package/ios/include/SMInAppContentMessage.h +12 -12
- package/ios/include/SMInAppContentStyleOptions.h +91 -79
- package/ios/include/SMInAppContentType.h +2 -3
- package/ios/include/SMInAppContentURLViewController.h +10 -9
- package/ios/include/SMInAppContentViewController.h +3 -6
- package/ios/include/SMInAppMessage.h +22 -14
- package/ios/include/SMInAppMessageType.h +2 -6
- package/ios/include/SMInAppRefreshType.h +1 -1
- package/ios/include/SMLink.h +7 -11
- package/ios/include/SMLog.h +1 -1
- package/ios/include/SMManager+DataTransaction.h +6 -13
- package/ios/include/SMManager+InAppContent.h +20 -23
- package/ios/include/SMManager+InAppMessage.h +65 -42
- package/ios/include/SMManager+Location.h +7 -63
- package/ios/include/SMManager+Log.h +3 -14
- package/ios/include/SMManager+RemoteNotification.h +38 -34
- package/ios/include/SMManager+SMEvent.h +10 -10
- package/ios/include/SMManager+SMLink.h +44 -0
- package/ios/include/SMManager+SilentPush.h +5 -22
- package/ios/include/SMManager+StyleOptions.h +5 -8
- package/ios/include/SMManager+UserNotification.h +47 -35
- package/ios/include/SMManager+ViewController.h +45 -0
- package/ios/include/SMManager.h +15 -24
- package/ios/include/SMManagerInAppMessageDelegate.h +24 -0
- package/ios/include/SMManagerSetting+Location.h +27 -0
- package/ios/include/SMManagerSetting.h +61 -33
- package/ios/include/SMManagerSettingIAC.h +6 -17
- package/ios/include/SMManagerSettingIAM.h +7 -16
- package/ios/include/SMManagerUniversalLinksDelegate.h +23 -0
- package/ios/include/SMMessage.h +1 -3
- package/ios/include/SMNSNotification.h +21 -13
- package/ios/include/SMNotificationAnnotationData.h +4 -8
- package/ios/include/SMNotificationButtonData.h +1 -6
- package/ios/include/SMNotificationButtonType.h +1 -14
- package/ios/include/SMNotificationMessage.h +31 -0
- package/ios/include/SMRemoteMessageDisplayType.h +32 -0
- package/ios/include/SMSuccess.h +1 -4
- package/ios/{libSelligentMobile2.5.2.a → libSelligentMobile.a} +0 -0
- package/package.json +3 -3
- package/trigger.yml +9 -0
- package/ios/include/SMLocationAuthorisationType.h +0 -57
package/README.md
CHANGED
|
@@ -4,22 +4,29 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
4
4
|
|
|
5
5
|
## Supported platforms
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
- Android
|
|
8
|
+
- iOS
|
|
9
9
|
|
|
10
|
-
> _**Important:** Since version 2.
|
|
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
|
+
This module uses the native Selligent SDKs:
|
|
13
|
+
|
|
14
|
+
| SDK | Version |
|
|
15
|
+
| ----------------------------------------------------------------------- | ------- |
|
|
16
|
+
| [Android](https://github.com/SelligentMarketingCloud/MobileSDK-Android) | 3.8.1 |
|
|
17
|
+
| [iOS](https://github.com/SelligentMarketingCloud/MobileSDK-iOS) | 2.7.2 |
|
|
11
18
|
|
|
12
19
|
## ToC
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
- [Installation](#installation)
|
|
22
|
+
- [Android Specific Installation](#android-specific-installation)
|
|
23
|
+
- [iOS Specific Installation](#ios-specific-installation)
|
|
24
|
+
- [Using the API](#using-the-api)
|
|
25
|
+
- [API Reference](#api-reference)
|
|
26
|
+
- [Methods](#methods)
|
|
27
|
+
- [Android Only/Specific Methods](#android-onlyspecific-methods)
|
|
28
|
+
- [iOS Only/Specific Methods](#ios-onlyspecific-methods)
|
|
29
|
+
- [Constants](#constants)
|
|
23
30
|
|
|
24
31
|
## Installation
|
|
25
32
|
|
|
@@ -33,10 +40,10 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
33
40
|
|
|
34
41
|
```json
|
|
35
42
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
"url": "someMobilePushUrl",
|
|
44
|
+
"clientId": "someClientId",
|
|
45
|
+
"privateKey": "somePrivateKey",
|
|
46
|
+
"fullyQualifiedNotificationActivityClassName": "com.some.project.MainActivity"
|
|
40
47
|
}
|
|
41
48
|
```
|
|
42
49
|
|
|
@@ -44,28 +51,69 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
44
51
|
|
|
45
52
|
**Detailed overview:**
|
|
46
53
|
|
|
47
|
-
| Property | Type
|
|
48
|
-
| ------------------------------------------- |
|
|
49
|
-
| url | string
|
|
50
|
-
| clientId | string
|
|
51
|
-
| privateKey | string
|
|
52
|
-
| clearCacheIntervalValue | enum [Selligent.ClearCacheIntervalValue](#selligentclearcacheintervalvalue)
|
|
53
|
-
| configureLocationServices | boolean
|
|
54
|
-
| inAppMessageRefreshType | enum [Selligent.InAppMessageRefreshType](#selligentinappmessagerefreshtype)
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
| Property | Type | Required | Platform |
|
|
55
|
+
| ------------------------------------------- | ------------------------------------------------------------------------------- | -------- | ------------ |
|
|
56
|
+
| url | string | Yes | Both |
|
|
57
|
+
| clientId | string | Yes | Both |
|
|
58
|
+
| privateKey | string | Yes | Both |
|
|
59
|
+
| clearCacheIntervalValue | enum [Selligent.ClearCacheIntervalValue](#selligentclearcacheintervalvalue) | No | Both |
|
|
60
|
+
| configureLocationServices | boolean | No | Both |
|
|
61
|
+
| inAppMessageRefreshType | enum [Selligent.InAppMessageRefreshType](#selligentinappmessagerefreshtype) | No | Both |
|
|
62
|
+
| addInAppMessageFromPushToInAppMessageList | boolean | No | Both |
|
|
63
|
+
| remoteMessageDisplayType | enum [Selligent.RemoteMessagesDisplayType](#selligentremotemessagesdisplaytype) | No | Both |
|
|
64
|
+
| appGroupId | string | No | iOS Only |
|
|
65
|
+
| shouldClearBadge | boolean | No | iOS Only |
|
|
66
|
+
| shouldDisplayRemoteNotification | boolean | No | iOS Only |
|
|
67
|
+
| shouldPerformBackgroundFetch | boolean | No | iOS Only |
|
|
68
|
+
| doNotListenToThePush | boolean | No | Android Only |
|
|
69
|
+
| doNotFetchTheToken | boolean | No | Android Only |
|
|
70
|
+
| loadCacheAsynchronously | boolean | No | Android Only |
|
|
71
|
+
| fullyQualifiedNotificationActivityClassName | string | No | Android Only |
|
|
72
|
+
| notificationIconColor | string | No | Android Only |
|
|
73
|
+
|
|
74
|
+
|
|
66
75
|
|
|
67
76
|
### Android Specific Installation
|
|
68
77
|
|
|
78
|
+
> ### **Atention for Huawei developers!**
|
|
79
|
+
>
|
|
80
|
+
> In order to use this module on Huawei devices (without Goggle Play services), you should add the following dependencies in the `build.gradle` files of the Android project in your React Native project:
|
|
81
|
+
>
|
|
82
|
+
> In your Android project's root `build.gradle` file:
|
|
83
|
+
>
|
|
84
|
+
> ```gradle
|
|
85
|
+
>
|
|
86
|
+
> buildscript {
|
|
87
|
+
> repositories {
|
|
88
|
+
> maven { url 'https://developer.huawei.com/repo/' }
|
|
89
|
+
> }
|
|
90
|
+
> dependencies {
|
|
91
|
+
> classpath 'com.huawei.agconnect:agcp:1.6.0.300'
|
|
92
|
+
> }
|
|
93
|
+
> }
|
|
94
|
+
>
|
|
95
|
+
> allProjects: {
|
|
96
|
+
> repositories: {
|
|
97
|
+
> maven { url 'https://developer.huawei.com/repo/' }
|
|
98
|
+
> }
|
|
99
|
+
> }
|
|
100
|
+
>
|
|
101
|
+
> ```
|
|
102
|
+
>
|
|
103
|
+
> In your app module's `build.gradle` file:
|
|
104
|
+
>
|
|
105
|
+
> ```gradle
|
|
106
|
+
>
|
|
107
|
+
> apply plugin: 'com.huawei.agconnect'
|
|
108
|
+
>
|
|
109
|
+
> dependencies {
|
|
110
|
+
> api 'com.huawei.hms:base:6.2.0.300'
|
|
111
|
+
> api 'com.huawei.hms:push:6.1.0.300'
|
|
112
|
+
> api 'com.huawei.hms:maps:6.2.0.301'
|
|
113
|
+
> }
|
|
114
|
+
>
|
|
115
|
+
> ```
|
|
116
|
+
|
|
69
117
|
<details>
|
|
70
118
|
<summary>Without autolinking (RN 0.59 and below)</summary>
|
|
71
119
|
|
|
@@ -78,13 +126,17 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
78
126
|
project(':selligent-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@selligent-marketing-cloud/selligent-react-native/android')
|
|
79
127
|
```
|
|
80
128
|
|
|
81
|
-
3. Add the following in the `android/build.gradle` file:
|
|
129
|
+
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:
|
|
82
130
|
|
|
83
131
|
```groovy
|
|
132
|
+
// android/build.gradle
|
|
133
|
+
|
|
84
134
|
buildscript {
|
|
85
135
|
...
|
|
86
136
|
dependencies {
|
|
87
137
|
...
|
|
138
|
+
// Make sure your Gradle plugin version is >= 4.2.0
|
|
139
|
+
classpath("com.android.tools.build:gradle:4.2.0")
|
|
88
140
|
// Add the following:
|
|
89
141
|
classpath 'com.google.gms:google-services:4.3.3'
|
|
90
142
|
}
|
|
@@ -106,6 +158,13 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
106
158
|
}
|
|
107
159
|
```
|
|
108
160
|
|
|
161
|
+
```groovy
|
|
162
|
+
// android/gradle/wrapper/gradle-wrapper.properties
|
|
163
|
+
...
|
|
164
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
|
165
|
+
...
|
|
166
|
+
```
|
|
167
|
+
|
|
109
168
|
4. Add the following in the `android/app/build.gradle` file:
|
|
110
169
|
|
|
111
170
|
```groovy
|
|
@@ -133,7 +192,7 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
133
192
|
...
|
|
134
193
|
@Override
|
|
135
194
|
protected List<ReactPackage> getPackages() {
|
|
136
|
-
|
|
195
|
+
|
|
137
196
|
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
138
197
|
// Add the following:
|
|
139
198
|
packages.add(new RNSelligentPackage());
|
|
@@ -166,13 +225,17 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
166
225
|
project(':selligent-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@selligent-marketing-cloud/selligent-react-native/android')
|
|
167
226
|
```
|
|
168
227
|
|
|
169
|
-
3. Add the following in the `android/build.gradle` file:
|
|
228
|
+
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:
|
|
170
229
|
|
|
171
230
|
```groovy
|
|
231
|
+
// android/build.gradle
|
|
232
|
+
|
|
172
233
|
buildscript {
|
|
173
234
|
...
|
|
174
235
|
dependencies {
|
|
175
236
|
...
|
|
237
|
+
// Make sure your Gradle plugin version is >= 4.2.0
|
|
238
|
+
classpath("com.android.tools.build:gradle:4.2.0")
|
|
176
239
|
// Add the following:
|
|
177
240
|
classpath 'com.google.gms:google-services:4.3.3'
|
|
178
241
|
}
|
|
@@ -194,6 +257,13 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
194
257
|
}
|
|
195
258
|
```
|
|
196
259
|
|
|
260
|
+
```groovy
|
|
261
|
+
// android/gradle/wrapper/gradle-wrapper.properties
|
|
262
|
+
...
|
|
263
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
|
264
|
+
...
|
|
265
|
+
```
|
|
266
|
+
|
|
197
267
|
4. Add the following in the `android/app/build.gradle` file:
|
|
198
268
|
|
|
199
269
|
```groovy
|
|
@@ -223,7 +293,6 @@ This module provides an API for the usage of the Selligent SDK in React Native.
|
|
|
223
293
|
|
|
224
294
|
</details>
|
|
225
295
|
|
|
226
|
-
|
|
227
296
|
#### Change default push notification icons
|
|
228
297
|
|
|
229
298
|
Add the following properties to the `selligent.json` file:
|
|
@@ -235,7 +304,6 @@ Add the following properties to the `selligent.json` file:
|
|
|
235
304
|
|
|
236
305
|
> _Note: only parse the name of the icon, without the path. The icon should reside in the res/drawable folder of the Android project, as explained in [Android's official guide](https://developer.android.com/guide/topics/resources/drawable-resource#BitmapFile)._
|
|
237
306
|
|
|
238
|
-
|
|
239
307
|
### iOS Specific installation
|
|
240
308
|
|
|
241
309
|
<details>
|
|
@@ -255,17 +323,9 @@ Add the following properties to the `selligent.json` file:
|
|
|
255
323
|
|
|
256
324
|
4. Add Selligent to `Header Search Paths` in `Build Settings` of your target:
|
|
257
325
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
4. Add Selligent to `Header Search Paths` in `Build Settings` of your target:
|
|
265
|
-
|
|
266
|
-
```
|
|
267
|
-
$(SRCROOT)/../node_modules/@selligent-marketing-cloud/selligent-react-native/ios/
|
|
268
|
-
```
|
|
326
|
+
```
|
|
327
|
+
$(SRCROOT)/../node_modules/@selligent-marketing-cloud/selligent-react-native/ios/
|
|
328
|
+
```
|
|
269
329
|
|
|
270
330
|
5. Create a `Podfile` (if there isn't one already) in the `/ios` folder and add the following:
|
|
271
331
|
|
|
@@ -305,13 +365,11 @@ Add the following properties to the `selligent.json` file:
|
|
|
305
365
|
|
|
306
366
|
</details>
|
|
307
367
|
|
|
308
|
-
|
|
309
|
-
|
|
310
368
|
#### Push notifications
|
|
311
369
|
|
|
312
370
|
1. For push notifications you need to delegate some of the `AppDelegate.m` methods to the SDK:
|
|
313
371
|
|
|
314
|
-
|
|
372
|
+
```objective-c
|
|
315
373
|
#import "AppDelegate.h"
|
|
316
374
|
#import <React/RCTBundleURLProvider.h>
|
|
317
375
|
#import <React/RCTRootView.h>
|
|
@@ -372,22 +430,24 @@ Add the following properties to the `selligent.json` file:
|
|
|
372
430
|
#endif
|
|
373
431
|
|
|
374
432
|
@end
|
|
375
|
-
|
|
433
|
+
```
|
|
376
434
|
|
|
377
|
-
2. Follow section
|
|
435
|
+
2. Follow section [**Create an APNS Key**](https://github.com/SelligentMarketingCloud/MobileSDK-iOS/tree/master/Documentation#apns_key), of the native documentation.
|
|
378
436
|
|
|
379
437
|
3. If you want rich push notifications, follow section 6.9 **Notification Extensions** as well.
|
|
380
438
|
Make sure you add your `appGroupId` to the `selligent.json`.
|
|
381
439
|
> **IMPORTANT!** make sure your `appGroupId` has the following structure or it will not work: `group.{MAIN_APP_BUNDLE_ID}`
|
|
382
440
|
|
|
383
|
-
#### Geolocation
|
|
441
|
+
#### Geolocation
|
|
384
442
|
|
|
385
|
-
For geolocation services, follow section
|
|
443
|
+
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).
|
|
386
444
|
|
|
387
445
|
#### Deeplinking
|
|
446
|
+
|
|
388
447
|
You can catch the deeplinks 2 ways:
|
|
389
448
|
|
|
390
449
|
1. Native in AppDelegate.m, add the following (example code that logs the URL)
|
|
450
|
+
|
|
391
451
|
```
|
|
392
452
|
-(BOOL)application:(UIApplication*) application openURL:(NSURL*) url sourceApplication:(NSString*) sourceApplication annotation:(id) annotation
|
|
393
453
|
{
|
|
@@ -405,13 +465,13 @@ You can catch the deeplinks 2 ways:
|
|
|
405
465
|
1. Add the `Button` import statement:
|
|
406
466
|
|
|
407
467
|
```javascript
|
|
408
|
-
import {Platform, StyleSheet, Text, View, Button} from
|
|
468
|
+
import { Platform, StyleSheet, Text, View, Button } from "react-native"; // Add Button import
|
|
409
469
|
```
|
|
410
470
|
|
|
411
471
|
2. Add the `Selligent` import statement:
|
|
412
472
|
|
|
413
473
|
```javascript
|
|
414
|
-
import Selligent from
|
|
474
|
+
import Selligent from "@selligent-marketing-cloud/selligent-react-native"; // Add Selligent import
|
|
415
475
|
```
|
|
416
476
|
|
|
417
477
|
3. Add a function to call the `Selligent.getVersionLib` function:
|
|
@@ -449,138 +509,142 @@ You can catch the deeplinks 2 ways:
|
|
|
449
509
|
5. Your `App.js` file should look something like this:
|
|
450
510
|
|
|
451
511
|
```javascript
|
|
452
|
-
import React, {Component} from
|
|
453
|
-
import {Platform, StyleSheet, Text, View, Button} from
|
|
454
|
-
import Selligent from
|
|
512
|
+
import React, { Component } from "react";
|
|
513
|
+
import { Platform, StyleSheet, Text, View, Button } from "react-native"; // Add Button import
|
|
514
|
+
import Selligent from "@selligent-marketing-cloud/selligent-react-native"; // Add Selligent import
|
|
455
515
|
|
|
456
516
|
const instructions = Platform.select({
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
517
|
+
ios: "Press Cmd+R to reload,\n" + "Cmd+D or shake for dev menu",
|
|
518
|
+
android:
|
|
519
|
+
"Double tap R on your keyboard to reload,\n" +
|
|
520
|
+
"Shake or press menu button for dev menu",
|
|
461
521
|
});
|
|
462
522
|
|
|
463
523
|
type Props = {};
|
|
464
524
|
export default class App extends Component<Props> {
|
|
525
|
+
// Add example function
|
|
526
|
+
_getVersionLib() {
|
|
527
|
+
Selligent.getVersionLib((versionLib) => {
|
|
528
|
+
alert(versionLib);
|
|
529
|
+
});
|
|
530
|
+
}
|
|
465
531
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
// Add button
|
|
480
|
-
<Button
|
|
481
|
-
onPress={this._getVersionLib}
|
|
482
|
-
title='getVersionLib'
|
|
483
|
-
/>
|
|
484
|
-
</View>
|
|
485
|
-
);
|
|
486
|
-
}
|
|
532
|
+
render() {
|
|
533
|
+
return (
|
|
534
|
+
<View style={styles.container}>
|
|
535
|
+
<Text style={styles.welcome}>Welcome to React Native!</Text>
|
|
536
|
+
<Text style={styles.instructions}>
|
|
537
|
+
To get started, edit App.js
|
|
538
|
+
</Text>
|
|
539
|
+
<Text style={styles.instructions}>{instructions}</Text>
|
|
540
|
+
// Add button
|
|
541
|
+
<Button onPress={this._getVersionLib} title="getVersionLib" />
|
|
542
|
+
</View>
|
|
543
|
+
);
|
|
544
|
+
}
|
|
487
545
|
}
|
|
488
546
|
|
|
489
547
|
const styles = StyleSheet.create({
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
548
|
+
container: {
|
|
549
|
+
flex: 1,
|
|
550
|
+
justifyContent: "center",
|
|
551
|
+
alignItems: "center",
|
|
552
|
+
backgroundColor: "#F5FCFF",
|
|
553
|
+
},
|
|
554
|
+
welcome: {
|
|
555
|
+
fontSize: 20,
|
|
556
|
+
textAlign: "center",
|
|
557
|
+
margin: 10,
|
|
558
|
+
},
|
|
559
|
+
instructions: {
|
|
560
|
+
textAlign: "center",
|
|
561
|
+
color: "#333333",
|
|
562
|
+
marginBottom: 5,
|
|
563
|
+
},
|
|
506
564
|
});
|
|
507
565
|
```
|
|
508
566
|
|
|
509
567
|
## API Reference
|
|
510
568
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
569
|
+
- [Methods](#methods)
|
|
570
|
+
|
|
571
|
+
- [Selligent.getVersionLib(successCallback)](#selligentgetversionlibsuccesscallback)
|
|
572
|
+
- [getVersionLib example](#getversionlib-example)
|
|
573
|
+
- [Selligent.enableGeolocation(successCallback, errorCallback, enabled)](#selligentenablegeolocationsuccesscallback-errorcallback-enabled)
|
|
574
|
+
- [enableGeolocation example](#enablegeolocation-example)
|
|
575
|
+
- [Selligent.isGeolocationEnabled(successCallback)](#selligentisgeolocationenabledsuccesscallback)
|
|
576
|
+
- [isGeolocationEnabled example](#isgeolocationenabled-example)
|
|
577
|
+
- [Selligent.getDeviceId(successCallback)](#selligentgetdeviceidsuccesscallback)
|
|
578
|
+
- [getDeviceId example](#getdeviceid-example)
|
|
579
|
+
- [Selligent.enableNotifications(successCallback, errorCallback, enabled)](#selligentenablenotificationssuccesscallback-errorcallback-enabled)
|
|
580
|
+
- [enableNotifications example](#enablenotifications-example)
|
|
581
|
+
- [Selligent.displayLastReceivedRemotePushNotification(successCallback)](#selligentdisplaylastreceivedremotepushnotificationsuccesscallback)
|
|
582
|
+
- [displayLastReceivedRemotePushNotification example](#displaylastreceivedremotepushnotification-example)
|
|
583
|
+
- [Selligent.getLastRemotePushNotification(successCallback)](#selligentgetlastremotepushnotificationsuccesscallback)
|
|
584
|
+
- [getLastRemotePushNotification Example](#getlastremotepushnotification-example)
|
|
585
|
+
- [Selligent.enableInAppMessages(successCallback, errorCallback, enabled)](#selligentenableinappmessagessuccesscallback-errorcallback-enabled)
|
|
586
|
+
- [enableInAppMessages example](#enableinappmessages-example)
|
|
587
|
+
- [Selligent.getInAppMessages(successCallback)](#selligentgetinappmessagessuccesscallback)
|
|
588
|
+
- [getInAppMessages example](#getinappmessages-example)
|
|
589
|
+
- [Selligent.setInAppMessageAsSeen(successCallback, errorCallback, messageId)](#selligentsetinappmessageasseensuccesscallback-errorcallback-messageid)
|
|
590
|
+
- [setInAppMessageAsSeen example](#setinappmessageasseen-example)
|
|
591
|
+
- [Selligent.executeButtonAction(successCallback, errorCallback, buttonId, messageId)](#selligentexecutebuttonactionsuccesscallback-errorcallback-buttonid-messageid)
|
|
592
|
+
- [executeButtonAction example](#executeButtonAction-example)
|
|
593
|
+
- [Selligent.sendEvent(successCallback, errorCallback, event)](#selligentsendeventsuccesscallback-errorcallback-event)
|
|
594
|
+
- [sendEvent example](#sendevent-example)
|
|
595
|
+
- [Selligent.subscribeToEvents(successCallback, errorCallback, eventCallback)](#selligentsubscribetoeventssuccesscallback-errorcallback-eventcallback)
|
|
596
|
+
- [subscribeToEvents example](#subscribetoevents-example)
|
|
597
|
+
|
|
598
|
+
- [Android Only/Specific Methods](#android-onlyspecific-methods)
|
|
599
|
+
|
|
600
|
+
- [Selligent.subscribeToEvent(eventCallback, eventName)](#selligentsubscribetoeventeventcallback-eventname)
|
|
601
|
+
- [subscribeToEvent example](#subscribetoevent-example)
|
|
602
|
+
- [Selligent.areInAppMessagesEnabled(successCallback)](#selligentareinappmessagesenabledsuccesscallback)
|
|
603
|
+
- [areInAppMessagesEnabled example](#areinappmessagesenabled-example)
|
|
604
|
+
- [Selligent.enableAndroidLogging(successCallback, errorCallback, enabled)](#selligentenableandroidloggingsuccesscallback-errorcallback-enabled)
|
|
605
|
+
- [enableAndroidLogging example](#enableandroidlogging-example)
|
|
606
|
+
- [Selligent.displayMessage(successCallback, errorCallback, messageId)](#selligentdisplaymessagesuccesscallback-errorcallback-messageid)
|
|
607
|
+
- [displayMessage example](#displaymessage-example)
|
|
608
|
+
- [Selligent.areNotificationsEnabled(successCallback)](#selligentarenotificationsenabledsuccesscallback)
|
|
609
|
+
- [areNotificationsEnabled example](#arenotificationsenabled-example)
|
|
610
|
+
- [Selligent.setNotificationSmallIcon(successCallback, errorCallback, iconName)](#selligentsetnotificationsmalliconsuccesscallback-errorcallback-iconname)
|
|
611
|
+
- [setNotificationSmallIcon example](#setnotificationsmallicon-example)
|
|
612
|
+
- [Selligent.setNotificationLargeIcon(successCallback, errorCallback, iconName)](#selligentsetnotificationlargeiconsuccesscallback-errorcallback-iconname)
|
|
613
|
+
- [setNotificationLargeIcon example](#setnotificationlargeicon-example)
|
|
614
|
+
- [Selligent.setNotificationIconColor(successCallback, errorCallback, color)](#selligentsetnotificationiconcolorsuccesscallback-errorcallback-color)
|
|
615
|
+
- [setNotificationIconColor example](#setnotificationiconcolor-example)
|
|
616
|
+
- [Selligent.getGCMToken(successCallback)](#selligentgetgcmtokensuccesscallback)
|
|
617
|
+
- [getGCMToken Example](#getgcmtoken-example)
|
|
618
|
+
- [Selligent.getRemoteMessagesDisplayType(successCallback, errorCallback)](#selligentgetremotemessagesdisplaytypesuccesscallback-errorcallback)
|
|
619
|
+
- [getRemoteMessagesDisplayType Example](#getremotemessagesdisplaytype-example)
|
|
620
|
+
- [Selligent.setFirebaseToken(successCallback, errorCallback, token)](#selligentsetfirebasetokensuccesscallback--errorcallback--token)
|
|
621
|
+
- [setFirebaseToken Example](#setFirebaseToken-example)
|
|
622
|
+
|
|
623
|
+
- [iOS Only/Specific Methods](#ios-onlyspecific-methods)
|
|
624
|
+
|
|
625
|
+
- [Selligent.enableiOSLogging(successCallback, errorCallback, logLevels)](#selligentenableiosloggingsuccesscallback-errorcallback-loglevels)
|
|
626
|
+
- [enableiOSLogging example](#enableioslogging-example)
|
|
627
|
+
- [Selligent.displayNotification(successCallback, errorCallback, notificationId)](#selligentdisplaynotificationsuccesscallback-errorcallback-notificationid)
|
|
628
|
+
- [displayNotification Example](#displaynotification-example)
|
|
629
|
+
- [Selligent.registerForProvisionalRemoteNotification(successCallback)](#selligentregisterforprovisionalremotenotificationsuccesscallback)
|
|
630
|
+
- [registerForProvisionalRemoteNotification example](#registerForProvisionalRemoteNotification-example)
|
|
631
|
+
- [Selligent.registerRemoteNotificationFetchCompletionHandler(successCallback, errorCallback)](#selligentregisterremotenotificationfetchcompletionhandlersuccesscallback-errorcallback)
|
|
632
|
+
- [registerRemoteNotificationFetchCompletionHandler example](#registerremotenotificationfetchcompletionhandler-example)
|
|
633
|
+
- [Selligent.forceRemoteNotificationBackgroundFetchResult(successCallback, errorCallback, iOSBackgroundFetchResult)](#selligentforceremotenotificationbackgroundfetchresultsuccesscallback-errorcallback-iosbackgroundfetchresult)
|
|
634
|
+
- [forceRemoteNotificationBackgroundFetchResult example](#forceremotenotificationbackgroundfetchresult-example)
|
|
635
|
+
|
|
636
|
+
- [Constants](#constants)
|
|
637
|
+
- [SelligentConstants.ClearCacheIntervalValue](#selligentconstantsclearcacheintervalvalue)
|
|
638
|
+
- [SelligentConstants.InAppMessageType](#selligentconstantsinappmessagetype)
|
|
639
|
+
- [SelligentConstants.InAppMessageRefreshType](#selligentconstantsinappmessagerefreshtype)
|
|
640
|
+
- [SelligentConstants.RemoteMessagesDisplayType](#selligentconstantsremotemessagesdisplaytype)
|
|
641
|
+
- [SelligentConstants.iOSLogLevel](#selligentconstantsiosloglevel)
|
|
642
|
+
- [SelligentConstants.iOSBackgroundFetchResult](#selligentconstantsiosbackgroundfetchresult)
|
|
643
|
+
- [SelligentConstants.iOSLocationAuthorisationStatus](#selligentconstantsioslocationauthorisationstatus)
|
|
644
|
+
- [SelligentConstants.iOSLocationAuthorisationType](#selligentconstantsioslocationauthorisationtype)
|
|
645
|
+
- [SelligentConstants.EventType](#selligentconstantseventtype)
|
|
646
|
+
- [SelligentConstants.iOSNotificationButtonType](#selligentconstantsiosnotificationbuttontype)
|
|
647
|
+
- [SelligentConstants.BroadcastEventType](#selligentconstantsbroadcasteventtype)
|
|
584
648
|
|
|
585
649
|
### Methods
|
|
586
650
|
|
|
@@ -593,18 +657,16 @@ The response of the success callback is a string containing the version of the S
|
|
|
593
657
|
##### getVersionLib example
|
|
594
658
|
|
|
595
659
|
```javascript
|
|
596
|
-
Selligent.getVersionLib(
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
);
|
|
660
|
+
Selligent.getVersionLib((versionLib) => {
|
|
661
|
+
// success callback
|
|
662
|
+
alert(versionLib);
|
|
663
|
+
});
|
|
601
664
|
```
|
|
602
665
|
|
|
603
666
|
<div align="right">
|
|
604
667
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
605
668
|
</div>
|
|
606
669
|
|
|
607
|
-
|
|
608
670
|
#### Selligent.enableGeolocation(successCallback, errorCallback, enabled)
|
|
609
671
|
|
|
610
672
|
Enable or disable geolocation services.
|
|
@@ -649,6 +711,25 @@ Selligent.isGeolocationEnabled(
|
|
|
649
711
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
650
712
|
</div>
|
|
651
713
|
|
|
714
|
+
#### Selligent.getDeviceId(successCallback)
|
|
715
|
+
|
|
716
|
+
Returns the device id.
|
|
717
|
+
|
|
718
|
+
The response of the success callback is a string containing the device id.
|
|
719
|
+
|
|
720
|
+
##### getDeviceId example
|
|
721
|
+
|
|
722
|
+
```javascript
|
|
723
|
+
Selligent.getDeviceId((deviceId) => {
|
|
724
|
+
// success callback
|
|
725
|
+
alert(deviceId);
|
|
726
|
+
});
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
<div align="right">
|
|
730
|
+
<b><a href="#api-reference">back to API ToC</a></b>
|
|
731
|
+
</div>
|
|
732
|
+
|
|
652
733
|
#### Selligent.enableNotifications(successCallback, errorCallback, enabled)
|
|
653
734
|
|
|
654
735
|
Enable or disable the usage of notifications.
|
|
@@ -767,16 +848,17 @@ The response of the success callback is an array of objects which contain the in
|
|
|
767
848
|
|
|
768
849
|
**Detailed overview:**
|
|
769
850
|
|
|
770
|
-
| Property
|
|
771
|
-
|
|
|
772
|
-
| id
|
|
773
|
-
| title
|
|
774
|
-
| body
|
|
775
|
-
|
|
|
776
|
-
|
|
|
777
|
-
|
|
|
778
|
-
|
|
|
779
|
-
|
|
|
851
|
+
| Property | Type | Description | Platform |
|
|
852
|
+
| -------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------- | -------- |
|
|
853
|
+
| id | string | Id of the in app message | Both |
|
|
854
|
+
| title | string | Title of the in app message | Both |
|
|
855
|
+
| body | string | Body of the in app message | Both |
|
|
856
|
+
| type | enum [SelligentConstants.InAppMessageType](#selligentconstantsinappmessagetype) | Type of the in app message | Both |
|
|
857
|
+
| creationDate | number | Creation date of the in app message in unix time | Both |
|
|
858
|
+
| expirationDate | number | Expiration date of the in app message in unix time | Both |
|
|
859
|
+
| receptionDate | number | Reception date of the in app message in unix time | Both |
|
|
860
|
+
| hasBeenSeen | boolean | Indication if the in app message is seen | Both |
|
|
861
|
+
| buttons | array of objects | Contains the buttons that are linked to the in app message | Both |
|
|
780
862
|
|
|
781
863
|
<br />
|
|
782
864
|
|
|
@@ -784,13 +866,13 @@ The `buttons` property is an array of button-objects which contain the informati
|
|
|
784
866
|
|
|
785
867
|
<br />
|
|
786
868
|
|
|
787
|
-
| Property
|
|
788
|
-
|
|
|
789
|
-
| id
|
|
790
|
-
| label
|
|
791
|
-
| value
|
|
792
|
-
| type
|
|
793
|
-
| action
|
|
869
|
+
| Property | Type | Description | Platform |
|
|
870
|
+
| -------- | ------ | ------------------------------------------ | ------------ |
|
|
871
|
+
| id | string | Id of the button of the in app message | Both |
|
|
872
|
+
| label | string | Label of the button of the in app message | Both |
|
|
873
|
+
| value | string | Value of the button of the in app message | Both |
|
|
874
|
+
| type | number | Type of the button of the in app message | Both |
|
|
875
|
+
| action | number | Action of the button of the in app message | Android only |
|
|
794
876
|
|
|
795
877
|
<br />
|
|
796
878
|
|
|
@@ -873,12 +955,12 @@ The method accepts an `event` object which requires certain properties, dependin
|
|
|
873
955
|
| data | object | Yes if event type is custom, optional if specific | Both | N/A |
|
|
874
956
|
| shouldCache | boolean | No | iOS Only | true |
|
|
875
957
|
|
|
876
|
-
The `type` property is used to define the event as
|
|
958
|
+
The `type` property is used to define the event as _custom_ or _specific_ event, using the [EventType](#selligenteventtype) constants.
|
|
877
959
|
|
|
878
960
|
To define it as a custom event, one should use the `SelligentConstants.EventType.CUSTOM` constant. All other event types can be used to define the event as something specific.
|
|
879
961
|
|
|
880
|
-
When an event is a
|
|
881
|
-
When an event is a
|
|
962
|
+
When an event is a _specific_ event type, the `event` object requires an `email` property containing a string, and has an optional property `data` which is an object that can contain other information.
|
|
963
|
+
When an event is a _custom_ event type, the `event` object requires a `data` property containing an object which contains other information, and ignores the `email` property.
|
|
882
964
|
|
|
883
965
|
**iOS specific:**
|
|
884
966
|
|
|
@@ -972,6 +1054,12 @@ And the detailed overview for items in the `messages` array is as such:
|
|
|
972
1054
|
| id | string | Id of a message |
|
|
973
1055
|
| title | string | Title of a message |
|
|
974
1056
|
|
|
1057
|
+
In case of a broadcast event type _ReceivedDeviceId_ the detailed overview for the `data` is as such:
|
|
1058
|
+
|
|
1059
|
+
| Property | Type | Description |
|
|
1060
|
+
| -------- | ------ | ------------- |
|
|
1061
|
+
| deviceId | string | The device id |
|
|
1062
|
+
|
|
975
1063
|
In case of a broadcast event type _ReceivedGCMToken_ the detailed overview for the `data` is as such:
|
|
976
1064
|
|
|
977
1065
|
| Property | Type | Description |
|
|
@@ -985,7 +1073,7 @@ In case of a broadcast event type _ReceivedRemoteNotification_ the detailed over
|
|
|
985
1073
|
| pushId | string | The id of the remote push notification |
|
|
986
1074
|
| name | string | The name attached to the push notification |
|
|
987
1075
|
|
|
988
|
-
In case of a broadcast event type _WillDisplayNotification_ or _WillDismissNotification_ the `data` prop is
|
|
1076
|
+
In case of a broadcast event type _WillDisplayNotification_ or _WillDismissNotification_ the `data` prop is `null`.
|
|
989
1077
|
|
|
990
1078
|
**Android specific:**
|
|
991
1079
|
|
|
@@ -1127,6 +1215,7 @@ Selligent.areNotificationsEnabled(
|
|
|
1127
1215
|
Set the small icon of a notification on Android.
|
|
1128
1216
|
|
|
1129
1217
|
The method accepts an `iconName` parameter which is a string containing the name of the small icon. When the application is closed it will default back to the icons specified in `selligent.json`.
|
|
1218
|
+
|
|
1130
1219
|
> _Note: only parse the name of the icon, without the path. The icon should reside in the res/drawable folder of the Android project, as explained in [Android's official guide](https://developer.android.com/guide/topics/resources/drawable-resource#BitmapFile)._
|
|
1131
1220
|
|
|
1132
1221
|
##### setNotificationSmallIcon example
|
|
@@ -1152,6 +1241,7 @@ Selligent.setNotificationSmallIcon(
|
|
|
1152
1241
|
Set the large icon of a notification on Android.
|
|
1153
1242
|
|
|
1154
1243
|
The method accepts an `iconName` parameter which is a string containing the name of the large icon. When the application is closed it will default back to the icons specified in `selligent.json`.
|
|
1244
|
+
|
|
1155
1245
|
> _Note: only parse the name of the icon, without the path. The icon should reside in the res/drawable folder of the Android project, as explained in [Android's official guide](https://developer.android.com/guide/topics/resources/drawable-resource#BitmapFile)._
|
|
1156
1246
|
|
|
1157
1247
|
##### setNotificationLargeIcon example
|
|
@@ -1172,6 +1262,32 @@ Selligent.setNotificationLargeIcon(
|
|
|
1172
1262
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1173
1263
|
</div>
|
|
1174
1264
|
|
|
1265
|
+
#### Selligent.setNotificationIconColor(successCallback, errorCallback, color)
|
|
1266
|
+
|
|
1267
|
+
Set the icon color of a notification on Android.
|
|
1268
|
+
|
|
1269
|
+
The method accepts a `color` parameter which is a string containing the hex value of color.
|
|
1270
|
+
|
|
1271
|
+
> _The notification color can also be set by setting the notificationIconColor parameter in `selligent.json` to the hex color value_
|
|
1272
|
+
|
|
1273
|
+
##### setNotificationIconColor example
|
|
1274
|
+
|
|
1275
|
+
```javascript
|
|
1276
|
+
Selligent.setNotificationIconColor(
|
|
1277
|
+
(response) => { // success callback
|
|
1278
|
+
...
|
|
1279
|
+
},
|
|
1280
|
+
(error) => { // error callback
|
|
1281
|
+
...
|
|
1282
|
+
},
|
|
1283
|
+
"#00b8fb"
|
|
1284
|
+
);
|
|
1285
|
+
```
|
|
1286
|
+
|
|
1287
|
+
<div align="right">
|
|
1288
|
+
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1289
|
+
</div>
|
|
1290
|
+
|
|
1175
1291
|
#### Selligent.getGCMToken(successCallback)
|
|
1176
1292
|
|
|
1177
1293
|
Get the GCM token being used.
|
|
@@ -1274,44 +1390,21 @@ Selligent.enableiOSLogging(
|
|
|
1274
1390
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1275
1391
|
</div>
|
|
1276
1392
|
|
|
1277
|
-
#### Selligent.
|
|
1278
|
-
|
|
1279
|
-
Get the current status of location authorisation.
|
|
1280
|
-
|
|
1281
|
-
The response of the success callback is a number corresponding with a constant of the [Selligent.iOSLocationAuthorisationStatus](#selligentioslocationauthorisationstatus) enum.
|
|
1282
|
-
|
|
1283
|
-
##### currentAuthorisationStatus Example
|
|
1284
|
-
|
|
1285
|
-
```javascript
|
|
1286
|
-
Selligent.currentAuthorisationStatus(
|
|
1287
|
-
(response) => { // success callback
|
|
1288
|
-
...
|
|
1289
|
-
}
|
|
1290
|
-
);
|
|
1291
|
-
```
|
|
1292
|
-
|
|
1293
|
-
<div align="right">
|
|
1294
|
-
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1295
|
-
</div>
|
|
1296
|
-
|
|
1297
|
-
#### Selligent.requestLocationAuthorisation(successCallback, errorCallback, iOSLocationAuthorisationType)
|
|
1298
|
-
|
|
1299
|
-
Request an authorisation of using location on a device.
|
|
1393
|
+
#### Selligent.displayNotification(successCallback, errorCallback, notificationId)
|
|
1300
1394
|
|
|
1301
|
-
|
|
1302
|
-
You can use constants of the [Selligent.iOSLocationAuthorisationType](#selligentioslocationauthorisationtype) enum to specify the authorisation request.
|
|
1395
|
+
Display a notification based on its id, which is a string that needs to be parsed in the method with the `notificationId` parameter.
|
|
1303
1396
|
|
|
1304
|
-
#####
|
|
1397
|
+
##### displayNotification Example
|
|
1305
1398
|
|
|
1306
1399
|
```javascript
|
|
1307
|
-
Selligent.
|
|
1400
|
+
Selligent.displayNotification(
|
|
1308
1401
|
(response) => { // success callback
|
|
1309
1402
|
...
|
|
1310
1403
|
},
|
|
1311
1404
|
(error) => { // error callback
|
|
1312
1405
|
...
|
|
1313
1406
|
},
|
|
1314
|
-
|
|
1407
|
+
"some notification id"
|
|
1315
1408
|
);
|
|
1316
1409
|
```
|
|
1317
1410
|
|
|
@@ -1319,21 +1412,17 @@ Selligent.requestLocationAuthorisation(
|
|
|
1319
1412
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1320
1413
|
</div>
|
|
1321
1414
|
|
|
1322
|
-
#### Selligent.
|
|
1415
|
+
#### Selligent.registerForProvisionalRemoteNotification(successCallback)
|
|
1323
1416
|
|
|
1324
|
-
|
|
1417
|
+
You can decide to first ask for the Provisional push authorization (which will provide a valid push token but will not show any prompt to the user) if you want to contact users that did not decide about the Push permission yet (you can call `enableNotifications` later and it will still display the push permission prompt to the user).
|
|
1325
1418
|
|
|
1326
|
-
#####
|
|
1419
|
+
##### registerForProvisionalRemoteNotification example
|
|
1327
1420
|
|
|
1328
1421
|
```javascript
|
|
1329
|
-
Selligent.
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
(error) => { // error callback
|
|
1334
|
-
...
|
|
1335
|
-
},
|
|
1336
|
-
"some notification id"
|
|
1422
|
+
Selligent.registerForProvisionalRemoteNotification(
|
|
1423
|
+
() => { // success callback
|
|
1424
|
+
...
|
|
1425
|
+
}
|
|
1337
1426
|
);
|
|
1338
1427
|
```
|
|
1339
1428
|
|
|
@@ -1407,6 +1496,25 @@ _Note: `ClearCacheIntervalValue.Android.DAY` is only used on Android and can not
|
|
|
1407
1496
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1408
1497
|
</div>
|
|
1409
1498
|
|
|
1499
|
+
#### SelligentConstants.InAppMessageType
|
|
1500
|
+
|
|
1501
|
+
Defines the type of the in-app messages.
|
|
1502
|
+
|
|
1503
|
+
| Name | Type | Value | Description |
|
|
1504
|
+
| -------- | ------ | ----- | ------------------------------- |
|
|
1505
|
+
| UNKNOWN | number | -2 | In App message of unknown type |
|
|
1506
|
+
| HIDDEN | number | -1 | In App message of hidden type |
|
|
1507
|
+
| ALERT | number | 0 | In App message of alert type |
|
|
1508
|
+
| HTML | number | 1 | In App message of html type |
|
|
1509
|
+
| URL | number | 2 | In App message of url type |
|
|
1510
|
+
| IMAGE | number | 3 | In App message of image type |
|
|
1511
|
+
| MAP | number | 4 | In App message of map type |
|
|
1512
|
+
| PASSBOOK | number | 5 | In App message of passbook type |
|
|
1513
|
+
|
|
1514
|
+
<div align="right">
|
|
1515
|
+
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1516
|
+
</div>
|
|
1517
|
+
|
|
1410
1518
|
#### SelligentConstants.InAppMessageRefreshType
|
|
1411
1519
|
|
|
1412
1520
|
Defines how often the SDK must retrieve the in-app messages.
|
|
@@ -1424,7 +1532,7 @@ _Note: `InAppMessageRefreshType.Android.MINUTE` is only used on Android and can
|
|
|
1424
1532
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1425
1533
|
</div>
|
|
1426
1534
|
|
|
1427
|
-
#### SelligentConstants.
|
|
1535
|
+
#### SelligentConstants.RemoteMessagesDisplayType
|
|
1428
1536
|
|
|
1429
1537
|
Defines if and how remote messages can be displayed on Android.
|
|
1430
1538
|
|
|
@@ -1547,6 +1655,7 @@ Defines the type of a broadcast event.
|
|
|
1547
1655
|
| RECEIVED_IN_APP_MESSAGE | string | "ReceivedInAppMessage" | An in-app message has been received |
|
|
1548
1656
|
| WILL_DISPLAY_NOTIFICATION | string | "WillDisplayNotification" | A notification will be displayed |
|
|
1549
1657
|
| WILL_DISMISS_NOTIFICATION | string | "WillDismissNotification" | A notification will be dismissed |
|
|
1658
|
+
| RECEIVED_DEVICE_ID | string | "ReceivedDeviceId" | A device id has been received |
|
|
1550
1659
|
| Android.RECEIVED_GCM_TOKEN | string | "ReceivedGCMToken" | A GCM token has been received (only on Android) |
|
|
1551
1660
|
| iOS.RECEIVED_REMOTE_NOTIFICATION | string | "ReceivedRemoteNotification" | A remote notification has been received (only on iOS) |
|
|
1552
1661
|
|
|
@@ -1554,4 +1663,4 @@ _Notes: `BroadcastEventType.Android.RECEIVED_GCM_TOKEN` is only used on Android
|
|
|
1554
1663
|
|
|
1555
1664
|
<div align="right">
|
|
1556
1665
|
<b><a href="#api-reference">back to API ToC</a></b>
|
|
1557
|
-
</div>
|
|
1666
|
+
</div>
|