@selligent-marketing-cloud/selligent-react-native 3.0.0 → 3.2.6
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 +43 -1550
- package/RNSelligent.podspec +8 -15
- package/android/build.gradle +48 -81
- package/android/src/main/java/com/selligent/BroadcastEventType.java +4 -1
- package/android/src/main/java/com/selligent/ButtonAction.java +81 -0
- package/android/src/main/java/com/selligent/ButtonBroadcastEventDataParser.java +9 -3
- package/android/src/main/java/com/selligent/DeviceIdBroadcastEventDataParser.java +15 -0
- package/android/src/main/java/com/selligent/EventType.java +1 -1
- package/android/src/main/java/com/selligent/GCMTokenBroadcastEventDataParser.java +6 -1
- package/android/src/main/java/com/selligent/InAppMessageBroadcastEventDataParser.java +7 -1
- package/android/src/main/java/com/selligent/NotificationMessageBroadcastEventDataParser.java +19 -0
- package/android/src/main/java/com/selligent/RNSelligent.java +195 -56
- package/android/src/main/java/com/selligent/SMSettingsFactory.java +0 -1
- package/android/src/main/java/com/selligent/Settings.java +0 -9
- package/constants.d.ts +7 -33
- package/constants.js +51 -85
- package/documentation/README.md +826 -0
- package/helpers.js +5 -6
- package/index.android.js +8 -83
- package/index.d.ts +33 -43
- package/index.ios.js +25 -76
- package/index.js +153 -45
- package/ios/RNSelligentMapper.h +21 -0
- package/ios/RNSelligentMapper.m +151 -0
- package/ios/RNSelligentMobileSDK.xcframework/Info.plist +40 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Headers/RNSelligentMobileSDK-Swift.h +350 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Info.plist +0 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.abi.json +2603 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +59 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.swiftinterface +59 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/module.modulemap +4 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/RNSelligentMobileSDK +0 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/_CodeSignature/CodeResources +179 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Headers/RNSelligentMobileSDK-Swift.h +696 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Info.plist +0 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +2603 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +59 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +59 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +2603 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +59 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +59 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/module.modulemap +4 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/RNSelligentMobileSDK +0 -0
- package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/_CodeSignature/CodeResources +234 -0
- package/package.json +30 -11
- package/.gitattributes +0 -1
- package/CHANGELOG.md +0 -60
- package/android/README.md +0 -15
- package/android/build/generated/source/buildConfig/debug/com/selligent/BuildConfig.java +0 -12
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -9
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- 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 +0 -6548
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- 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 +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -11
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -9
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- 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 +0 -4894
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -25
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/libs/sdk-release.aar +0 -0
- package/documentation/add_json_file.png +0 -0
- package/documentation/add_lib_file.png +0 -0
- package/ios/BackgroundFetchResult.h +0 -5
- package/ios/ClearCacheInterval.h +0 -7
- package/ios/ClientSettings.h +0 -22
- package/ios/ClientSettings.m +0 -39
- package/ios/EnumMapper.h +0 -36
- package/ios/EnumMapper.m +0 -121
- package/ios/Event+SMEvent.h +0 -13
- package/ios/Event+SMEvent.m +0 -41
- package/ios/Event.h +0 -12
- package/ios/Event.m +0 -24
- package/ios/EventType.h +0 -7
- package/ios/InAppMessageRefreshType.h +0 -6
- package/ios/InAppMessageSettings.h +0 -9
- package/ios/InAppMessageSettings.m +0 -19
- package/ios/LocationAuthorisationStatus.h +0 -6
- package/ios/LocationAuthorisationType.h +0 -4
- package/ios/LogLevel.h +0 -9
- package/ios/NotificationButtonType.h +0 -15
- package/ios/ParsableObject.h +0 -5
- package/ios/RNSelligent.h +0 -22
- package/ios/RNSelligent.m +0 -347
- package/ios/RemoteMessageDisplayType.h +0 -5
- package/ios/SMManagerSetting+ClientSettings.h +0 -9
- package/ios/SMManagerSetting+ClientSettings.m +0 -73
- package/ios/SelligentLogger.h +0 -7
- package/ios/SelligentLogger.m +0 -9
- package/ios/SelligentReactNative.xcodeproj/project.pbxproj +0 -446
- package/ios/include/SMBaseMessage.h +0 -48
- package/ios/include/SMBlock.h +0 -21
- package/ios/include/SMClearCache.h +0 -34
- package/ios/include/SMContentAlignment.h +0 -27
- package/ios/include/SMDeviceInfos.h +0 -38
- package/ios/include/SMDisplayMode.h +0 -27
- package/ios/include/SMEvent.h +0 -69
- package/ios/include/SMEventUser.h +0 -20
- package/ios/include/SMEventUserLogin.h +0 -42
- package/ios/include/SMEventUserLogout.h +0 -42
- package/ios/include/SMEventUserRegistration.h +0 -42
- package/ios/include/SMEventUserUnregistration.h +0 -42
- package/ios/include/SMFailure.h +0 -19
- package/ios/include/SMHelper.h +0 -51
- package/ios/include/SMInAppContentHTMLViewController.h +0 -59
- package/ios/include/SMInAppContentImageViewController.h +0 -36
- package/ios/include/SMInAppContentMessage.h +0 -56
- package/ios/include/SMInAppContentStyleOptions.h +0 -511
- package/ios/include/SMInAppContentType.h +0 -35
- package/ios/include/SMInAppContentURLViewController.h +0 -36
- package/ios/include/SMInAppContentViewController.h +0 -31
- package/ios/include/SMInAppMessage.h +0 -51
- package/ios/include/SMInAppMessageType.h +0 -50
- package/ios/include/SMInAppRefreshType.h +0 -29
- package/ios/include/SMLink.h +0 -39
- package/ios/include/SMLog.h +0 -54
- package/ios/include/SMManager+DataTransaction.h +0 -33
- package/ios/include/SMManager+InAppContent.h +0 -170
- package/ios/include/SMManager+InAppMessage.h +0 -172
- package/ios/include/SMManager+Location.h +0 -41
- package/ios/include/SMManager+Log.h +0 -31
- package/ios/include/SMManager+RemoteNotification.h +0 -171
- package/ios/include/SMManager+SMEvent.h +0 -67
- package/ios/include/SMManager+SMLink.h +0 -44
- package/ios/include/SMManager+SilentPush.h +0 -53
- package/ios/include/SMManager+StyleOptions.h +0 -36
- package/ios/include/SMManager+UserNotification.h +0 -180
- package/ios/include/SMManager+ViewController.h +0 -45
- package/ios/include/SMManager.h +0 -69
- package/ios/include/SMManagerHelper.h +0 -18
- package/ios/include/SMManagerInAppMessageDelegate.h +0 -24
- package/ios/include/SMManagerSetting+Location.h +0 -27
- package/ios/include/SMManagerSetting.h +0 -180
- package/ios/include/SMManagerSettingIAC.h +0 -48
- package/ios/include/SMManagerSettingIAM.h +0 -49
- package/ios/include/SMManagerUniversalLinksDelegate.h +0 -23
- package/ios/include/SMMessage.h +0 -21
- package/ios/include/SMNSNotification.h +0 -81
- package/ios/include/SMNotificationAnnotationData.h +0 -33
- package/ios/include/SMNotificationButtonData.h +0 -20
- package/ios/include/SMNotificationButtonType.h +0 -90
- package/ios/include/SMNotificationMessage.h +0 -31
- package/ios/include/SMRemoteMessageDisplayType.h +0 -32
- package/ios/include/SMSuccess.h +0 -16
- package/ios/libSelligentMobile.a +0 -0
- package/trigger.yml +0 -9
package/RNSelligent.podspec
CHANGED
|
@@ -4,25 +4,18 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
4
4
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
6
|
s.name = "RNSelligent"
|
|
7
|
-
s.authors =
|
|
7
|
+
s.authors = package['author']
|
|
8
8
|
s.version = package["version"]
|
|
9
9
|
s.summary = package["description"]
|
|
10
|
-
s.description =
|
|
11
|
-
|
|
12
|
-
DESC
|
|
13
|
-
s.homepage = "https://github.com/SelligentMarketingCloud/MobileSDK-ReactNative"
|
|
10
|
+
s.description = "React Native wrapper for the Selligent Marketing Cloud Android and iOS SDKs"
|
|
11
|
+
s.homepage = package['homepage']
|
|
14
12
|
s.license = "MIT"
|
|
15
13
|
s.platform = :ios, "11.0"
|
|
16
14
|
s.source = { :git => "https://github.com/SelligentMarketingCloud/MobileSDK-ReactNative.git", :tag => "#{s.version}" }
|
|
17
15
|
|
|
18
|
-
s.
|
|
19
|
-
s.
|
|
20
|
-
|
|
21
|
-
s.vendored_libraries = "ios/libSelligentMobile.a"
|
|
22
|
-
s.libraries = "SelligentMobile"
|
|
23
|
-
|
|
24
|
-
s.dependency "React"
|
|
25
|
-
s.dependency "PlotPlugin"
|
|
26
|
-
end
|
|
27
|
-
|
|
16
|
+
s.vendored_frameworks = "ios/RNSelligentMobileSDK.xcframework"
|
|
17
|
+
s.source_files = "ios/*.{h,m}"
|
|
28
18
|
|
|
19
|
+
s.dependency "React-Core"
|
|
20
|
+
s.dependency "SelligentMobileSDK/Framework", "3.4.0"
|
|
21
|
+
end
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import com.android.build.api.variant.BuildConfigField
|
|
2
|
+
import java.util.regex.*
|
|
2
3
|
|
|
3
4
|
apply plugin: 'com.android.library'
|
|
4
|
-
apply plugin: 'maven-publish'
|
|
5
5
|
|
|
6
6
|
buildscript {
|
|
7
7
|
repositories {
|
|
@@ -10,48 +10,28 @@ buildscript {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
dependencies {
|
|
13
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
def buildTypeAttr = Attribute.of("com.android.build.api.attributes.BuildTypeAttr", String)
|
|
18
|
-
|
|
19
|
-
dependencies.attributesSchema {
|
|
20
|
-
// registers this attribute to the attributes schema
|
|
21
|
-
attribute(buildTypeAttr)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
configurations {
|
|
25
|
-
implementation {
|
|
26
|
-
attributes {
|
|
27
|
-
attribute(buildTypeAttr, "release")
|
|
28
|
-
}
|
|
13
|
+
classpath 'com.android.tools.build:gradle:4.2.2'
|
|
29
14
|
}
|
|
30
15
|
}
|
|
31
16
|
|
|
32
17
|
android {
|
|
33
|
-
compileSdkVersion
|
|
18
|
+
compileSdkVersion 33
|
|
34
19
|
|
|
35
20
|
defaultConfig {
|
|
36
21
|
minSdkVersion 21
|
|
37
|
-
targetSdkVersion
|
|
38
|
-
ndkVersion = "21.4.7075529"
|
|
39
|
-
versionCode 1
|
|
40
|
-
versionName "1.0"
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
lintOptions {
|
|
44
|
-
abortOnError false
|
|
22
|
+
targetSdkVersion 33
|
|
45
23
|
}
|
|
46
24
|
}
|
|
47
25
|
|
|
48
26
|
androidComponents {
|
|
49
27
|
onVariants(selector(), { variant ->
|
|
50
28
|
def selligentSettings = loadSelligentSettings(variant)
|
|
29
|
+
|
|
51
30
|
if (selligentSettings != null) {
|
|
52
31
|
try {
|
|
53
32
|
variant.buildConfigFields.put("SELLIGENT_SETTINGS", new BuildConfigField("String", "\"" + selligentSettings + "\"", "Selligent settings"))
|
|
54
|
-
}
|
|
33
|
+
}
|
|
34
|
+
catch (Exception ignored) {
|
|
55
35
|
throw new Exception("Selligent requires Android Gradle plugin version 4.2.0 or higher.")
|
|
56
36
|
}
|
|
57
37
|
}
|
|
@@ -59,88 +39,75 @@ androidComponents {
|
|
|
59
39
|
}
|
|
60
40
|
|
|
61
41
|
repositories {
|
|
42
|
+
mavenCentral()
|
|
62
43
|
maven {
|
|
63
44
|
url "$projectDir/../node_modules/react-native/android"
|
|
64
45
|
}
|
|
65
|
-
|
|
46
|
+
google()
|
|
66
47
|
}
|
|
67
48
|
|
|
68
49
|
dependencies {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
implementation 'com.
|
|
74
|
-
implementation 'com.google.code.gson:gson:2.
|
|
75
|
-
implementation 'com.google.firebase:firebase-messaging:
|
|
76
|
-
implementation 'androidx.work:work-runtime:2.
|
|
50
|
+
api ('com.facebook.react:react-native:+') {
|
|
51
|
+
exclude group:'com.facebook.fbjni'
|
|
52
|
+
exclude group:'com.facebook.yoga'
|
|
53
|
+
}
|
|
54
|
+
implementation 'com.selligent.sdk:selligent_mobile_sdk:4.1.0'
|
|
55
|
+
implementation 'com.google.code.gson:gson:2.9.0'
|
|
56
|
+
implementation 'com.google.firebase:firebase-messaging:23.0.8'
|
|
57
|
+
implementation 'androidx.work:work-runtime:2.8.1'
|
|
77
58
|
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
|
|
78
59
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
afterEvaluate { project ->
|
|
82
|
-
|
|
83
|
-
task androidJavadoc(type: Javadoc) {
|
|
84
|
-
source = android.sourceSets.main.java.srcDirs
|
|
85
|
-
classpath += files(android.bootClasspath)
|
|
86
|
-
project.getConfigurations().getByName('implementation').setCanBeResolved(true)
|
|
87
|
-
classpath += files(project.getConfigurations().getByName('implementation').asList())
|
|
88
|
-
include '**/*.java'
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
|
92
|
-
archiveClassifier = 'javadoc'
|
|
93
|
-
from androidJavadoc.destinationDir
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
task androidSourcesJar(type: Jar) {
|
|
97
|
-
classifier = 'sources'
|
|
98
|
-
from android.sourceSets.main.java.srcDirs
|
|
99
|
-
include '**/*.java'
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
android.libraryVariants.all { variant ->
|
|
103
|
-
def name = variant.name.capitalize()
|
|
104
|
-
task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) {
|
|
105
|
-
from variant.javaCompileProvider.get().destinationDir
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
publishing {
|
|
110
|
-
publications {
|
|
111
|
-
maven(MavenPublication) {
|
|
112
|
-
artifact androidSourcesJar
|
|
113
|
-
artifact androidJavadocJar
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
60
|
+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
|
|
61
|
+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
|
|
117
62
|
}
|
|
118
63
|
|
|
119
64
|
def loadSelligentSettings(variant) {
|
|
120
|
-
|
|
121
|
-
|
|
65
|
+
def currentFlavor = getCurrentFlavor()
|
|
122
66
|
def defaultSelligentFileName = "selligent.json"
|
|
123
67
|
File defaultFile = new File("$project.rootDir/../$defaultSelligentFileName")
|
|
124
68
|
|
|
69
|
+
if (currentFlavor !== "") {
|
|
70
|
+
defaultFile = new File("$project.rootDir/../$currentFlavor/$defaultSelligentFileName")
|
|
71
|
+
}
|
|
72
|
+
|
|
125
73
|
def variantSelligentFileName = "selligent.${variant.getName()}.json"
|
|
126
|
-
File variantFile = new File("$project.rootDir/../$variantSelligentFileName")
|
|
74
|
+
File variantFile = new File("$project.rootDir/../$variantSelligentFileName")
|
|
127
75
|
|
|
128
76
|
def resultingSettings = null
|
|
77
|
+
|
|
129
78
|
if (variantFile.exists()) {
|
|
130
79
|
println("Reading Selligent properties for variant ${variant.getName()} using $variantSelligentFileName")
|
|
131
80
|
resultingSettings = ""
|
|
81
|
+
|
|
132
82
|
variantFile.eachLine { String line ->
|
|
133
83
|
resultingSettings += line.replace("\"", "\\\"").replaceAll("\\s", "")
|
|
134
84
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
85
|
+
}
|
|
86
|
+
else if (defaultFile.exists()) {
|
|
87
|
+
println("Reading Selligent properties from default ${defaultFile.name} (no variant specific $variantSelligentFileName was found)")
|
|
137
88
|
resultingSettings = ""
|
|
89
|
+
|
|
138
90
|
defaultFile.eachLine { String line ->
|
|
139
91
|
resultingSettings += line.replace("\"", "\\\"").replaceAll("\\s", "")
|
|
140
92
|
}
|
|
141
|
-
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
142
95
|
throw new InvalidUserDataException("The selligent.json file could not be found. Please make sure you provide this file in the root of this project.")
|
|
143
96
|
}
|
|
144
97
|
|
|
145
98
|
return resultingSettings
|
|
146
|
-
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
def getCurrentFlavor() {
|
|
102
|
+
Gradle gradle = getGradle()
|
|
103
|
+
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()
|
|
104
|
+
Pattern pattern = Pattern.compile("(install|assemble)(\\w+)(Release|Debug)")
|
|
105
|
+
Matcher matcher = pattern.matcher(tskReqStr)
|
|
106
|
+
|
|
107
|
+
if (matcher.find()) {
|
|
108
|
+
return matcher.group(2).toLowerCase()
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return ""
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -7,7 +7,10 @@ enum BroadcastEventType {
|
|
|
7
7
|
ReceivedInAppMessage("ReceivedInAppMessage", SMManager.BROADCAST_EVENT_RECEIVED_IN_APP_MESSAGE),
|
|
8
8
|
WillDisplayNotification("WillDisplayNotification", SMManager.BROADCAST_EVENT_WILL_DISPLAY_NOTIFICATION),
|
|
9
9
|
WillDismissNotification("WillDismissNotification", SMManager.BROADCAST_EVENT_WILL_DISMISS_NOTIFICATION),
|
|
10
|
-
ReceivedGCMToken("ReceivedGCMToken", SMManager.BROADCAST_EVENT_RECEIVED_GCM_TOKEN)
|
|
10
|
+
ReceivedGCMToken("ReceivedGCMToken", SMManager.BROADCAST_EVENT_RECEIVED_GCM_TOKEN),
|
|
11
|
+
ReceivedNotification("ReceivedRemoteNotification", null),
|
|
12
|
+
ReceivedDeviceId("ReceivedDeviceId", null),
|
|
13
|
+
TriggeredCustomEvent("TriggeredCustomEvent", null);
|
|
11
14
|
|
|
12
15
|
private String broadcastEventType;
|
|
13
16
|
private String smBroadcastEventType;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
package com.selligent;
|
|
2
|
+
|
|
3
|
+
import com.selligent.sdk.SMLinkAction;
|
|
4
|
+
|
|
5
|
+
public enum ButtonAction
|
|
6
|
+
{
|
|
7
|
+
unknown(100),
|
|
8
|
+
phone(101),
|
|
9
|
+
sms(102),
|
|
10
|
+
mail(103),
|
|
11
|
+
url(104),
|
|
12
|
+
externalApp(105),
|
|
13
|
+
rateApp(106),
|
|
14
|
+
broadcastEvent(107),
|
|
15
|
+
passbook(111),
|
|
16
|
+
deeplink(112),
|
|
17
|
+
simple(113);
|
|
18
|
+
|
|
19
|
+
private final int buttonAction;
|
|
20
|
+
|
|
21
|
+
ButtonAction(int action) { this.buttonAction = action; }
|
|
22
|
+
|
|
23
|
+
public static ButtonAction valueOf(int x)
|
|
24
|
+
{
|
|
25
|
+
switch(x) {
|
|
26
|
+
case 101:
|
|
27
|
+
return phone;
|
|
28
|
+
case 102:
|
|
29
|
+
return sms;
|
|
30
|
+
case 103:
|
|
31
|
+
return mail;
|
|
32
|
+
case 104:
|
|
33
|
+
return url;
|
|
34
|
+
case 105:
|
|
35
|
+
return externalApp;
|
|
36
|
+
case 106:
|
|
37
|
+
return rateApp;
|
|
38
|
+
case 107:
|
|
39
|
+
return broadcastEvent;
|
|
40
|
+
case 111:
|
|
41
|
+
return passbook;
|
|
42
|
+
case 112:
|
|
43
|
+
return deeplink;
|
|
44
|
+
case 113:
|
|
45
|
+
return simple;
|
|
46
|
+
}
|
|
47
|
+
return unknown;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public static ButtonAction valueOf(SMLinkAction linkAction)
|
|
51
|
+
{
|
|
52
|
+
switch(linkAction) {
|
|
53
|
+
case phone:
|
|
54
|
+
return phone;
|
|
55
|
+
case sms:
|
|
56
|
+
return sms;
|
|
57
|
+
case mail:
|
|
58
|
+
return mail;
|
|
59
|
+
case url:
|
|
60
|
+
return url;
|
|
61
|
+
case externalApp:
|
|
62
|
+
return externalApp;
|
|
63
|
+
case rateApp:
|
|
64
|
+
return rateApp;
|
|
65
|
+
case broadcastEvent:
|
|
66
|
+
return broadcastEvent;
|
|
67
|
+
case passbook:
|
|
68
|
+
return passbook;
|
|
69
|
+
case deeplink:
|
|
70
|
+
return deeplink;
|
|
71
|
+
case simple:
|
|
72
|
+
return simple;
|
|
73
|
+
}
|
|
74
|
+
return unknown;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public int getValue()
|
|
78
|
+
{
|
|
79
|
+
return buttonAction;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -10,14 +10,20 @@ import com.selligent.sdk.SMNotificationButton;
|
|
|
10
10
|
class ButtonBroadcastEventDataParser implements BroadcastEventDataParser {
|
|
11
11
|
@Override
|
|
12
12
|
public WritableMap parse(Intent intent) {
|
|
13
|
+
SMNotificationButton button = (SMNotificationButton)intent.getSerializableExtra(SMManager.BROADCAST_DATA_BUTTON);
|
|
14
|
+
|
|
15
|
+
return wrap(button);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public WritableMap wrap(SMNotificationButton button)
|
|
19
|
+
{
|
|
13
20
|
final WritableMap resultingMap = new WritableNativeMap();
|
|
14
21
|
|
|
15
|
-
SMNotificationButton button = (SMNotificationButton)intent.getSerializableExtra(SMManager.BROADCAST_DATA_BUTTON);
|
|
16
22
|
resultingMap.putString("id", button.id);
|
|
17
|
-
resultingMap.putInt("type", button.
|
|
23
|
+
resultingMap.putInt("type", ButtonAction.valueOf(button.action).getValue());
|
|
18
24
|
resultingMap.putString("value", button.value);
|
|
19
25
|
resultingMap.putString("label", button.label);
|
|
20
|
-
|
|
26
|
+
|
|
21
27
|
if (button.data != null) {
|
|
22
28
|
final WritableMap buttonData = new WritableNativeMap();
|
|
23
29
|
for(String dataKey : button.data.keySet()) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package com.selligent;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.bridge.WritableNativeMap;
|
|
5
|
+
|
|
6
|
+
class DeviceIdBroadcastEventDataParser {
|
|
7
|
+
|
|
8
|
+
public WritableMap wrap(String deviceId) {
|
|
9
|
+
final WritableMap resultingMap = new WritableNativeMap();
|
|
10
|
+
|
|
11
|
+
resultingMap.putString("deviceId", deviceId);
|
|
12
|
+
|
|
13
|
+
return resultingMap;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -9,9 +9,14 @@ import com.selligent.sdk.SMManager;
|
|
|
9
9
|
class GCMTokenBroadcastEventDataParser implements BroadcastEventDataParser {
|
|
10
10
|
@Override
|
|
11
11
|
public WritableMap parse(Intent intent) {
|
|
12
|
+
final String token = intent.getStringExtra(SMManager.BROADCAST_DATA_GCM_TOKEN);
|
|
13
|
+
|
|
14
|
+
return wrap(token);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public WritableMap wrap(String token) {
|
|
12
18
|
final WritableMap resultingMap = new WritableNativeMap();
|
|
13
19
|
|
|
14
|
-
final String token = intent.getStringExtra(SMManager.BROADCAST_DATA_GCM_TOKEN);
|
|
15
20
|
resultingMap.putString("token", token);
|
|
16
21
|
|
|
17
22
|
return resultingMap;
|
|
@@ -12,9 +12,15 @@ import com.selligent.sdk.SMManager;
|
|
|
12
12
|
class InAppMessageBroadcastEventDataParser implements BroadcastEventDataParser {
|
|
13
13
|
@Override
|
|
14
14
|
public WritableMap parse(Intent intent) {
|
|
15
|
+
SMInAppMessage[] messages = (SMInAppMessage[])intent.getSerializableExtra(SMManager.BROADCAST_DATA_IN_APP_MESSAGES);
|
|
16
|
+
|
|
17
|
+
return wrap(messages);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public WritableMap wrap(SMInAppMessage[] messages)
|
|
21
|
+
{
|
|
15
22
|
final WritableMap resultingMap = new WritableNativeMap();
|
|
16
23
|
|
|
17
|
-
SMInAppMessage[] messages = (SMInAppMessage[])intent.getSerializableExtra(SMManager.BROADCAST_DATA_IN_APP_MESSAGES);
|
|
18
24
|
final WritableArray messageArray = new WritableNativeArray();
|
|
19
25
|
for (SMInAppMessage message : messages) {
|
|
20
26
|
WritableMap messageMap = new WritableNativeMap();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package com.selligent;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.WritableMap;
|
|
4
|
+
import com.facebook.react.bridge.WritableNativeMap;
|
|
5
|
+
import com.selligent.sdk.SMNotificationMessage;
|
|
6
|
+
|
|
7
|
+
class NotificationMessageBroadcastEventDataParser
|
|
8
|
+
{
|
|
9
|
+
public WritableMap wrap(SMNotificationMessage message)
|
|
10
|
+
{
|
|
11
|
+
final WritableMap resultingMap = new WritableNativeMap();
|
|
12
|
+
|
|
13
|
+
resultingMap.putString("pushId", message.getId());
|
|
14
|
+
resultingMap.putString("name", message.getNotificationTitle());
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
return resultingMap;
|
|
18
|
+
}
|
|
19
|
+
}
|