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

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 (139) hide show
  1. package/.github/actions/add-github-check/action.yml +78 -0
  2. package/.github/actions/add-github-comment/action.yml +48 -0
  3. package/.github/actions/add-slack-message/action.yml +32 -0
  4. package/.github/actions/edit-github-check/action.yml +59 -0
  5. package/.github/actions/edit-github-comment/action.yml +41 -0
  6. package/.github/pull_request_template.md +5 -0
  7. package/.github/readme.md +53 -0
  8. package/.github/workflows/build.yml +367 -0
  9. package/.github/workflows/gitflow.yml +20 -0
  10. package/.github/workflows/release-restricted.yml +35 -0
  11. package/.github/workflows/release.yml +32 -0
  12. package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
  13. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeRN.java +19 -4
  14. package/android/src/main/java/co/ab180/airbridge/reactnative/ConfigReader.java +63 -40
  15. package/changelog.md +10 -0
  16. package/ios/AirbridgeRN/ARNConfigReader.h +1 -1
  17. package/ios/AirbridgeRN/ARNConfigReader.m +31 -30
  18. package/ios/AirbridgeRN/AirbridgeRN.m +26 -2
  19. package/ios/copy-config.rb +1 -1
  20. package/package.json +1 -1
  21. package/qa/.bundle/config +2 -0
  22. package/qa/.eslintrc.js +4 -0
  23. package/qa/.prettierrc.js +7 -0
  24. package/qa/.watchmanconfig +1 -0
  25. package/qa/Gemfile +9 -0
  26. package/qa/Gemfile.lock +105 -0
  27. package/qa/__tests__/App.test.tsx +17 -0
  28. package/qa/airbridge.json +7 -0
  29. package/qa/android/app/build.gradle +130 -0
  30. package/qa/android/app/debug.keystore +0 -0
  31. package/qa/android/app/google-services.json +29 -0
  32. package/qa/android/app/proguard-rules.pro +10 -0
  33. package/qa/android/app/src/debug/AndroidManifest.xml +9 -0
  34. package/qa/android/app/src/main/AndroidManifest.xml +65 -0
  35. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +49 -0
  36. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainActivity.kt +35 -0
  37. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainApplication.kt +46 -0
  38. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoInteractor.kt +60 -0
  39. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoUtils.kt +115 -0
  40. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/IdentifiersInteractor.kt +83 -0
  41. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/InstallReferrerInteractor.kt +91 -0
  42. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/ModuleInjector.kt +22 -0
  43. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/PermissionInteractor.kt +55 -0
  44. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/UserInfoInteractor.kt +74 -0
  45. package/qa/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  46. package/qa/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  47. package/qa/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  48. package/qa/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  49. package/qa/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  50. package/qa/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  51. package/qa/android/app/src/main/res/values/strings.xml +3 -0
  52. package/qa/android/app/src/main/res/values/styles.xml +9 -0
  53. package/qa/android/build.gradle +28 -0
  54. package/qa/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  55. package/qa/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  56. package/qa/android/gradle.properties +41 -0
  57. package/qa/android/gradlew +249 -0
  58. package/qa/android/gradlew.bat +92 -0
  59. package/qa/android/settings.gradle +4 -0
  60. package/qa/app.json +4 -0
  61. package/qa/babel.config.js +3 -0
  62. package/qa/index.js +5 -0
  63. package/qa/ios/.xcode.env +11 -0
  64. package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +17 -0
  65. package/qa/ios/AirbridgeQA/AppDelegate.h +6 -0
  66. package/qa/ios/AirbridgeQA/AppDelegate.mm +123 -0
  67. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.m +14 -0
  68. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.swift +151 -0
  69. package/qa/ios/AirbridgeQA/IdentifiersInteractor.m +14 -0
  70. package/qa/ios/AirbridgeQA/IdentifiersInteractor.swift +40 -0
  71. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  72. package/qa/ios/AirbridgeQA/Images.xcassets/Contents.json +6 -0
  73. package/qa/ios/AirbridgeQA/Info.plist +66 -0
  74. package/qa/ios/AirbridgeQA/LaunchScreen.storyboard +47 -0
  75. package/qa/ios/AirbridgeQA/PermissionInteractor.m +14 -0
  76. package/qa/ios/AirbridgeQA/PermissionInteractor.swift +19 -0
  77. package/qa/ios/AirbridgeQA/PrivacyInfo.xcprivacy +39 -0
  78. package/qa/ios/AirbridgeQA/UserInfoInteractor.m +57 -0
  79. package/qa/ios/AirbridgeQA/UserInfoInteractor.swift +49 -0
  80. package/qa/ios/AirbridgeQA/main.m +10 -0
  81. package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +790 -0
  82. package/qa/ios/AirbridgeQA.xcodeproj/xcshareddata/xcschemes/AirbridgeQA.xcscheme +88 -0
  83. package/qa/ios/AirbridgeQA.xcworkspace/contents.xcworkspacedata +10 -0
  84. package/qa/ios/AirbridgeQA.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  85. package/qa/ios/AirbridgeQATests/AirbridgeQATests.m +66 -0
  86. package/qa/ios/AirbridgeQATests/Info.plist +24 -0
  87. package/qa/ios/GoogleService-Info.plist +30 -0
  88. package/qa/ios/Library/airbridge-ios-sdk-qa-library.podspec +26 -0
  89. package/qa/ios/Podfile +44 -0
  90. package/qa/ios/Podfile.lock +1634 -0
  91. package/qa/jest.config.js +3 -0
  92. package/qa/metro.config.js +67 -0
  93. package/qa/package-lock.json +14289 -0
  94. package/qa/package.json +47 -0
  95. package/qa/resource/arrow_back.png +0 -0
  96. package/qa/resource/home.png +0 -0
  97. package/qa/resource/info.png +0 -0
  98. package/qa/resource/link.png +0 -0
  99. package/qa/resource/refresh.png +0 -0
  100. package/qa/resource/token.png +0 -0
  101. package/qa/source/App.js +58 -0
  102. package/qa/source/common/Colors.js +20 -0
  103. package/qa/source/common/FCMService.js +94 -0
  104. package/qa/source/common/Native.ts +39 -0
  105. package/qa/source/common/Storage.js +13 -0
  106. package/qa/source/common/Styles.js +39 -0
  107. package/qa/source/component/AttributeEntryInputDialog.js +117 -0
  108. package/qa/source/component/AttributeTypeInputDialog.js +100 -0
  109. package/qa/source/component/ConfirmDialog.js +72 -0
  110. package/qa/source/component/CustomButton.js +50 -0
  111. package/qa/source/component/CustomEventParamsDialog.js +150 -0
  112. package/qa/source/component/CustomTextInput.js +40 -0
  113. package/qa/source/component/EntryInputDialog.js +89 -0
  114. package/qa/source/component/HorizontalPreference.js +46 -0
  115. package/qa/source/component/ImageButton.js +35 -0
  116. package/qa/source/component/InjectInputDialog.js +80 -0
  117. package/qa/source/component/MessageDialog.js +81 -0
  118. package/qa/source/component/UrlInputDialog.js +80 -0
  119. package/qa/source/component/ValueInputDialog.js +80 -0
  120. package/qa/source/component/VerticalPreference.js +42 -0
  121. package/qa/source/navigations/Stack.js +110 -0
  122. package/qa/source/pages/Browse.js +118 -0
  123. package/qa/source/pages/DeviceInfo.js +135 -0
  124. package/qa/source/pages/Event.js +171 -0
  125. package/qa/source/pages/Home.js +136 -0
  126. package/qa/source/pages/Identifiers.js +108 -0
  127. package/qa/source/pages/InstallReferrer.js +64 -0
  128. package/qa/source/pages/Placement.js +38 -0
  129. package/qa/source/pages/RequestPermissions.tsx +41 -0
  130. package/qa/source/pages/UserInfo.js +168 -0
  131. package/qa/source/pages/appInfo.js +22 -0
  132. package/qa/tsconfig.json +3 -0
  133. package/scripts/addiOSFramework.js +48 -0
  134. package/scripts/build-qa.sh +64 -0
  135. package/scripts/change_restricted.sh +21 -0
  136. package/scripts/update_native_version.sh +104 -0
  137. package/source/module/Attribution.ts +60 -0
  138. package/src/State.js +10 -2
  139. package/src/WebInterface.js +1 -1
