airbridge-react-native-sdk-restricted 2.8.9 → 4.1.2

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 (270) hide show
  1. package/.github/workflows/build.yml +249 -159
  2. package/.github/workflows/documentation.yml +79 -0
  3. package/.github/workflows/qa.yml +187 -0
  4. package/.github/workflows/release.yml +26 -0
  5. package/airbridge-react-native-sdk-restricted.podspec +10 -7
  6. package/airbridge_sdk.json +4 -0
  7. package/android/build.gradle +22 -5
  8. package/android/{copy-config.gradle → copy-airbridge-json.gradle} +2 -2
  9. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeReactNative.kt +153 -0
  10. package/android/src/main/java/co/ab180/airbridge/reactnative/common/AirbridgeLifecycleIntegration.kt +7 -0
  11. package/android/src/main/java/co/ab180/airbridge/reactnative/extension/AirbridgeOptionBuilderApply.kt +79 -0
  12. package/android/src/main/java/co/ab180/airbridge/reactnative/extension/JSONConvert.kt +33 -0
  13. package/android/src/main/java/co/ab180/airbridge/reactnative/module/AttributionInteractor.kt +54 -0
  14. package/android/src/main/java/co/ab180/airbridge/reactnative/module/DeeplinkInteractor.kt +45 -0
  15. package/android/src/main/java/co/ab180/airbridge/reactnative/module/EventInteractor.kt +22 -0
  16. package/android/src/main/java/co/ab180/airbridge/reactnative/module/FetchInteractor.kt +51 -0
  17. package/android/src/main/java/co/ab180/airbridge/reactnative/module/PlacementInteractor.kt +56 -0
  18. package/android/src/main/java/co/ab180/airbridge/reactnative/module/RegisterInteractor.kt +108 -0
  19. package/android/src/main/java/co/ab180/airbridge/reactnative/module/SwitchInteractor.kt +43 -0
  20. package/android/src/main/java/co/ab180/airbridge/reactnative/module/WebInterfaceInteractor.kt +24 -0
  21. package/build/document/.nojekyll +1 -0
  22. package/build/document/assets/highlight.css +22 -0
  23. package/build/document/assets/icons.js +18 -0
  24. package/build/document/assets/icons.svg +1 -0
  25. package/build/document/assets/main.js +60 -0
  26. package/build/document/assets/navigation.js +1 -0
  27. package/build/document/assets/search.js +1 -0
  28. package/build/document/assets/style.css +1448 -0
  29. package/build/document/classes/Airbridge.html +113 -0
  30. package/build/document/classes/AirbridgeAttribute.html +49 -0
  31. package/build/document/classes/AirbridgeCategory.html +28 -0
  32. package/build/document/index.html +8 -0
  33. package/build/document/modules.html +4 -0
  34. package/build/source/Airbridge.d.ts +230 -0
  35. package/build/source/Airbridge.js +277 -0
  36. package/build/source/Airbridge.js.map +1 -0
  37. package/build/source/architecture/Interactor.d.ts +2 -0
  38. package/build/source/architecture/Interactor.js +7 -0
  39. package/build/source/architecture/Interactor.js.map +1 -0
  40. package/build/source/architecture/module.d.ts +1 -0
  41. package/build/source/architecture/module.js +2 -0
  42. package/build/source/architecture/module.js.map +1 -0
  43. package/build/source/constant/AirbridgeAttribute.d.ts +51 -0
  44. package/build/source/constant/AirbridgeAttribute.js +144 -0
  45. package/build/source/constant/AirbridgeAttribute.js.map +1 -0
  46. package/build/source/constant/AirbridgeCategory.d.ts +30 -0
  47. package/build/source/constant/AirbridgeCategory.js +81 -0
  48. package/build/source/constant/AirbridgeCategory.js.map +1 -0
  49. package/build/source/module/Attribution.d.ts +16 -0
  50. package/build/source/module/Attribution.js +39 -0
  51. package/build/source/module/Attribution.js.map +1 -0
  52. package/build/source/module/Deeplink.d.ts +17 -0
  53. package/build/source/module/Deeplink.js +40 -0
  54. package/build/source/module/Deeplink.js.map +1 -0
  55. package/build/source/module/Event.d.ts +14 -0
  56. package/build/source/module/Event.js +50 -0
  57. package/build/source/module/Event.js.map +1 -0
  58. package/build/source/module/Fetch.d.ts +19 -0
  59. package/build/source/module/Fetch.js +100 -0
  60. package/build/source/module/Fetch.js.map +1 -0
  61. package/build/source/module/Placement.d.ts +18 -0
  62. package/build/source/module/Placement.js +95 -0
  63. package/build/source/module/Placement.js.map +1 -0
  64. package/build/source/module/Register.d.ts +49 -0
  65. package/build/source/module/Register.js +138 -0
  66. package/build/source/module/Register.js.map +1 -0
  67. package/build/source/module/Switch.d.ts +24 -0
  68. package/build/source/module/Switch.js +39 -0
  69. package/build/source/module/Switch.js.map +1 -0
  70. package/build/source/module/WebInterface.d.ts +16 -0
  71. package/build/source/module/WebInterface.js +46 -0
  72. package/build/source/module/WebInterface.js.map +1 -0
  73. package/build/source/module.d.ts +3 -0
  74. package/build/source/module.js +4 -0
  75. package/build/source/module.js.map +1 -0
  76. package/build/source/utility/check.d.ts +13 -0
  77. package/build/source/utility/check.js +15 -0
  78. package/build/source/utility/check.js.map +1 -0
  79. package/build/source/utility/compute.d.ts +3 -0
  80. package/build/source/utility/compute.js +5 -0
  81. package/build/source/utility/compute.js.map +1 -0
  82. package/build/source/utility/create.d.ts +5 -0
  83. package/build/source/utility/create.js +12 -0
  84. package/build/source/utility/create.js.map +1 -0
  85. package/build/source/utility/extract.d.ts +3 -0
  86. package/build/source/utility/extract.js +4 -0
  87. package/build/source/utility/extract.js.map +1 -0
  88. package/build/source/utility/json.d.ts +11 -0
  89. package/build/source/utility/json.js +137 -0
  90. package/build/source/utility/json.js.map +1 -0
  91. package/build/source/utility/log.d.ts +4 -0
  92. package/build/source/utility/log.js +9 -0
  93. package/build/source/utility/log.js.map +1 -0
  94. package/changelog.md +14 -3
  95. package/ios/AirbridgeReactNative/AirbridgeReactNative.h +23 -0
  96. package/ios/AirbridgeReactNative/AirbridgeReactNative.m +36 -0
  97. package/ios/AirbridgeReactNative/AirbridgeReactNative.swift +107 -0
  98. package/ios/AirbridgeReactNative/Extension/AirbridgeOptionBuilderApply.swift +86 -0
  99. package/ios/AirbridgeReactNative/Extension/DataFromHex.swift +21 -0
  100. package/ios/AirbridgeReactNative/Extension/Logger.swift +62 -0
  101. package/ios/AirbridgeReactNative/Module/AirbridgeModuleExtern.m +133 -0
  102. package/ios/AirbridgeReactNative/Module/AttributionInteractor.swift +43 -0
  103. package/ios/AirbridgeReactNative/Module/DeeplinkInteractor.swift +49 -0
  104. package/ios/AirbridgeReactNative/Module/EventInteractor.swift +26 -0
  105. package/ios/AirbridgeReactNative/Module/FetchInteractor.swift +66 -0
  106. package/ios/AirbridgeReactNative/Module/PlacementInteractor.swift +72 -0
  107. package/ios/AirbridgeReactNative/Module/RegisterInteractor.swift +104 -0
  108. package/ios/AirbridgeReactNative/Module/SwitchInteractor.swift +48 -0
  109. package/ios/AirbridgeReactNative/Module/WebInterfaceInteractor.swift +30 -0
  110. package/ios/{copy-config.rb → copy-airbridge-json.rb} +1 -1
  111. package/package.json +18 -27
  112. package/qa/Gemfile +3 -4
  113. package/qa/Gemfile.lock +28 -17
  114. package/qa/airbridge_qa.json +6 -0
  115. package/qa/android/app/build.gradle +30 -26
  116. package/qa/android/app/src/main/AndroidManifest.xml +182 -7
  117. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +5 -5
  118. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainActivity.kt +2 -2
  119. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/IdentifiersInteractor.kt +8 -17
  120. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/InstallReferrerInteractor.kt +13 -22
  121. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/ModuleInjector.kt +1 -2
  122. package/qa/android/app/src/main/res/values/airbridge.xml +16 -0
  123. package/qa/android/build.gradle +4 -2
  124. package/qa/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  125. package/qa/android/gradle.properties +0 -2
  126. package/qa/android/gradlew +1 -1
  127. package/qa/android/settings.gradle +3 -1
  128. package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +12 -0
  129. package/qa/ios/AirbridgeQA/AppDelegate.mm +40 -30
  130. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.swift +0 -1
  131. package/qa/ios/AirbridgeQA/IdentifiersInteractor.swift +4 -8
  132. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x.png +0 -0
  133. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png +0 -0
  134. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@3x.png +0 -0
  135. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png +0 -0
  136. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29.png +0 -0
  137. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png +0 -0
  138. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png +0 -0
  139. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png +0 -0
  140. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png +0 -0
  141. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png +0 -0
  142. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png +0 -0
  143. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@3x.png +0 -0
  144. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png +0 -0
  145. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png +0 -0
  146. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png +0 -0
  147. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png +0 -0
  148. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@2x.png +0 -0
  149. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png +0 -0
  150. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@3x.png +0 -0
  151. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png +0 -0
  152. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon~ipad.png +0 -0
  153. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/Contents.json +113 -32
  154. package/qa/ios/AirbridgeQA/Info.plist +8 -0
  155. package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +47 -29
  156. package/qa/ios/InternalLibrary/airbridge-ios-sdk-qa-library.podspec +32 -0
  157. package/qa/ios/InternalLibrary/airbridge-ios-sdk-restricted.podspec +32 -0
  158. package/qa/ios/Library/airbridge-ios-sdk-qa-library.podspec +6 -1
  159. package/qa/ios/Podfile +13 -1
  160. package/qa/ios/Podfile.lock +689 -316
  161. package/qa/ios/Script/prepare-build-parameter.rb +23 -0
  162. package/qa/metro.config.js +5 -2
  163. package/qa/package-lock.json +3369 -1433
  164. package/qa/package.json +30 -30
  165. package/qa/source/App.js +13 -6
  166. package/qa/source/common/FCMService.js +39 -15
  167. package/qa/source/common/QALog.js +12 -0
  168. package/qa/source/navigations/Stack.js +8 -1
  169. package/qa/source/pages/AppInfo.js +40 -0
  170. package/qa/source/pages/Browse.js +16 -19
  171. package/qa/source/pages/DeviceInfo.js +10 -4
  172. package/qa/source/pages/Event.js +70 -60
  173. package/qa/source/pages/Home.js +77 -17
  174. package/qa/source/pages/Identifiers.js +10 -6
  175. package/qa/source/pages/Placement.js +3 -3
  176. package/qa/source/pages/Skad.js +76 -0
  177. package/qa/source/pages/UserInfo.js +47 -28
  178. package/readme.md +6 -6
  179. package/script/BuildDocument.sh +10 -0
  180. package/{scripts/build-qa.sh → script/BuildQA.sh} +5 -4
  181. package/script/BuildSource.sh +14 -0
  182. package/script/ChangeInternalSDK.sh +22 -0
  183. package/script/ChangeProductionSDK.sh +39 -0
  184. package/script/ChangeRestricted.sh +34 -0
  185. package/script/PrepareBuildParameter.sh +28 -0
  186. package/source/Airbridge.ts +340 -0
  187. package/source/architecture/Interactor.ts +10 -0
  188. package/source/architecture/module.ts +1 -0
  189. package/source/constant/AirbridgeAttribute.ts +188 -0
  190. package/source/constant/AirbridgeCategory.ts +104 -0
  191. package/source/module/Attribution.ts +4 -8
  192. package/source/module/Deeplink.ts +59 -0
  193. package/source/module/Event.ts +71 -0
  194. package/source/module/Fetch.ts +137 -0
  195. package/source/module/Placement.ts +134 -0
  196. package/source/module/Register.ts +203 -0
  197. package/source/module/Switch.ts +61 -0
  198. package/source/module/WebInterface.ts +55 -0
  199. package/source/module.ts +3 -0
  200. package/source/tsconfig.json +14 -0
  201. package/source/utility/check.ts +46 -0
  202. package/source/utility/compute.ts +9 -0
  203. package/source/utility/create.ts +12 -0
  204. package/source/utility/extract.ts +5 -0
  205. package/source/utility/json.ts +180 -0
  206. package/source/utility/log.ts +14 -0
  207. package/test/jest.json +13 -0
  208. package/test/mock.ts +112 -0
  209. package/test/module/Deeplink.test.ts +29 -0
  210. package/test/tsconfig.json +8 -0
  211. package/.eslintrc.json +0 -44
  212. package/.gitattributes +0 -1
  213. package/.github/actions/add-github-check/action.yml +0 -78
  214. package/.github/actions/add-github-comment/action.yml +0 -48
  215. package/.github/actions/add-slack-message/action.yml +0 -32
  216. package/.github/actions/edit-github-check/action.yml +0 -59
  217. package/.github/actions/edit-github-comment/action.yml +0 -41
  218. package/.github/workflows/release-restricted.yml +0 -35
  219. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeAttribution.java +0 -78
  220. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeDeeplink.java +0 -97
  221. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeEvent.java +0 -76
  222. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeLifecycle.java +0 -31
  223. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeLifecycleIntegration.java +0 -8
  224. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgePlacement.java +0 -42
  225. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeRN.java +0 -112
  226. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeState.java +0 -174
  227. package/android/src/main/java/co/ab180/airbridge/reactnative/ConfigReader.java +0 -154
  228. package/android/src/main/java/co/ab180/airbridge/reactnative/Get.java +0 -84
  229. package/index.d.ts +0 -338
  230. package/index.js +0 -8
  231. package/ios/AirbridgeRN/ARNConfigReader.h +0 -19
  232. package/ios/AirbridgeRN/ARNConfigReader.m +0 -80
  233. package/ios/AirbridgeRN/ARNGet.h +0 -20
  234. package/ios/AirbridgeRN/ARNGet.m +0 -40
  235. package/ios/AirbridgeRN/ARNHex.h +0 -16
  236. package/ios/AirbridgeRN/ARNHex.m +0 -44
  237. package/ios/AirbridgeRN/AirbridgeAttribution.h +0 -19
  238. package/ios/AirbridgeRN/AirbridgeAttribution.m +0 -47
  239. package/ios/AirbridgeRN/AirbridgeDeeplink.h +0 -20
  240. package/ios/AirbridgeRN/AirbridgeDeeplink.m +0 -59
  241. package/ios/AirbridgeRN/AirbridgeEvent.h +0 -17
  242. package/ios/AirbridgeRN/AirbridgeEvent.m +0 -63
  243. package/ios/AirbridgeRN/AirbridgePlacement.h +0 -17
  244. package/ios/AirbridgeRN/AirbridgePlacement.m +0 -38
  245. package/ios/AirbridgeRN/AirbridgeRN.h +0 -71
  246. package/ios/AirbridgeRN/AirbridgeRN.m +0 -83
  247. package/ios/AirbridgeRN/AirbridgeState.h +0 -17
  248. package/ios/AirbridgeRN/AirbridgeState.m +0 -94
  249. package/ios/AirbridgeRN.xcodeproj/project.pbxproj +0 -417
  250. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/UserInfoInteractor.kt +0 -74
  251. package/qa/ios/AirbridgeQA/UserInfoInteractor.m +0 -57
  252. package/qa/ios/AirbridgeQA/UserInfoInteractor.swift +0 -49
  253. package/qa/source/pages/appInfo.js +0 -22
  254. package/scripts/addiOSFramework.js +0 -48
  255. package/scripts/change_restricted.sh +0 -21
  256. package/scripts/update_native_version.sh +0 -104
  257. package/src/Airbridge.js +0 -82
  258. package/src/Deeplink.js +0 -75
  259. package/src/Event.js +0 -38
  260. package/src/Placement.js +0 -56
  261. package/src/State.js +0 -175
  262. package/src/WebInterface.js +0 -135
  263. package/src/tool/Log.js +0 -40
  264. package/src/tool/_.js +0 -56
  265. package/src/type/AirbridgeAttributes.js +0 -40
  266. package/src/type/AirbridgeCategory.js +0 -35
  267. package/src/type/AirbridgeProduct.js +0 -18
  268. package/src/typedef/EventOption.js +0 -9
  269. package/src/typedef/Product.js +0 -10
  270. package/src/typedef/User.js +0 -9
