@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.
Files changed (184) hide show
  1. package/README.md +43 -1550
  2. package/RNSelligent.podspec +8 -15
  3. package/android/build.gradle +48 -81
  4. package/android/src/main/java/com/selligent/BroadcastEventType.java +4 -1
  5. package/android/src/main/java/com/selligent/ButtonAction.java +81 -0
  6. package/android/src/main/java/com/selligent/ButtonBroadcastEventDataParser.java +9 -3
  7. package/android/src/main/java/com/selligent/DeviceIdBroadcastEventDataParser.java +15 -0
  8. package/android/src/main/java/com/selligent/EventType.java +1 -1
  9. package/android/src/main/java/com/selligent/GCMTokenBroadcastEventDataParser.java +6 -1
  10. package/android/src/main/java/com/selligent/InAppMessageBroadcastEventDataParser.java +7 -1
  11. package/android/src/main/java/com/selligent/NotificationMessageBroadcastEventDataParser.java +19 -0
  12. package/android/src/main/java/com/selligent/RNSelligent.java +195 -56
  13. package/android/src/main/java/com/selligent/SMSettingsFactory.java +0 -1
  14. package/android/src/main/java/com/selligent/Settings.java +0 -9
  15. package/constants.d.ts +7 -33
  16. package/constants.js +51 -85
  17. package/documentation/README.md +826 -0
  18. package/helpers.js +5 -6
  19. package/index.android.js +8 -83
  20. package/index.d.ts +33 -43
  21. package/index.ios.js +25 -76
  22. package/index.js +153 -45
  23. package/ios/RNSelligentMapper.h +21 -0
  24. package/ios/RNSelligentMapper.m +151 -0
  25. package/ios/RNSelligentMobileSDK.xcframework/Info.plist +40 -0
  26. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Headers/RNSelligentMobileSDK-Swift.h +350 -0
  27. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Info.plist +0 -0
  28. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.abi.json +2603 -0
  29. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +59 -0
  30. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  31. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios.swiftinterface +59 -0
  32. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/Modules/module.modulemap +4 -0
  33. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/RNSelligentMobileSDK +0 -0
  34. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64/RNSelligentMobileSDK.framework/_CodeSignature/CodeResources +179 -0
  35. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Headers/RNSelligentMobileSDK-Swift.h +696 -0
  36. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Info.plist +0 -0
  37. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +2603 -0
  38. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +59 -0
  39. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  40. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +59 -0
  41. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +2603 -0
  42. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +59 -0
  43. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  44. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/RNSelligentMobileSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +59 -0
  45. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/Modules/module.modulemap +4 -0
  46. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/RNSelligentMobileSDK +0 -0
  47. package/ios/RNSelligentMobileSDK.xcframework/ios-arm64_x86_64-simulator/RNSelligentMobileSDK.framework/_CodeSignature/CodeResources +234 -0
  48. package/package.json +30 -11
  49. package/.gitattributes +0 -1
  50. package/CHANGELOG.md +0 -60
  51. package/android/README.md +0 -15
  52. package/android/build/generated/source/buildConfig/debug/com/selligent/BuildConfig.java +0 -12
  53. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -9
  54. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
  55. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
  56. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  57. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  58. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  59. package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -6548
  60. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  61. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  62. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  63. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  64. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  65. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastDataFactory$1.class +0 -0
  66. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastDataFactory.class +0 -0
  67. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventDataParser.class +0 -0
  68. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventType.class +0 -0
  69. package/android/build/intermediates/javac/debug/classes/com/selligent/BuildConfig.class +0 -0
  70. package/android/build/intermediates/javac/debug/classes/com/selligent/ButtonBroadcastEventDataParser.class +0 -0
  71. package/android/build/intermediates/javac/debug/classes/com/selligent/ClearCacheIntervalValue.class +0 -0
  72. package/android/build/intermediates/javac/debug/classes/com/selligent/Event.class +0 -0
  73. package/android/build/intermediates/javac/debug/classes/com/selligent/EventReceiver.class +0 -0
  74. package/android/build/intermediates/javac/debug/classes/com/selligent/EventType.class +0 -0
  75. package/android/build/intermediates/javac/debug/classes/com/selligent/GCMTokenBroadcastEventDataParser.class +0 -0
  76. package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageBroadcastEventDataParser.class +0 -0
  77. package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageRefreshType.class +0 -0
  78. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$1.class +0 -0
  79. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$2.class +0 -0
  80. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$3.class +0 -0
  81. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$4.class +0 -0
  82. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$5.class +0 -0
  83. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent.class +0 -0
  84. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligentPackage.class +0 -0
  85. package/android/build/intermediates/javac/debug/classes/com/selligent/RemoteMessageDisplayType.class +0 -0
  86. package/android/build/intermediates/javac/debug/classes/com/selligent/SMEventFactory$1.class +0 -0
  87. package/android/build/intermediates/javac/debug/classes/com/selligent/SMEventFactory.class +0 -0
  88. package/android/build/intermediates/javac/debug/classes/com/selligent/SMSettingsFactory.class +0 -0
  89. package/android/build/intermediates/javac/debug/classes/com/selligent/Settings.class +0 -0
  90. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
  91. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -11
  92. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -9
  93. package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
  94. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
  95. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  96. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -4894
  97. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -25
  98. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  99. package/android/libs/sdk-release.aar +0 -0
  100. package/documentation/add_json_file.png +0 -0
  101. package/documentation/add_lib_file.png +0 -0
  102. package/ios/BackgroundFetchResult.h +0 -5
  103. package/ios/ClearCacheInterval.h +0 -7
  104. package/ios/ClientSettings.h +0 -22
  105. package/ios/ClientSettings.m +0 -39
  106. package/ios/EnumMapper.h +0 -36
  107. package/ios/EnumMapper.m +0 -121
  108. package/ios/Event+SMEvent.h +0 -13
  109. package/ios/Event+SMEvent.m +0 -41
  110. package/ios/Event.h +0 -12
  111. package/ios/Event.m +0 -24
  112. package/ios/EventType.h +0 -7
  113. package/ios/InAppMessageRefreshType.h +0 -6
  114. package/ios/InAppMessageSettings.h +0 -9
  115. package/ios/InAppMessageSettings.m +0 -19
  116. package/ios/LocationAuthorisationStatus.h +0 -6
  117. package/ios/LocationAuthorisationType.h +0 -4
  118. package/ios/LogLevel.h +0 -9
  119. package/ios/NotificationButtonType.h +0 -15
  120. package/ios/ParsableObject.h +0 -5
  121. package/ios/RNSelligent.h +0 -22
  122. package/ios/RNSelligent.m +0 -347
  123. package/ios/RemoteMessageDisplayType.h +0 -5
  124. package/ios/SMManagerSetting+ClientSettings.h +0 -9
  125. package/ios/SMManagerSetting+ClientSettings.m +0 -73
  126. package/ios/SelligentLogger.h +0 -7
  127. package/ios/SelligentLogger.m +0 -9
  128. package/ios/SelligentReactNative.xcodeproj/project.pbxproj +0 -446
  129. package/ios/include/SMBaseMessage.h +0 -48
  130. package/ios/include/SMBlock.h +0 -21
  131. package/ios/include/SMClearCache.h +0 -34
  132. package/ios/include/SMContentAlignment.h +0 -27
  133. package/ios/include/SMDeviceInfos.h +0 -38
  134. package/ios/include/SMDisplayMode.h +0 -27
  135. package/ios/include/SMEvent.h +0 -69
  136. package/ios/include/SMEventUser.h +0 -20
  137. package/ios/include/SMEventUserLogin.h +0 -42
  138. package/ios/include/SMEventUserLogout.h +0 -42
  139. package/ios/include/SMEventUserRegistration.h +0 -42
  140. package/ios/include/SMEventUserUnregistration.h +0 -42
  141. package/ios/include/SMFailure.h +0 -19
  142. package/ios/include/SMHelper.h +0 -51
  143. package/ios/include/SMInAppContentHTMLViewController.h +0 -59
  144. package/ios/include/SMInAppContentImageViewController.h +0 -36
  145. package/ios/include/SMInAppContentMessage.h +0 -56
  146. package/ios/include/SMInAppContentStyleOptions.h +0 -511
  147. package/ios/include/SMInAppContentType.h +0 -35
  148. package/ios/include/SMInAppContentURLViewController.h +0 -36
  149. package/ios/include/SMInAppContentViewController.h +0 -31
  150. package/ios/include/SMInAppMessage.h +0 -51
  151. package/ios/include/SMInAppMessageType.h +0 -50
  152. package/ios/include/SMInAppRefreshType.h +0 -29
  153. package/ios/include/SMLink.h +0 -39
  154. package/ios/include/SMLog.h +0 -54
  155. package/ios/include/SMManager+DataTransaction.h +0 -33
  156. package/ios/include/SMManager+InAppContent.h +0 -170
  157. package/ios/include/SMManager+InAppMessage.h +0 -172
  158. package/ios/include/SMManager+Location.h +0 -41
  159. package/ios/include/SMManager+Log.h +0 -31
  160. package/ios/include/SMManager+RemoteNotification.h +0 -171
  161. package/ios/include/SMManager+SMEvent.h +0 -67
  162. package/ios/include/SMManager+SMLink.h +0 -44
  163. package/ios/include/SMManager+SilentPush.h +0 -53
  164. package/ios/include/SMManager+StyleOptions.h +0 -36
  165. package/ios/include/SMManager+UserNotification.h +0 -180
  166. package/ios/include/SMManager+ViewController.h +0 -45
  167. package/ios/include/SMManager.h +0 -69
  168. package/ios/include/SMManagerHelper.h +0 -18
  169. package/ios/include/SMManagerInAppMessageDelegate.h +0 -24
  170. package/ios/include/SMManagerSetting+Location.h +0 -27
  171. package/ios/include/SMManagerSetting.h +0 -180
  172. package/ios/include/SMManagerSettingIAC.h +0 -48
  173. package/ios/include/SMManagerSettingIAM.h +0 -49
  174. package/ios/include/SMManagerUniversalLinksDelegate.h +0 -23
  175. package/ios/include/SMMessage.h +0 -21
  176. package/ios/include/SMNSNotification.h +0 -81
  177. package/ios/include/SMNotificationAnnotationData.h +0 -33
  178. package/ios/include/SMNotificationButtonData.h +0 -20
  179. package/ios/include/SMNotificationButtonType.h +0 -90
  180. package/ios/include/SMNotificationMessage.h +0 -31
  181. package/ios/include/SMRemoteMessageDisplayType.h +0 -32
  182. package/ios/include/SMSuccess.h +0 -16
  183. package/ios/libSelligentMobile.a +0 -0
  184. package/trigger.yml +0 -9