@@ -0,0 +1,20 @@
1
+ name: gitflow
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - synchronize
8
+ - reopened
9
+ - closed
10
+ branches:
11
+ - main
12
+ - develop
13
+
14
+ jobs:
15
+ gitflow:
16
+ uses: ab180/gitflow/.github/workflows/gitflow.yml@v2
17
+ secrets:
18
+ GITHUB_APP_ID: ${{ secrets.SDK_TEAM_APP_ID }}
19
+ GITHUB_APP_PRIVATE_KEY: ${{ secrets.SDK_TEAM_APP_PRIVATE_KEY }}
20
+ GITHUB_APP_OWNER: ab180
@@ -0,0 +1,35 @@
1
+ name: release-restricted
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - closed
7
+ branches:
8
+ - main
9
+
10
+ jobs:
11
+ release-restricted:
12
+ runs-on: ubuntu-latest
13
+ if: |
14
+ github.event.pull_request.merged == true
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v3
19
+
20
+ - name: Prepare node
21
+ uses: actions/setup-node@v3
22
+ with:
23
+ node-version: 18
24
+ registry-url: 'https://registry.npmjs.org'
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: change restricted
30
+ run: sh scripts/change_restricted.sh
31
+
32
+ - name: Publish
33
+ env:
34
+ NODE_AUTH_TOKEN: ${{ secrets.SDK_TEAM_NPM_AUTOMATION_TOKEN }}
35
+ run: npm publish
@@ -0,0 +1,32 @@
1
+ name: release
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - closed
7
+ branches:
8
+ - main
9
+
10
+ jobs:
11
+ release:
12
+ runs-on: ubuntu-latest
13
+ if: |
14
+ github.event.pull_request.merged == true
15
+
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v3
19
+
20
+ - name: Prepare node
21
+ uses: actions/setup-node@v3
22
+ with:
23
+ node-version: 18
24
+ registry-url: 'https://registry.npmjs.org'
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Publish
30
+ env:
31
+ NODE_AUTH_TOKEN: ${{ secrets.SDK_TEAM_NPM_AUTOMATION_TOKEN }}
32
+ run: npm publish
@@ -0,0 +1,2 @@
1
+ connection.project.dir=../../../android
2
+ eclipse.preferences.version=1
@@ -12,8 +12,10 @@ import com.facebook.react.uimanager.ViewManager;
12
12
  import java.util.Arrays;