package/qa/package.json CHANGED
@@ -1,45 +1,45 @@
1
1
  {
2
2
  "name": "co.ab180.airbridge.qa.application",
3
- "version": "0.0.1",
4
3
  "private": true,
5
4
  "scripts": {
6
- "android": "react-native run-android --port=9000",
7
- "ios": "react-native run-ios --port=9000",
5
+ "android": "WATCH=1; react-native run-android --port=9000",
6
+ "ios": "WATCH=1; react-native run-ios --port=9000",
8
7
  "lint": "eslint .",
9
- "start": "react-native start --port=9000",
8
+ "start": "WATCH=1; react-native start --port=9000",
10
9
  "test": "jest"
11
10
  },
12
11
  "dependencies": {
13
- "@react-native-firebase/app": "^20.1.0",
14
- "@react-native-firebase/messaging": "^20.1.0",
12
+ "@react-native-firebase/app": "^20.3.0",
13
+ "@react-native-firebase/messaging": "^20.3.0",
15
14
  "@react-native-masked-view/masked-view": "^0.3.1",
16
- "@react-navigation/native": "^6.1.17",
17
- "@react-navigation/stack": "^6.3.29",
18
- "airbridge-react-native-sdk": "file:..",
19
- "react": "18.2.0",
20
- "react-native": "0.74.2",
21
- "react-native-gesture-handler": "^2.17.1",
22
- "react-native-safe-area-context": "^4.10.5",
23
- "react-native-screens": "^3.32.0",
15
+ "@react-navigation/native": "^6.1.18",
16
+ "@react-navigation/stack": "^6.4.1",
17
+ "airbridge-react-native-sdk-restricted": "file:..",
18
+ "react": "18.3.1",
19
+ "react-native": "0.75.1",
20
+ "react-native-gesture-handler": "^2.18.0",
21
+ "react-native-native-log": "^0.1.3",
22
+ "react-native-safe-area-context": "^4.10.8",
23
+ "react-native-screens": "^3.33.0",
24
24
  "react-native-simple-toast": "^3.3.1",
25
- "react-native-webview": "^13.10.4"
25
+ "react-native-webview": "^13.10.5"
26
26
  },
27
27
  "devDependencies": {
28
- "@babel/core": "^7.20.0",
29
- "@babel/preset-env": "^7.20.0",
30
- "@babel/runtime": "^7.20.0",
31
- "@react-native/babel-preset": "0.74.84",
32
- "@react-native/eslint-config": "0.74.84",
33
- "@react-native/metro-config": "0.74.84",
34
- "@react-native/typescript-config": "0.74.84",
35
- "@types/react": "^18.2.6",
36
- "@types/react-test-renderer": "^18.0.0",
37
- "babel-jest": "^29.6.3",
38
- "eslint": "^8.19.0",
39
- "jest": "^29.6.3",
40
- "prettier": "2.8.8",
41
- "react-test-renderer": "18.2.0",
42
- "typescript": "5.5.2"
28
+ "@babel/core": "^7.25.2",
29
+ "@babel/preset-env": "^7.25.3",
30
+ "@babel/runtime": "^7.25.0",
31
+ "@react-native/babel-preset": "0.75.1",
32
+ "@react-native/eslint-config": "0.75.1",
33
+ "@react-native/metro-config": "0.75.1",
34
+ "@react-native/typescript-config": "0.75.1",
35
+ "@types/react": "^18.2.0",
36
+ "@types/react-test-renderer": "^18.3.0",
37
+ "babel-jest": "^29.7.0",
38
+ "eslint": "^8.57.0",
39
+ "jest": "^29.7.0",
40
+ "prettier": "3.3.3",
41
+ "react-test-renderer": "18.3.1",
42
+ "typescript": "5.5.4"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=18"
package/qa/source/App.js CHANGED
@@ -5,9 +5,10 @@ import { storage } from './common/Storage'
5
5
  import { fcmService } from './common/FCMService'
6
6
  import { NavigationContainer } from '@react-navigation/native'
7
7
  import StackNavigation from './navigations/Stack'
8
- import airbridge from 'airbridge-react-native-sdk'
8
+ import { Airbridge } from 'airbridge-react-native-sdk'
9
9
 
10
10
  import MessageDialog from './component/MessageDialog'
11
+ import { qaLog } from './common/QALog'
11
12
 
12
13
  export default function App() {
13
14
 
@@ -19,10 +20,16 @@ export default function App() {
19
20
  fcmService.prepare()
20
21
 
21
22
  storage.set('attributeResult', 'N/A')
22
- storage.set('deviceUUID', (await airbridge.state.deviceUUID()))
23
+
24
+ Airbridge.fetchDeviceUUID((uuid) => {
25
+ storage.set('deviceUUID', uuid)
26
+ })
27
+
28
+ Airbridge.fetchAirbridgeGeneratedUUID((uuid) => {
29
+ storage.set('airbridgeGeneratedDeviceUUID', uuid)
30
+ })
23
31
 
24
- airbridge.state.setAttributionListener((result) => {
25
- console.log('setAttributionListener : ' + result)
32
+ Airbridge.setOnAttributionReceived((result) => {
26
33
  if (result == null) {
27
34
  storage.set('attributeResult', 'N/A');
28
35
  } else {
@@ -30,8 +37,8 @@ export default function App() {
30
37
  }
31
38
  })
32
39
 
33
- airbridge.deeplink.setDeeplinkListener((result) => {
34
- console.log(`[DeepLink] ${result}`)
40
+ Airbridge.setOnDeeplinkReceived((result) => {
41
+ qaLog(`[DeepLink] ${result}`)
35
42
  setDeeplink(result)
36
43
  deeplinkRef.current?.show()
37
44
  })
@@ -1,7 +1,7 @@
1
1
  import { Platform } from 'react-native'
2
2
 
3
3
  import messaging from '@react-native-firebase/messaging'
4
- import Airbridge from 'airbridge-react-native-sdk'
4
+ import { Airbridge } from 'airbridge-react-native-sdk-restricted'
5
5
 
6
6
  import { storage } from './Storage'
7
7
 
@@ -9,9 +9,9 @@ class FCMService {
9
9
 
10
10
  prepare = async () => {
11
11
  if (Platform.OS === 'android') {
12
- this.androidRequestPermission()
12
+ this.getAndroidToken()
13
13
  } else if (Platform.OS === 'ios') {
14
- this.iosRequestPermission()
14
+ this.getIosToken()
15
15
  }
16
16
 
17
17
  this.onMessageReceived()
@@ -23,9 +23,9 @@ class FCMService {
23
23
 
24
24
  updateToken = async () => {
25
25
  if (Platform.OS === 'android') {
26
- await this.androidRequestPermission()
26
+ await this.getAndroidToken()
27
27
  } else if (Platform.OS === 'ios') {
28
- await this.iosRequestPermission()
28
+ await this.getIosToken()
29
29
  }
30
30
  }
31
31
 
@@ -33,31 +33,53 @@ class FCMService {
33
33
  await messaging().deleteToken()
34
34
  }
35
35
 
36
- iosRequestPermission = async () => {
37
- console.log('[App] onRegister iosRequestPermission')
36
+ requestPermission = async () => {
37
+ console.log('[App] onRegister requestPermission')
38
+
39
+ try {
40
+ const authorizationStatus = await messaging().requestPermission();
41
+ if (authorizationStatus === messaging.AuthorizationStatus.AUTHORIZED) {
42
+ console.log('[App] User has notification permissions enabled.');
43
+ } else if (authorizationStatus === messaging.AuthorizationStatus.PROVISIONAL) {
44
+ console.log('[App] User has provisional notification permissions.');
45
+ } else {
46
+ console.log('[App] User has notification permissions disabled');
47
+ }
48
+ }
49
+ catch (error) {
50
+ console.log('[App] ios error::', error)
51
+ }
52
+
53
+ this.updateToken()
54
+ }
55
+
56
+ getIosToken = async () => {
57
+ console.log('[App] onRegister getIosToken')
38
58
 
39
59
  try {
40
60
  if (!messaging().isDeviceRegisteredForRemoteMessages) {
41
61
  await messaging().registerDeviceForRemoteMessages()
42
62
  }
43
63
 
64
+ const fcmToken = await messaging().getToken()
65
+ if (fcmToken != null) {
66
+ storage.set('fcmToken', fcmToken);
67
+ }
68
+
44
69
  const apnsToken = await messaging().getAPNSToken()
45
- console.log('[App] apns token :' + apnsToken)
70
+ console.log('[App] apns token : ' + apnsToken)
46
71
  if (apnsToken) {
47
72
  storage.set('apnsToken', apnsToken);
48
73
  Airbridge.registerPushToken(apnsToken)
49
74
  }
50
- else {
51
- console.log('[App] apnsToken is null')
52
- }
53
75
  }
54
76
  catch (error) {
55
77
  console.log('[App] ios error::', error)
56
78
  }
57
79
  }
58
80
 
59
- androidRequestPermission = async () => {
60
- console.log('[App] onRegister androidRequestPermission')
81
+ getAndroidToken = async () => {
82
+ console.log('[App] onRegister getAndroidToken')
61
83
 
62
84
  const fcmToken = await messaging().getToken()
63
85
  if (fcmToken != null) {
@@ -70,10 +92,12 @@ class FCMService {
70
92
  onMessageReceived = async () => {
71
93
  const onReceived = async (remoteMessage) => {
72
94
 
73
- //let remoteMessage =
74
95
  console.log('[FCM] onMessageReceived: ' + JSON.stringify(remoteMessage))
75
96
 
76
- // Check if message contains a data payload
97
+ if (Airbridge.isUninstallTrackingNotification(remoteMessage.data)) {
98
+ console.log("[FCM] Airbridge silent push notification received")
99
+ }
100
+
77
101
  if (remoteMessage.data != null) {
78
102
  console.log("[FCM] Message data payload: " + JSON.stringify(remoteMessage.data))
79
103
  }
@@ -0,0 +1,12 @@
1
+ import { Platform } from 'react-native'
2
+ import NativeLog from "react-native-native-log";
3
+
4
+ export const qaLog = (message) => {
5
+ if (Platform.OS === 'ios') {
6
+ NativeLog.logWithTag('AirbridgeQA', message)
7
+ } else if (Platform.OS === 'android') {
8
+ NativeLog.logWithTag('Airbridge', message)
9
+ } else {
10
+ console.log(message)
11
+ }
12
+ }
@@ -13,7 +13,8 @@ import InstallReferrerPage from '../pages/InstallReferrer'
13
13
  import PlacementPage from '../pages/Placement'
14
14
  import { RequestPermissionsPage } from '../pages/RequestPermissions'
15
15
  import BrowsePage from '../pages/Browse'
16
- import AppInfoPage from '../pages/appInfo'
16
+ import AppInfoPage from '../pages/AppInfo'
17
+ import SkadPage from '../pages/Skad'
17
18
 
18
19
  const Stack = createStackNavigator()
19
20
 
@@ -103,6 +104,12 @@ const StackNavigation = () => {
103
104
  headerLeft: () => createNavigateBackButton(navigation),
104
105
  headerRight: () => createNavigateHomeButton(navigation)
105
106
  })} />
107
+ <Stack.Screen name='SKAdNetwork'
108
+ component={SkadPage}
109
+ options={({ navigation }) => ({
110
+ headerLeft: () => createNavigateBackButton(navigation),
111
+ headerRight: () => createNavigateHomeButton(navigation)
112
+ })} />
106
113
  </Stack.Navigator>
107
114
  )
108
115
  }
@@ -0,0 +1,40 @@
1
+ import React from 'react'
2
+ import {
3
+ View
4
+ } from 'react-native'
5
+ import {
6
+ androidSDKVersion,
7
+ iOSSDKVersion,
8
+ reactNativeSDKVersion,
9
+ branchName,
10
+ commitRev,
11
+ } from '../common/BuildParameter.generated'
12
+ import { Styles } from '../common/Styles'
13
+
14
+ import CustomInfo from '../component/VerticalPreference';
15
+
16
+ export default function AppInfoPage() {
17
+ const branchInfo = branchName + ' - ' + commitRev
18
+ return (
19
+ <View style={Styles.container}>
20
+ <CustomInfo
21
+ title='Package Nanme'
22
+ text={'co.ab180.airbrige.qa.application'} />
23
+ <CustomInfo
24
+ title='Android SDK Version'
25
+ text={androidSDKVersion} />
26
+ <CustomInfo
27
+ title='iOS SDK Version'
28
+ text={iOSSDKVersion} />
29
+ <CustomInfo
30
+ title='React-native SDK Version'
31
+ text={reactNativeSDKVersion} />
32
+ <CustomInfo
33
+ title='Build number'
34
+ text={buildNumber} />
35
+ <CustomInfo
36
+ title='Branch info'
37
+ text={branchInfo} />
38
+ </View>
39
+ )
40
+ }
@@ -8,7 +8,7 @@ import InjectInputDialog from '../component/InjectInputDialog'
8
8
  import MessageDialog from '../component/MessageDialog'
9
9
 
10
10
  import { WebView } from 'react-native-webview'
11
- import Airbridge from 'airbridge-react-native-sdk'
11
+ import { Airbridge } from 'airbridge-react-native-sdk-restricted'
12
12
 
13
13
  export default class BrowsePage extends Component {
14
14
 
@@ -16,13 +16,17 @@ export default class BrowsePage extends Component {
16
16
  super(props);
17
17
 
18
18
  this.defaultQASource = 'https://sdk-download.airbridge.io/airbridge-web-sdk-qa-library/latest/AirbridgeQALibrary/index.html'
19
- let token = '46bbd826f96e49ca92f04daf0d816f95'
20
- this.webInterface = this.createWebInterface(token)
19
+ this.postMessageScript = `window.ReactNativeWebView.postMessage(payload)`
20
+
21
+ setTimeout(async () => {
22
+ let script = await Airbridge.createWebInterfaceScript(this.state.webToken, this.postMessageScript)
23
+ this.setState({script: script})
24
+ }, 0)
21
25
 
22
26
  this.state = {
23
27
  source: this.defaultQASource,
24
- token: token,
25
- script: this.webInterface.script,
28
+ webToken: '46bbd826f96e49ca92f04daf0d816f95',
29
+ script: '',
26
30
  info: ''
27
31
  };
28
32
 
@@ -32,21 +36,15 @@ export default class BrowsePage extends Component {
32
36
  this.infoRef = React.createRef()
33
37
  }
34
38
 
39
+ inits
40
+
35
41
  handleWebViewMessage = (event) => {
36
42
  console.log('Message received from web page:', event.nativeEvent);
37
43
 
38
- const message = event.nativeEvent.data;
39
- this.webInterface.handle(message);
44
+ const command = event.nativeEvent.data;
45
+ Airbridge.handleWebInterfaceCommand(command)
40
46
  }
41
47
 
42
- createWebInterface = (token) => {
43
- return Airbridge.createWebInterface(
44
- token,
45
- (command) => {
46
- return `window.ReactNativeWebView.postMessage(${command})`;
47
- }
48
- )
49
- }
50
48
 
51
49
  render() {
52
50
  return (
@@ -85,7 +83,7 @@ export default class BrowsePage extends Component {
85
83
  onPress={() => {
86
84
  var log = ''
87
85
  log += 'url : ' + this.state.source.toString() + '\n\n'
88
- log += 'webToken : ' + this.state.token.toString() + '\n'
86
+ log += 'webToken : ' + this.state.webToken.toString() + '\n'
89
87
  this.setState({
90
88
  info : log
91
89
  })
@@ -99,10 +97,9 @@ export default class BrowsePage extends Component {
99
97
  <InjectInputDialog
100
98
  ref={this.injectRef}
101
99
  onConfirm={(value) => {
102
- this.webInterface = this.createWebInterface(value)
103
100
  this.setState({
104
- script: this.webInterface.script,
105
- token: value
101
+ script: Airbridge.createWebInterfaceScript(webToken, this.postMessageScript),
102
+ webToken: value
106
103
  })
107
104
  this.webviewRef.current.reload()
108
105
  }} />
@@ -10,7 +10,7 @@ import HorizontalPreference from '../component/HorizontalPreference';
10
10
  import EntryInputDialog from '../component/EntryInputDialog'
11
11
  import ValueInputDialog from '../component/ValueInputDialog'
12
12
 
13
- import Airbridge from 'airbridge-react-native-sdk'
13
+ import { Airbridge } from 'airbridge-react-native-sdk-restricted'
14
14
 
15
15
  export default class DeviceInfoPage extends Component {
16
16
 
@@ -65,7 +65,9 @@ export default class DeviceInfoPage extends Component {
65
65
  buttonColor={Colors.purple}
66
66
  title={'CLEAR ALIAS'}
67
67
  accessibilityLabel={'clearAlias'}
68
- onPress={() => Airbridge.clearDeviceAlias()} />
68
+ onPress={() => {
69
+ Airbridge.clearDeviceAlias()
70
+ }} />
69
71
 
70
72
  <View style={{margin : 8}} />
71
73
 
@@ -124,10 +126,14 @@ export default class DeviceInfoPage extends Component {
124
126
 
125
127
  <EntryInputDialog
126
128
  ref={this.addRef}
127
- onConfirm={(key, value) => Airbridge.setDeviceAlias(key, value)} />
129
+ onConfirm={(key, value) => {
130
+ Airbridge.setDeviceAlias(key, value)
131
+ }} />
128
132
  <ValueInputDialog
129
133
  ref={this.removeRef}
130
- onConfirm={(value) => Airbridge.removeDeviceAlias(value)} />
134
+ onConfirm={(key) => {
135
+ Airbridge.removeDeviceAlias(key)
136
+ }} />
131
137
 
132
138
  </View>
133
139
  )
@@ -10,11 +10,11 @@ import { Colors } from '../common/Colors'
10
10
 
11
11
  import CustomEventParamsDialog from '../component/CustomEventParamsDialog'
12
12
 
13
- import Airbridge, {
13
+ import {
14
+ Airbridge,
14
15
  AirbridgeCategory,
15
- AirbridgeProduct,
16
- AirbridgeAttributes
17
- } from 'airbridge-react-native-sdk';
16
+ AirbridgeAttribute
17
+ } from 'airbridge-react-native-sdk-restricted';
18
18
 
19
19
  export default class EventPage extends Component {
20
20
 
@@ -32,26 +32,26 @@ export default class EventPage extends Component {
32
32
 
33
33
  createTestProducts = () => {
34
34
  return [{
35
- [AirbridgeProduct.PRODUCT_ID]: 'coca_1',
36
- [AirbridgeProduct.NAME]: 'Coca cola',
37
- [AirbridgeProduct.PRICE]: 1.99,
38
- [AirbridgeProduct.CURRENCY]: 'usd',
39
- [AirbridgeProduct.QUANTITY]: 10,
40
- [AirbridgeProduct.POSITION]: 1,
35
+ [AirbridgeAttribute.PRODUCT_ID]: 'coca_1',
36
+ [AirbridgeAttribute.PRODUCT_NAME]: 'Coca cola',
37
+ [AirbridgeAttribute.PRODUCT_PRICE]: 1.99,
38
+ [AirbridgeAttribute.CURRENCY]: 'usd',
39
+ [AirbridgeAttribute.PRODUCT_QUANTITY]: 10,
40
+ [AirbridgeAttribute.PRODUCT_POSITION]: 1,
41
41
  }, {
42
- [AirbridgeProduct.PRODUCT_ID]: 'fanta_1',
43
- [AirbridgeProduct.NAME]: 'Fanta Orange',
44
- [AirbridgeProduct.PRICE]: 2.50,
45
- [AirbridgeProduct.CURRENCY]: 'usd',
46
- [AirbridgeProduct.QUANTITY]: 5,
47
- [AirbridgeProduct.POSITION]: 2,
42
+ [AirbridgeAttribute.PRODUCT_ID]: 'fanta_1',
43
+ [AirbridgeAttribute.PRODUCT_NAME]: 'Fanta Orange',
44
+ [AirbridgeAttribute.PRODUCT_PRICE]: 2.50,
45
+ [AirbridgeAttribute.CURRENCY]: 'usd',
46
+ [AirbridgeAttribute.PRODUCT_QUANTITY]: 5,
47
+ [AirbridgeAttribute.PRODUCT_POSITION]: 2,
48
48
  }, {
49
- [AirbridgeProduct.PRODUCT_ID]: 'terra_pack_1',
50
- [AirbridgeProduct.NAME]: 'Terra 12 Pack',
51
- [AirbridgeProduct.PRICE]: 10.99,
52
- [AirbridgeProduct.CURRENCY]: 'usd',
53
- [AirbridgeProduct.QUANTITY]: 10,
54
- [AirbridgeProduct.POSITION]: 3,
49
+ [AirbridgeAttribute.PRODUCT_ID]: 'terra_pack_1',
50
+ [AirbridgeAttribute.PRODUCT_NAME]: 'Terra 12 Pack',
51
+ [AirbridgeAttribute.PRODUCT_PRICE]: 10.99,
52
+ [AirbridgeAttribute.PRODUCT_CURRENCY]: 'usd',
53
+ [AirbridgeAttribute.PRODUCT_QUANTITY]: 10,
54
+ [AirbridgeAttribute.PRODUCT_POSITION]: 3,
55
55
  }];
56
56
  }
57
57
 
@@ -88,67 +88,72 @@ export default class EventPage extends Component {
88
88
  buttonColor={Colors.red}
89
89
  title={'HOME VIEW EVENT'}
90
90
  accessibilityLabel={'homeViewEvent'}
91
- onPress={() => Airbridge.trackEvent(AirbridgeCategory.HOME_VIEW)} />
91
+ onPress={() => Airbridge.trackEvent(AirbridgeCategory.HOME_VIEWED)} />
92
92
  <CustomButton
93
93
  buttonColor={Colors.pink}
94
94
  title={'SEARCH RESULT VIEW EVENT'}
95
95
  accessibilityLabel={'searchResultViewEvent'}
96
96
  onPress={() => {
97
- Airbridge.event.trackEvent(AirbridgeCategory.SEARCH_RESULT_VIEW, {
98
- semanticAttributes: {
99
- [AirbridgeAttributes.QUERY]: 'query_1',
100
- [AirbridgeAttributes.PRODUCTS]: this.createTestProducts()
101
- }})
97
+ Airbridge.trackEvent(
98
+ AirbridgeCategory.SEARCH_RESULTS_VIEWED, {
99
+ [AirbridgeAttribute.QUERY]: 'query_1',
100
+ [AirbridgeAttribute.PRODUCTS]: this.createTestProducts()
101
+ })
102
102
  }} />
103
103
  <CustomButton
104
104
  buttonColor={Colors.purple}
105
105
  title={'PRODUCT LIST VIEW EVENT'}
106
106
  accessibilityLabel={'productListViewEvent'}
107
107
  onPress={() => {
108
- Airbridge.event.trackEvent(AirbridgeCategory.PRODUCT_LIST_VIEW, {
109
- semanticAttributes: {
110
- [AirbridgeAttributes.PRODUCT_LIST_ID]: 'list_1',
111
- [AirbridgeAttributes.PRODUCTS]: this.createTestProducts()
112
- }})
108
+ Airbridge.trackEvent(AirbridgeCategory.PRODUCT_LIST_VIEWED, {
109
+ [AirbridgeAttribute.PRODUCT_LIST_ID]: 'list_1',
110
+ [AirbridgeAttribute.PRODUCTS]: this.createTestProducts()
111
+ })
113
112
  }} />
114
113
  <CustomButton
115
114
  buttonColor={Colors.deepPurple}
116
115
  title={'PRODUCT DETAILS VIEW EVENT'}
117
116
  accessibilityLabel={'productDetailsViewEvent'}
118
117
  onPress={() => {
119
- Airbridge.event.trackEvent(AirbridgeCategory.PRODUCT_DETAILS_VIEW, {
120
- semanticAttributes: {
121
- [AirbridgeAttributes.QUERY]: 'query_1',
122
- [AirbridgeAttributes.PRODUCTS]: this.createTestProducts()
123
- }})
118
+ Airbridge.trackEvent(AirbridgeCategory.PRODUCT_VIEWED, {
119
+ [AirbridgeAttribute.QUERY]: 'query_1',
120
+ [AirbridgeAttribute.PRODUCTS]: this.createTestProducts()
121
+ })
124
122
  }} />
125
123
  <CustomButton
126
124
  buttonColor={Colors.indigo}
127
125
  title={'ADD TO CART EVENT'}
128
126
  accessibilityLabel={'addToCartEvent'}
129
127
  onPress={() => {
130
- Airbridge.event.trackEvent(AirbridgeCategory.ADD_TO_CART, {
131
- value: 43.39,
132
- semanticAttributes: {
133
- [AirbridgeAttributes.CART_ID]: 'cart_1',
134
- [AirbridgeAttributes.CURRENCY]: 'usd',
135
- [AirbridgeAttributes.TOTAL_QUANTITY]: 16,
136
- [AirbridgeAttributes.PRODUCTS]: this.createTestProducts()
137
- }})
128
+ Airbridge.trackEvent(AirbridgeCategory.ADDED_TO_CART, {
129
+ [AirbridgeAttribute.VALUE]: 43.39,
130
+ [AirbridgeAttribute.CART_ID]: 'cart_1',
131
+ [AirbridgeAttribute.CURRENCY]: 'usd',
132
+ [AirbridgeAttribute.TOTAL_QUANTITY]: 16,
133
+ [AirbridgeAttribute.PRODUCTS]: this.createTestProducts()
134
+ })
138
135
  }} />
139
136
  <CustomButton
140
137
  buttonColor={Colors.blue}
141
138
  title={'ORDER COMPLETE EVENT'}
142
139
  accessibilityLabel={'orderCompleteEvent'}
143
140
  onPress={() => {
144
- Airbridge.event.trackEvent(AirbridgeCategory.ORDER_COMPLETED, {
145
- value: 43.39,
146
- semanticAttributes: {
147
- [AirbridgeAttributes.CART_ID]: 'cart_1',
148
- [AirbridgeAttributes.CURRENCY]: 'usd',
149
- [AirbridgeAttributes.TOTAL_QUANTITY]: 16,
150
- [AirbridgeAttributes.PRODUCTS]: this.createTestProducts()
151
- }})
141
+ Airbridge.trackEvent(AirbridgeCategory.ORDER_COMPLETED, {
142
+ [AirbridgeAttribute.VALUE]: 43.39,
143
+ [AirbridgeAttribute.CART_ID]: 'cart_1',
144
+ [AirbridgeAttribute.CURRENCY]: 'usd',
145
+ [AirbridgeAttribute.TOTAL_QUANTITY]: 16,
146
+ [AirbridgeAttribute.PRODUCTS]: this.createTestProducts()
147
+ })
148
+ }} />
149
+
150
+ <Text style={{marginHorizontal:2, marginBottom: 2}}>ETC.</Text>
151
+ <CustomButton
152
+ buttonColor={Colors.red}
153
+ title={'REGISTER PUSH TOKEN'}
154
+ accessibilityLabel={'Register push token event'}
155
+ onPress={() => {
156
+ Airbridge.registerPushToken("ABCDEF");
152
157
  }} />
153
158
 
154
159
  <CustomEventParamsDialog
@@ -158,12 +163,17 @@ export default class EventPage extends Component {
158
163
  initLabel={'custom_label'}
159
164
  initValue={1234}
160
165
  onConfirm={(category, action, label, value, semanticAttr, customAttr) => {
161
- Airbridge.event.trackEvent(category, {
162
- action: action,
163
- label: label,
164
- value: value,
165
- semanticAttributes: semanticAttr,
166
- customAttributes: customAttr})
166
+ if (semanticAttr == null) {
167
+ semanticAttr = {}
168
+ }
169
+ semanticAttr[AirbridgeAttribute.ACTION] = action
170
+ semanticAttr[AirbridgeAttribute.LABEL] = label
171
+ semanticAttr[AirbridgeAttribute.VALUE] = value
172
+
173
+ Airbridge.trackEvent(
174
+ category,
175
+ semanticAttr,
176
+ customAttr)
167
177
  }} />
168
178
  </View>
169
179
  );