@@ -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 = { 'AppFoundry' => 'info@appfoundry.be' }
7
+ s.authors = package['author']
8
8
  s.version = package["version"]
9
9
  s.summary = package["description"]
10
- s.description = <<-DESC
11
- RNSelligent
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.source_files = "ios/**/*.{h,m}"
19
- s.requires_arc = true
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
@@ -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:7.2.2'
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 32
18
+ compileSdkVersion 33
34
19
 
35
20
  defaultConfig {
36
21
  minSdkVersion 21
37
- targetSdkVersion 32
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
- } catch (MissingMethodException ignored) {
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
- mavenCentral()
46
+ google()
66
47
  }
67
48
 
68
49
  dependencies {
69
- implementation(name: 'sdk-release', ext: 'aar')
70
-
71
- implementation 'com.facebook.react:react-native:+'
72
- implementation 'com.android.support:cardview-v7:27.1.1'
73
- implementation 'com.plotprojects:plot-android:3.13.1'
74
- implementation 'com.google.code.gson:gson:2.8.9'
75
- implementation 'com.google.firebase:firebase-messaging:21.0.0'
76
- implementation 'androidx.work:work-runtime:2.7.1'
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
- println(variant.flavorName)
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
- } else if (defaultFile.exists()) {
136
- println("Reading Selligent properties from default $defaultSelligentFileName (no variant specific $variantSelligentFileName was found)")
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
- } else {
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.type);
23
+ resultingMap.putInt("type", ButtonAction.valueOf(button.action).getValue());
18
24
  resultingMap.putString("value", button.value);
19
25
  resultingMap.putString("label", button.label);
20
- resultingMap.putInt("action", button.action.getValue());
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
+ }
@@ -7,7 +7,7 @@ enum EventType {
7
7
  UserLogout(93),
8
8
  Custom(94);
9
9
 
10
- private Integer index;
10
+ private int index;
11
11
 
12
12
  EventType(Integer index) {
13
13
  this.index = index;
@@ -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
+ }