13
13
  import java.util.Collections;
14
14
  import java.util.List;
15
+ import java.util.Map;
15
16
 
16
17
  import javax.annotation.Nonnull;
18
+ import javax.annotation.Nullable;
17
19
 
18
20
  import co.ab180.airbridge.Airbridge;
19
21
 
@@ -35,12 +37,25 @@ public class AirbridgeRN implements ReactPackage {
35
37
  * @param appToken
36
38
  * App Token
37
39
  */
38
- public static void init(@Nonnull Application application, @Nonnull String appName, @Nonnull String appToken) {
39
- Airbridge.init(application, ConfigReader.build(appName, appToken, application));
40
+ public static void init(
41
+ @Nonnull Application application,
42
+ @Nonnull String appName,
43
+ @Nonnull String appToken
44
+ ) {
45
+ init(application, appName, appToken, null);
40
46
  }
41
47
 
42
-
43
- /**
48
+ private static void init(
49
+ @Nonnull Application application,
50
+ @Nonnull String appName,
51
+ @Nonnull String appToken,
52
+ @Nullable Map<String, Object> airbridgeJSON
53
+ ) {
54
+ Airbridge.init(application, ConfigReader.build(application, appName, appToken, airbridgeJSON));
55
+ }
56
+
57
+
58
+ /**
44
59
  * Use this method to fetch the correct deep links in exceptional circumstances.
45
60
  *
46
61
  * When your app is opened by tapping a push notification,
@@ -14,37 +14,52 @@ import java.io.InputStreamReader;
14
14
  import java.util.Map;
15
15
  import java.util.HashMap;
16
16
 
17
+ import javax.annotation.Nonnull;
18
+ import javax.annotation.Nullable;
19
+
17
20
  import co.ab180.airbridge.AirbridgeConfig;
18
21
  import co.ab180.airbridge.OnAttributionResultReceiveListener;
19
22
 
20
23
  class ConfigReader {
21
- private ConfigReader() {}
24
+ private ConfigReader() {
25
+ }
22
26
 
23
- static AirbridgeConfig build(String appName, String appToken, Context context) {
27
+ static AirbridgeConfig build(
28
+ @Nonnull Context context,
29
+ @Nonnull String appName,
30
+ @Nonnull String appToken,
31
+ @Nullable Map<String, Object> airbridgeJSON
32
+ ) {
24
33
  AirbridgeConfig.Builder configBuilder = new AirbridgeConfig.Builder(appName, appToken);
25
34
 
26
- JSONObject configObject = null;
27
- AssetManager assetManager = context.getAssets();
28
- try {
29
- BufferedReader reader = new BufferedReader(
30
- new InputStreamReader(
31
- assetManager.open("airbridge.json")
32
- )
33
- );
34
-
35
- StringBuilder builder = new StringBuilder();
35
+ setJsonObject(context, configBuilder, airbridgeJSON);
36
36
 
37
- String line = reader.readLine();
38
- while (line != null) {
39
- builder.append(line);
40
- line = reader.readLine();
37
+ configBuilder.setPlatform("react_native");
38
+
39
+ configBuilder.setLifecycleIntegration(activity -> {
40
+ AirbridgeLifecycleIntegration callback = AirbridgeLifecycle.getLifecycleIntegration();
41
+ if (callback == null) {
42
+ return null;
43
+ } else {
44
+ return callback.getDataString(activity);
41
45
  }
46
+ });
42
47
 
43
- configObject = new JSONObject(builder.toString());
44
- } catch (IOException ignored) {
45
- // when do not use airbridge.json file
46
- } catch (JSONException e) {
47
- Log.w("AirbridgeRN", "airbridge.json is not json format");
48
+ configBuilder.setOnAttributionResultReceiveListener(AirbridgeAttribution::processAttribution);
49
+
50
+ return configBuilder.build();
51
+ }
52
+
53
+ private static void setJsonObject(
54
+ @Nonnull Context context,
55
+ AirbridgeConfig.Builder configBuilder,
56
+ @Nullable Map<String, Object> airbridgeJSON) {
57
+
58
+ JSONObject configObject;
59
+ if (airbridgeJSON == null) {
60
+ configObject = loadJsonAsset(context);
61
+ } else {
62
+ configObject = loadAirbridgeJSON(airbridgeJSON);
48
63
  }
49
64
 
50
65
  Number sessionTimeoutSeconds = Get.type(Number.class, configObject, "sessionTimeoutSeconds");
@@ -105,27 +120,35 @@ class ConfigReader {
105
120
  resultLogLevel = resultLogLevel != null ? resultLogLevel : Log.WARN;
106
121
  configBuilder.setLogLevel(resultLogLevel);
107
122
 
108
- configBuilder.setPlatform("react_native");
123
+ }
109
124
 
110
- configBuilder.setLifecycleIntegration(new co.ab180.airbridge.AirbridgeLifecycleIntegration() {
111
- @Override
112
- public String getDataString(Activity activity) {
113
- AirbridgeLifecycleIntegration callback = AirbridgeLifecycle.getLifecycleIntegration();
114
- if (callback == null) {
115
- return null;
116
- } else {
117
- return callback.getDataString(activity);
118
- }
119
- }
120
- });
125
+ private static JSONObject loadJsonAsset(@Nonnull Context context) {
126
+ JSONObject configObject = null;
127
+ AssetManager assetManager = context.getAssets();
128
+ try {
129
+ BufferedReader reader = new BufferedReader(
130
+ new InputStreamReader(assetManager.open("airbridge.json"))
131
+ );
132
+
133
+ StringBuilder builder = new StringBuilder();
121
134
 
122
- configBuilder.setOnAttributionResultReceiveListener(new OnAttributionResultReceiveListener() {
123
- @Override
124
- public void onAttributionResultReceived(Map<String, String> attribution) {
125
- AirbridgeAttribution.processAttribution(attribution);
135
+ String line = reader.readLine();
136
+ while (line != null) {
137
+ builder.append(line);
138
+ line = reader.readLine();
126
139
  }
127
- });
128
-
129
- return configBuilder.build();
140
+
141
+ configObject = new JSONObject(builder.toString());
142
+ } catch (IOException ignored) {
143
+ // when do not use airbridge.json file
144
+ } catch (JSONException e) {
145
+ Log.w("AirbridgeRN", "airbridge.json is not json format");
146
+ }
147
+ return configObject;
130
148
  }
149
+
150
+ private static JSONObject loadAirbridgeJSON(@Nonnull Map<String, Object> airbridgeJSON) {
151
+ return new JSONObject(airbridgeJSON);
152
+ }
153
+
131
154
  }
package/changelog.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 2.8.9
2
+
3
+ **FIXED**
4
+ * Solve issue that setAttributionListener is not working if airbridge.json is not exist.
5
+
6
+ ## 2.8.8
7
+
8
+ **FIXED**
9
+ * Support for lowercase characters for ID keys in setUser and updateUser methods
10
+
1
11
  ## 2.8.7
2
12
 
3
13
  **FIXED**
@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
12
12
 
13
13
  @interface ARNConfigReader : NSObject
14
14
 
15
- + (void) apply;
15
+ + (void)apply:(NSDictionary*)airbridgeJSON;
16
16
 
17
17
  @end
18
18
 
@@ -8,72 +8,73 @@
8
8
 
9
9
  #import "ARNConfigReader.h"
10
10
 
11
- #import "AirbridgeAttribution.h"
12
11
  #import "ARNGet.h"
13
12
 
14
13
  #import <AirBridge/AirBridge.h>
15
14
 
16
15
  @implementation ARNConfigReader
17
16
 
18
- + (void) apply {
19
- NSString* path = [NSBundle.mainBundle pathForResource:@"airbridge" ofType:@"json"];
20
- NSData* data = [NSData dataWithContentsOfFile:path];
21
- NSDictionary* json = nil;
22
- if (data != nil) {
23
- json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
17
+ + (void)apply:(NSDictionary*)airbridgeJSON {
18
+ NSDictionary* dictionary = airbridgeJSON;
19
+ if (dictionary == nil) {
20
+ return;
24
21
  }
25
22
 
26
- NSNumber* sessionTimeoutSeconds = [ARNGet type:NSNumber.class dictionary:json key:@"sessionTimeoutSeconds"];
23
+ NSNumber* sessionTimeoutSeconds = [ARNGet type:NSNumber.class dictionary:dictionary key:@"sessionTimeoutSeconds"];
27
24
  if (sessionTimeoutSeconds != nil) {
28
25
  [AirBridge setSessionTimeout:sessionTimeoutSeconds.intValue * 1000];
29
26
  }
30
27
 
31
- NSNumber* autoStartTrackingEnabled = [ARNGet type:NSNumber.class dictionary:json key:@"autoStartTrackingEnabled"];
28
+ NSNumber* autoStartTrackingEnabled = [ARNGet type:NSNumber.class dictionary:dictionary key:@"autoStartTrackingEnabled"];
32
29
  if (autoStartTrackingEnabled != nil) {
33
30
  [AirBridge setAutoStartTrackingEnabled:autoStartTrackingEnabled.boolValue];
34
31
  }
35
32
 
36
- NSNumber* userInfoHashEnabled = [ARNGet type:NSNumber.class dictionary:json key:@"userInfoHashEnabled"];
33
+ NSNumber* userInfoHashEnabled = [ARNGet type:NSNumber.class dictionary:dictionary key:@"userInfoHashEnabled"];
37
34
  if (userInfoHashEnabled != nil) {
38
35
  [AirBridge setIsUserInfoHashed:userInfoHashEnabled.boolValue];
39
36
  }
40
37
 
41
- NSNumber* trackAirbridgeLinkOnly = [ARNGet type:NSNumber.class dictionary:json key:@"trackAirbridgeLinkOnly"];
38
+ NSNumber* trackAirbridgeLinkOnly = [ARNGet type:NSNumber.class dictionary:dictionary key:@"trackAirbridgeLinkOnly"];
42
39
  if (trackAirbridgeLinkOnly != nil) {
43
40
  [AirBridge setIsTrackAirbridgeDeeplinkOnly:trackAirbridgeLinkOnly.boolValue];
44
41
  }
45
42
 
46
- NSNumber* facebookDeferredAppLinkEnabled = [ARNGet type:NSNumber.class dictionary:json key:@"facebookDeferredAppLinkEnabled"];
43
+ NSNumber* facebookDeferredAppLinkEnabled = [ARNGet type:NSNumber.class dictionary:dictionary key:@"facebookDeferredAppLinkEnabled"];
47
44
  if (facebookDeferredAppLinkEnabled != nil) {
48
45
  [AirBridge setIsFacebookDeferredAppLinkEnabled:facebookDeferredAppLinkEnabled.boolValue];
49
46
  }
50
47
 
51
- NSNumber* trackingAuthorizeTimeoutSeconds = [ARNGet type:NSNumber.class dictionary:json key:@"trackingAuthorizeTimeoutSeconds"];
48
+ NSNumber* trackingAuthorizeTimeoutSeconds = [ARNGet type:NSNumber.class dictionary:dictionary key:@"trackingAuthorizeTimeoutSeconds"];
52
49
  if (trackingAuthorizeTimeoutSeconds != nil) {
53
50
  AirBridge.setting.trackingAuthorizeTimeout = trackingAuthorizeTimeoutSeconds.unsignedLongLongValue * 1000;
54
51
  }
55
52
 
56
- NSString* secretID = [ARNGet type:NSString.class dictionary:json key:@"sdkSignatureSecretID"];
57
- NSString* secretKey = [ARNGet type:NSString.class dictionary:json key:@"sdkSignatureSecret"];
53
+ NSString* secretID = [ARNGet type:NSString.class dictionary:dictionary key:@"sdkSignatureSecretID"];
54
+ NSString* secretKey = [ARNGet type:NSString.class dictionary:dictionary key:@"sdkSignatureSecret"];
58
55
  if (secretID != nil && secretKey != nil) {
59
56
  [AirBridge setSDKSignatureSecretWithID:secretID secret:secretKey];
60
57
  }
61
58
 
62
- NSString* logLevel = [ARNGet type:NSString.class dictionary:json key:@"logLevel"] ?: @"";
63
- [AirBridge setLogLevel:(
64
- [@{
65
- @"debug": @(AB_LOG_DEBUG),
66
- @"info": @(AB_LOG_INFO),
67
- @"warning": @(AB_LOG_WARNING),
68
- @"error": @(AB_LOG_CRITICAL),
69
- @"fault": @(AB_LOG_CRASH)
70
- } objectForKey: [logLevel lowercaseString]
71
- ] ?: @(AB_LOG_WARNING)
72
- )];
73
-
74
- [AirBridge.state setSDKDevelopmentPlatform:@"react_native"];
75
-
76
- [AirbridgeAttribution setInitialAttributionCallback];
59
+ NSString* logLevel = [ARNGet type:NSString.class dictionary:dictionary key:@"logLevel"] ?: @"";
60
+ if ([logLevel isEqualToString:@"debug"]) {
61
+ [AirBridge setLogLevel:AB_LOG_DEBUG];
62
+ }
63
+ else if ([logLevel isEqualToString:@"info"]) {
64
+ [AirBridge setLogLevel:AB_LOG_INFO];
65
+ }
66
+ else if ([logLevel isEqualToString:@"warning"]) {
67
+ [AirBridge setLogLevel:AB_LOG_WARNING];
68
+ }
69
+ else if ([logLevel isEqualToString:@"error"]) {
70
+ [AirBridge setLogLevel:AB_LOG_CRITICAL];
71
+ }
72
+ else if ([logLevel isEqualToString:@"fault"]) {
73
+ [AirBridge setLogLevel:AB_LOG_CRASH];
74
+ }
75
+ else {
76
+ [AirBridge setLogLevel:AB_LOG_WARNING];
77
+ }
77
78
  }
78
79
 
79
80
  @end
@@ -8,6 +8,7 @@
8
8
 
9
9
  #import "AirbridgeRN.h"
10
10
 
11
+ #import "AirbridgeAttribution.h"
11
12
  #import "AirbridgeDeeplink.h"
12
13
 
13
14
  // Airbridge
@@ -27,8 +28,31 @@ static AirbridgeRN* instance;
27
28
  return instance;
28
29
  }
29
30
 
30
- + (AirbridgeRN*)getInstance:(NSString*)appToken appName:(NSString*)appName withLaunchOptions:(nullable NSDictionary*)launchOptions {
31
- [ARNConfigReader apply];
31
+ + (AirbridgeRN*)getInstance:(NSString*)appToken
32
+ appName:(NSString*)appName
33
+ withLaunchOptions:(nullable NSDictionary*)launchOptions
34
+ {
35
+ NSString* path = [NSBundle.mainBundle pathForResource:@"airbridge" ofType:@"json"];
36
+ NSData* data = [NSData dataWithContentsOfFile:path];
37
+ NSDictionary* airbridgeJSON = nil;
38
+ if (data != nil) {
39
+ airbridgeJSON = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
40
+ }
41
+
42
+ return [AirbridgeRN getInstance:appToken
43
+ appName:appName
44
+ withAirbridgeJSON:airbridgeJSON
45
+ withLaunchOptions:launchOptions];
46
+ }
47
+
48
+ + (AirbridgeRN*)getInstance:(NSString*)appToken
49
+ appName:(NSString*)appName
50
+ withAirbridgeJSON:(nullable NSDictionary*)airbridgeJSON
51
+ withLaunchOptions:(nullable NSDictionary*)launchOptions
52
+ {
53
+ [ARNConfigReader apply:airbridgeJSON];
54
+ [AirBridge.state setSDKDevelopmentPlatform:@"react_native"];
55
+ [AirbridgeAttribution setInitialAttributionCallback];
32
56
 
33
57
  [AirBridge getInstance:appToken appName:appName withLaunchOptions:launchOptions];
34
58
  [AirbridgeDeeplink setInitialDeeplinkCallback];
@@ -1,7 +1,7 @@
1
1
  require 'xcodeproj'
2
2
  require 'pathname'
3
3
 
4
- current_directory=__dir__
4
+ current_directory=File.dirname(__FILE__)
5
5
  ios_project_directory=`cd #{current_directory}; cd ../../../ios; pwd`.gsub("\n", "")
6
6
  ios_project_file=File.join(
7
7
  ios_project_directory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airbridge-react-native-sdk-restricted",
3
- "version": "2.8.7",
3
+ "version": "2.8.9",
4
4
  "description": "Airbridge SDK for React Native",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -0,0 +1,2 @@
1
+ BUNDLE_PATH: "vendor/bundle"
2
+ BUNDLE_FORCE_RUBY_PLATFORM: 1
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@react-native',
4
+ };
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ arrowParens: 'avoid',
3
+ bracketSameLine: true,
4
+ bracketSpacing: false,
5
+ singleQuote: true,
6
+ trailingComma: 'all',
7
+ };
@@ -0,0 +1 @@
1
+ {}
package/qa/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby ">= 2.6.10"
5
+
6
+ # Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7
+ # bound in the template on Cocoapods with next React Native release.
8
+ gem 'cocoapods', '>= 1.13', '< 1.15'
9
+ gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
@@ -0,0 +1,105 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ CFPropertyList (3.0.7)
5
+ base64
6
+ nkf
7
+ rexml
8
+ activesupport (7.0.8.4)
9
+ concurrent-ruby (~> 1.0, >= 1.0.2)
10
+ i18n (>= 1.6, < 2)
11
+ minitest (>= 5.1)
12
+ tzinfo (~> 2.0)
13
+ addressable (2.8.6)
14
+ public_suffix (>= 2.0.2, < 6.0)
15
+ algoliasearch (1.27.5)
16
+ httpclient (~> 2.8, >= 2.8.3)
17
+ json (>= 1.5.1)
18
+ atomos (0.1.3)
19
+ base64 (0.2.0)
20
+ claide (1.1.0)
21
+ cocoapods (1.14.3)
22
+ addressable (~> 2.8)
23
+ claide (>= 1.0.2, < 2.0)
24
+ cocoapods-core (= 1.14.3)
25
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
26
+ cocoapods-downloader (>= 2.1, < 3.0)
27
+ cocoapods-plugins (>= 1.0.0, < 2.0)
28
+ cocoapods-search (>= 1.0.0, < 2.0)
29
+ cocoapods-trunk (>= 1.6.0, < 2.0)
30
+ cocoapods-try (>= 1.1.0, < 2.0)
31
+ colored2 (~> 3.1)
32
+ escape (~> 0.0.4)
33
+ fourflusher (>= 2.3.0, < 3.0)
34
+ gh_inspector (~> 1.0)
35
+ molinillo (~> 0.8.0)
36
+ nap (~> 1.0)
37
+ ruby-macho (>= 2.3.0, < 3.0)
38
+ xcodeproj (>= 1.23.0, < 2.0)
39
+ cocoapods-core (1.14.3)
40
+ activesupport (>= 5.0, < 8)
41
+ addressable (~> 2.8)
42
+ algoliasearch (~> 1.0)
43
+ concurrent-ruby (~> 1.1)
44
+ fuzzy_match (~> 2.0.4)
45
+ nap (~> 1.0)
46
+ netrc (~> 0.11)
47
+ public_suffix (~> 4.0)
48
+ typhoeus (~> 1.0)
49
+ cocoapods-deintegrate (1.0.5)
50
+ cocoapods-downloader (2.1)
51
+ cocoapods-plugins (1.0.0)
52
+ nap
53
+ cocoapods-search (1.0.1)
54
+ cocoapods-trunk (1.6.0)
55
+ nap (>= 0.8, < 2.0)
56
+ netrc (~> 0.11)
57
+ cocoapods-try (1.2.0)
58
+ colored2 (3.1.2)
59
+ concurrent-ruby (1.3.3)
60
+ escape (0.0.4)
61
+ ethon (0.16.0)
62
+ ffi (>= 1.15.0)
63
+ ffi (1.17.0)
64
+ fourflusher (2.3.1)
65
+ fuzzy_match (2.0.4)
66
+ gh_inspector (1.1.3)
67
+ httpclient (2.8.3)
68
+ i18n (1.14.5)
69
+ concurrent-ruby (~> 1.0)
70
+ json (2.7.2)
71
+ minitest (5.23.1)
72
+ molinillo (0.8.0)
73
+ nanaimo (0.3.0)
74
+ nap (1.1.0)
75
+ netrc (0.11.0)
76
+ nkf (0.2.0)
77
+ public_suffix (4.0.7)
78
+ rexml (3.2.9)
79
+ strscan
80
+ ruby-macho (2.5.1)
81
+ strscan (3.1.0)
82
+ typhoeus (1.4.1)
83
+ ethon (>= 0.9.0)
84
+ tzinfo (2.0.6)
85
+ concurrent-ruby (~> 1.0)
86
+ xcodeproj (1.24.0)
87
+ CFPropertyList (>= 2.3.3, < 4.0)
88
+ atomos (~> 0.1.3)
89
+ claide (>= 1.0.2, < 2.0)
90
+ colored2 (~> 3.1)
91
+ nanaimo (~> 0.3.0)
92
+ rexml (~> 3.2.4)
93
+
94
+ PLATFORMS
95
+ ruby
96
+
97
+ DEPENDENCIES
98
+ activesupport (>= 6.1.7.5, < 7.1.0)
99
+ cocoapods (>= 1.13, < 1.15)
100
+
101
+ RUBY VERSION
102
+ ruby 3.3.0p0
103
+
104
+ BUNDLED WITH
105
+ 2.5.4
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import 'react-native';
6
+ import React from 'react';
7
+ import App from '../App';
8
+
9
+ // Note: import explicitly to use the types shipped with jest.
10
+ import {it} from '@jest/globals';
11
+
12
+ // Note: test renderer must be required after react-native.
13
+ import renderer from 'react-test-renderer';
14
+
15
+ it('renders correctly', () => {
16
+ renderer.create(<App />);
17
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "sessionTimeoutSeconds": 15,
3
+ "trackingAuthorizeTimeoutSeconds": 15,
4
+ "sdkSignatureSecretID": "eacf944d-a6da-47e2-a38c-ac3f76bb37bb",
5
+ "sdkSignatureSecret": "d8ddd2b61947195fa73ef5d8d3cc4092acb280c281f1fc96479c35ef483f2cfe",
6
+ "logLevel": "debug"
7
+ }