airbridge-react-native-sdk-restricted 2.8.9 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build.yml +249 -159
- package/.github/workflows/documentation.yml +76 -0
- package/.github/workflows/qa.yml +187 -0
- package/.github/workflows/release.yml +26 -0
- package/airbridge-react-native-sdk-restricted.podspec +10 -7
- package/airbridge_sdk.json +4 -0
- package/android/build.gradle +22 -5
- package/android/{copy-config.gradle → copy-airbridge-json.gradle} +2 -2
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeReactNative.kt +141 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/common/AirbridgeLifecycleIntegration.kt +7 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/extension/AirbridgeOptionBuilderApply.kt +79 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/extension/JSONConvert.kt +33 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/AttributionInteractor.kt +54 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/DeeplinkInteractor.kt +45 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/EventInteractor.kt +22 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/FetchInteractor.kt +51 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/PlacementInteractor.kt +56 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/RegisterInteractor.kt +108 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/SwitchInteractor.kt +43 -0
- package/android/src/main/java/co/ab180/airbridge/reactnative/module/WebInterfaceInteractor.kt +24 -0
- package/build/document/.nojekyll +1 -0
- package/build/document/assets/highlight.css +22 -0
- package/build/document/assets/icons.js +18 -0
- package/build/document/assets/icons.svg +1 -0
- package/build/document/assets/main.js +60 -0
- package/build/document/assets/navigation.js +1 -0
- package/build/document/assets/search.js +1 -0
- package/build/document/assets/style.css +1448 -0
- package/build/document/classes/Airbridge.html +113 -0
- package/build/document/classes/AirbridgeAttribute.html +49 -0
- package/build/document/classes/AirbridgeCategory.html +28 -0
- package/build/document/index.html +8 -0
- package/build/document/modules.html +4 -0
- package/build/source/Airbridge.d.ts +230 -0
- package/build/source/Airbridge.js +277 -0
- package/build/source/Airbridge.js.map +1 -0
- package/build/source/architecture/Interactor.d.ts +2 -0
- package/build/source/architecture/Interactor.js +7 -0
- package/build/source/architecture/Interactor.js.map +1 -0
- package/build/source/architecture/module.d.ts +1 -0
- package/build/source/architecture/module.js +2 -0
- package/build/source/architecture/module.js.map +1 -0
- package/build/source/constant/AirbridgeAttribute.d.ts +51 -0
- package/build/source/constant/AirbridgeAttribute.js +144 -0
- package/build/source/constant/AirbridgeAttribute.js.map +1 -0
- package/build/source/constant/AirbridgeCategory.d.ts +30 -0
- package/build/source/constant/AirbridgeCategory.js +81 -0
- package/build/source/constant/AirbridgeCategory.js.map +1 -0
- package/build/source/module/Attribution.d.ts +16 -0
- package/build/source/module/Attribution.js +39 -0
- package/build/source/module/Attribution.js.map +1 -0
- package/build/source/module/Deeplink.d.ts +17 -0
- package/build/source/module/Deeplink.js +40 -0
- package/build/source/module/Deeplink.js.map +1 -0
- package/build/source/module/Event.d.ts +14 -0
- package/build/source/module/Event.js +50 -0
- package/build/source/module/Event.js.map +1 -0
- package/build/source/module/Fetch.d.ts +19 -0
- package/build/source/module/Fetch.js +100 -0
- package/build/source/module/Fetch.js.map +1 -0
- package/build/source/module/Placement.d.ts +18 -0
- package/build/source/module/Placement.js +95 -0
- package/build/source/module/Placement.js.map +1 -0
- package/build/source/module/Register.d.ts +49 -0
- package/build/source/module/Register.js +138 -0
- package/build/source/module/Register.js.map +1 -0
- package/build/source/module/Switch.d.ts +24 -0
- package/build/source/module/Switch.js +39 -0
- package/build/source/module/Switch.js.map +1 -0
- package/build/source/module/WebInterface.d.ts +16 -0
- package/build/source/module/WebInterface.js +46 -0
- package/build/source/module/WebInterface.js.map +1 -0
- package/build/source/module.d.ts +3 -0
- package/build/source/module.js +4 -0
- package/build/source/module.js.map +1 -0
- package/build/source/utility/check.d.ts +13 -0
- package/build/source/utility/check.js +15 -0
- package/build/source/utility/check.js.map +1 -0
- package/build/source/utility/compute.d.ts +3 -0
- package/build/source/utility/compute.js +5 -0
- package/build/source/utility/compute.js.map +1 -0
- package/build/source/utility/create.d.ts +5 -0
- package/build/source/utility/create.js +12 -0
- package/build/source/utility/create.js.map +1 -0
- package/build/source/utility/extract.d.ts +3 -0
- package/build/source/utility/extract.js +4 -0
- package/build/source/utility/extract.js.map +1 -0
- package/build/source/utility/json.d.ts +11 -0
- package/build/source/utility/json.js +137 -0
- package/build/source/utility/json.js.map +1 -0
- package/build/source/utility/log.d.ts +4 -0
- package/build/source/utility/log.js +9 -0
- package/build/source/utility/log.js.map +1 -0
- package/changelog.md +5 -3
- package/ios/AirbridgeReactNative/AirbridgeReactNative.h +23 -0
- package/ios/AirbridgeReactNative/AirbridgeReactNative.m +36 -0
- package/ios/AirbridgeReactNative/AirbridgeReactNative.swift +95 -0
- package/ios/AirbridgeReactNative/Extension/AirbridgeOptionBuilderApply.swift +86 -0
- package/ios/AirbridgeReactNative/Extension/DataFromHex.swift +21 -0
- package/ios/AirbridgeReactNative/Extension/Logger.swift +62 -0
- package/ios/AirbridgeReactNative/Module/AirbridgeModuleExtern.m +133 -0
- package/ios/AirbridgeReactNative/Module/AttributionInteractor.swift +43 -0
- package/ios/AirbridgeReactNative/Module/DeeplinkInteractor.swift +49 -0
- package/ios/AirbridgeReactNative/Module/EventInteractor.swift +26 -0
- package/ios/AirbridgeReactNative/Module/FetchInteractor.swift +66 -0
- package/ios/AirbridgeReactNative/Module/PlacementInteractor.swift +72 -0
- package/ios/AirbridgeReactNative/Module/RegisterInteractor.swift +104 -0
- package/ios/AirbridgeReactNative/Module/SwitchInteractor.swift +48 -0
- package/ios/AirbridgeReactNative/Module/WebInterfaceInteractor.swift +30 -0
- package/ios/{copy-config.rb → copy-airbridge-json.rb} +1 -1
- package/package.json +18 -27
- package/qa/Gemfile +3 -4
- package/qa/Gemfile.lock +28 -17
- package/qa/airbridge_qa.json +6 -0
- package/qa/android/app/build.gradle +30 -26
- package/qa/android/app/src/main/AndroidManifest.xml +159 -7
- package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +5 -5
- package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainActivity.kt +2 -2
- package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/IdentifiersInteractor.kt +8 -17
- package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/InstallReferrerInteractor.kt +13 -22
- package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/ModuleInjector.kt +1 -2
- package/qa/android/app/src/main/res/values/airbridge.xml +16 -0
- package/qa/android/build.gradle +4 -2
- package/qa/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/qa/android/gradle.properties +0 -2
- package/qa/android/gradlew +1 -1
- package/qa/android/settings.gradle +3 -1
- package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +11 -0
- package/qa/ios/AirbridgeQA/AppDelegate.mm +40 -30
- package/qa/ios/AirbridgeQA/DeviceInfoInteractor.swift +0 -1
- package/qa/ios/AirbridgeQA/IdentifiersInteractor.swift +4 -8
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@3x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@3x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@2x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@3x.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon~ipad.png +0 -0
- package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/Contents.json +113 -32
- package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +47 -29
- package/qa/ios/InternalLibrary/airbridge-ios-sdk-qa-library.podspec +32 -0
- package/qa/ios/InternalLibrary/airbridge-ios-sdk-restricted.podspec +32 -0
- package/qa/ios/Library/airbridge-ios-sdk-qa-library.podspec +6 -1
- package/qa/ios/Podfile +13 -1
- package/qa/ios/Podfile.lock +678 -313
- package/qa/ios/Script/prepare-build-parameter.rb +23 -0
- package/qa/metro.config.js +5 -2
- package/qa/package-lock.json +3360 -1435
- package/qa/package.json +29 -30
- package/qa/source/App.js +11 -5
- package/qa/source/common/FCMService.js +39 -15
- package/qa/source/navigations/Stack.js +8 -1
- package/qa/source/pages/AppInfo.js +40 -0
- package/qa/source/pages/Browse.js +16 -19
- package/qa/source/pages/DeviceInfo.js +10 -4
- package/qa/source/pages/Event.js +70 -60
- package/qa/source/pages/Home.js +77 -17
- package/qa/source/pages/Identifiers.js +10 -6
- package/qa/source/pages/Placement.js +3 -3
- package/qa/source/pages/Skad.js +76 -0
- package/qa/source/pages/UserInfo.js +47 -28
- package/readme.md +6 -6
- package/script/BuildDocument.sh +10 -0
- package/{scripts/build-qa.sh → script/BuildQA.sh} +5 -4
- package/script/BuildSource.sh +14 -0
- package/script/ChangeInternalSDK.sh +22 -0
- package/script/ChangeProductionSDK.sh +37 -0
- package/script/ChangeRestricted.sh +34 -0
- package/script/PrepareBuildParameter.sh +28 -0
- package/source/Airbridge.ts +340 -0
- package/source/architecture/Interactor.ts +10 -0
- package/source/architecture/module.ts +1 -0
- package/source/constant/AirbridgeAttribute.ts +188 -0
- package/source/constant/AirbridgeCategory.ts +104 -0
- package/source/module/Attribution.ts +4 -8
- package/source/module/Deeplink.ts +59 -0
- package/source/module/Event.ts +71 -0
- package/source/module/Fetch.ts +137 -0
- package/source/module/Placement.ts +134 -0
- package/source/module/Register.ts +203 -0
- package/source/module/Switch.ts +61 -0
- package/source/module/WebInterface.ts +55 -0
- package/source/module.ts +3 -0
- package/source/tsconfig.json +14 -0
- package/source/utility/check.ts +46 -0
- package/source/utility/compute.ts +9 -0
- package/source/utility/create.ts +12 -0
- package/source/utility/extract.ts +5 -0
- package/source/utility/json.ts +180 -0
- package/source/utility/log.ts +14 -0
- package/test/jest.json +13 -0
- package/test/mock.ts +112 -0
- package/test/module/Deeplink.test.ts +29 -0
- package/test/tsconfig.json +8 -0
- package/.eslintrc.json +0 -44
- package/.gitattributes +0 -1
- package/.github/actions/add-github-check/action.yml +0 -78
- package/.github/actions/add-github-comment/action.yml +0 -48
- package/.github/actions/add-slack-message/action.yml +0 -32
- package/.github/actions/edit-github-check/action.yml +0 -59
- package/.github/actions/edit-github-comment/action.yml +0 -41
- package/.github/workflows/release-restricted.yml +0 -35
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeAttribution.java +0 -78
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeDeeplink.java +0 -97
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeEvent.java +0 -76
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeLifecycle.java +0 -31
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeLifecycleIntegration.java +0 -8
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgePlacement.java +0 -42
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeRN.java +0 -112
- package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeState.java +0 -174
- package/android/src/main/java/co/ab180/airbridge/reactnative/ConfigReader.java +0 -154
- package/android/src/main/java/co/ab180/airbridge/reactnative/Get.java +0 -84
- package/index.d.ts +0 -338
- package/index.js +0 -8
- package/ios/AirbridgeRN/ARNConfigReader.h +0 -19
- package/ios/AirbridgeRN/ARNConfigReader.m +0 -80
- package/ios/AirbridgeRN/ARNGet.h +0 -20
- package/ios/AirbridgeRN/ARNGet.m +0 -40
- package/ios/AirbridgeRN/ARNHex.h +0 -16
- package/ios/AirbridgeRN/ARNHex.m +0 -44
- package/ios/AirbridgeRN/AirbridgeAttribution.h +0 -19
- package/ios/AirbridgeRN/AirbridgeAttribution.m +0 -47
- package/ios/AirbridgeRN/AirbridgeDeeplink.h +0 -20
- package/ios/AirbridgeRN/AirbridgeDeeplink.m +0 -59
- package/ios/AirbridgeRN/AirbridgeEvent.h +0 -17
- package/ios/AirbridgeRN/AirbridgeEvent.m +0 -63
- package/ios/AirbridgeRN/AirbridgePlacement.h +0 -17
- package/ios/AirbridgeRN/AirbridgePlacement.m +0 -38
- package/ios/AirbridgeRN/AirbridgeRN.h +0 -71
- package/ios/AirbridgeRN/AirbridgeRN.m +0 -83
- package/ios/AirbridgeRN/AirbridgeState.h +0 -17
- package/ios/AirbridgeRN/AirbridgeState.m +0 -94
- package/ios/AirbridgeRN.xcodeproj/project.pbxproj +0 -417
- package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/UserInfoInteractor.kt +0 -74
- package/qa/ios/AirbridgeQA/UserInfoInteractor.m +0 -57
- package/qa/ios/AirbridgeQA/UserInfoInteractor.swift +0 -49
- package/qa/source/pages/appInfo.js +0 -22
- package/scripts/addiOSFramework.js +0 -48
- package/scripts/change_restricted.sh +0 -21
- package/scripts/update_native_version.sh +0 -104
- package/src/Airbridge.js +0 -82
- package/src/Deeplink.js +0 -75
- package/src/Event.js +0 -38
- package/src/Placement.js +0 -56
- package/src/State.js +0 -175
- package/src/WebInterface.js +0 -135
- package/src/tool/Log.js +0 -40
- package/src/tool/_.js +0 -56
- package/src/type/AirbridgeAttributes.js +0 -40
- package/src/type/AirbridgeCategory.js +0 -35
- package/src/type/AirbridgeProduct.js +0 -18
- package/src/typedef/EventOption.js +0 -9
- package/src/typedef/Product.js +0 -10
- package/src/typedef/User.js +0 -9
package/qa/source/pages/Home.js
CHANGED
|
@@ -1,21 +1,45 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { Platform, Switch, View } from 'react-native'
|
|
3
|
+
import { Platform, Switch, Text, View } from 'react-native'
|
|
5
4
|
import CustomButton from '../component/CustomButton'
|
|
5
|
+
|
|
6
|
+
import { buildNumber, reactNativeSDKVersion, branchName } from '../common/BuildParameter.generated'
|
|
6
7
|
import { Styles } from '../common/Styles'
|
|
7
8
|
import { Colors } from '../common/Colors'
|
|
8
9
|
import { native } from '../common/Native'
|
|
9
10
|
|
|
10
|
-
import
|
|
11
|
-
import airbridge from 'airbridge-react-native-sdk'
|
|
11
|
+
import { fcmService } from '../common/FCMService'
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
import Toast from 'react-native-simple-toast'
|
|
14
|
+
import { Airbridge } from 'airbridge-react-native-sdk-restricted'
|
|
14
15
|
|
|
16
|
+
export default function HomePage({ navigation }) {
|
|
15
17
|
const [isEnabled, setEnabled] = useState(true);
|
|
18
|
+
const [isTrackingEnabled, setTrackingEnabled] = useState(true);
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
async function fetchData() {
|
|
22
|
+
setEnabled(await Airbridge.isSDKEnabled())
|
|
23
|
+
setTrackingEnabled(await Airbridge.isTrackingEnabled())
|
|
24
|
+
}
|
|
25
|
+
fetchData()
|
|
26
|
+
}, [])
|
|
16
27
|
|
|
28
|
+
const header = `${buildNumber},ReactNative,${reactNativeSDKVersion},${branchName}`
|
|
29
|
+
|
|
17
30
|
return (
|
|
18
31
|
<View style={Styles.container}>
|
|
32
|
+
|
|
33
|
+
<Text
|
|
34
|
+
style={{
|
|
35
|
+
color: Colors.black,
|
|
36
|
+
fontSize: 16,
|
|
37
|
+
textAlign: 'center'
|
|
38
|
+
}
|
|
39
|
+
}>{header}</Text>
|
|
40
|
+
|
|
41
|
+
<View style={Styles.line} />
|
|
42
|
+
|
|
19
43
|
<CustomButton
|
|
20
44
|
buttonColor={Colors.red}
|
|
21
45
|
title={'User Info'}
|
|
@@ -66,7 +90,7 @@ export default function HomePage({navigation}) {
|
|
|
66
90
|
accessibilityLabel={'requestPermissions'}
|
|
67
91
|
onPress={() => {
|
|
68
92
|
if (Platform.OS === 'ios') {
|
|
69
|
-
|
|
93
|
+
fcmService.requestPermission()
|
|
70
94
|
native.permission.ios.aceessTracking()
|
|
71
95
|
}
|
|
72
96
|
else if (Platform.OS === 'android') {
|
|
@@ -99,38 +123,74 @@ export default function HomePage({navigation}) {
|
|
|
99
123
|
title={'Version'}
|
|
100
124
|
accessibilityLabel={'appInfo'}
|
|
101
125
|
onPress={() => navigation.navigate('appInfo')} />
|
|
102
|
-
<CustomButton
|
|
103
|
-
buttonColor={Colors.deepBlue}
|
|
104
|
-
title={'Start Tracking'}
|
|
105
|
-
accessibilityLabel={'startTracking'}
|
|
106
|
-
onPress={() => airbridge.state.startTracking()} />
|
|
107
126
|
|
|
108
127
|
<View style={Styles.line} />
|
|
109
128
|
|
|
110
129
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
130
|
+
<View style={{flex: 1}}>
|
|
131
|
+
<CustomButton
|
|
132
|
+
buttonColor={Colors.red}
|
|
133
|
+
title={'Stop Tracking'}
|
|
134
|
+
accessibilityLabel={'stopTracking'}
|
|
135
|
+
onPress={() => {
|
|
136
|
+
Airbridge.stopTracking()
|
|
137
|
+
setTrackingEnabled(false)
|
|
138
|
+
}} />
|
|
139
|
+
</View>
|
|
140
|
+
<View style={{ margin: 4}} />
|
|
111
141
|
<View style={{flex: 1}}>
|
|
112
142
|
<CustomButton
|
|
113
|
-
buttonColor={Colors.
|
|
143
|
+
buttonColor={Colors.green}
|
|
144
|
+
title={'Start Tracking'}
|
|
145
|
+
accessibilityLabel={'startTracking'}
|
|
146
|
+
onPress={() => {
|
|
147
|
+
Airbridge.startTracking()
|
|
148
|
+
setTrackingEnabled(true)
|
|
149
|
+
}} />
|
|
150
|
+
</View>
|
|
151
|
+
<View style={{ margin: 4}} />
|
|
152
|
+
<Switch
|
|
153
|
+
trackColor={{true: Colors.blue, false: Colors.grey}}
|
|
154
|
+
thumbColor={'#f4f3f4'}
|
|
155
|
+
value={isTrackingEnabled} />
|
|
156
|
+
</View>
|
|
157
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
158
|
+
<View style={{flex: 1}}>
|
|
159
|
+
<CustomButton
|
|
160
|
+
buttonColor={Colors.red}
|
|
114
161
|
title={'DisableSdk'}
|
|
115
162
|
accessibilityLabel={'disableSdk'}
|
|
116
|
-
onPress={() =>
|
|
163
|
+
onPress={() => {
|
|
164
|
+
Airbridge.disableSDK()
|
|
165
|
+
setEnabled(false)
|
|
166
|
+
}} />
|
|
117
167
|
</View>
|
|
118
168
|
<View style={{ margin: 4}} />
|
|
119
169
|
<View style={{flex: 1}}>
|
|
120
170
|
<CustomButton
|
|
121
|
-
buttonColor={Colors.
|
|
171
|
+
buttonColor={Colors.green}
|
|
122
172
|
title={'EnableSdk'}
|
|
123
173
|
accessibilityLabel={'enableSdk'}
|
|
124
|
-
onPress={() =>
|
|
174
|
+
onPress={() => {
|
|
175
|
+
Airbridge.enableSDK()
|
|
176
|
+
setEnabled(true)
|
|
177
|
+
} } />
|
|
125
178
|
</View>
|
|
126
179
|
<View style={{ margin: 4}} />
|
|
127
180
|
<Switch
|
|
128
|
-
disabled={true}
|
|
129
181
|
trackColor={{true: Colors.blue, false: Colors.grey}}
|
|
130
182
|
thumbColor={'#f4f3f4'}
|
|
131
183
|
value={isEnabled} />
|
|
132
184
|
</View>
|
|
133
185
|
|
|
186
|
+
<View style={Styles.line} />
|
|
187
|
+
|
|
188
|
+
<CustomButton
|
|
189
|
+
buttonColor={Colors.blue}
|
|
190
|
+
title={'SKAdNetwork'}
|
|
191
|
+
accessibilityLabel={'SKAdNetwork'}
|
|
192
|
+
onPress={() => navigation.navigate('SKAdNetwork')} />
|
|
193
|
+
|
|
134
194
|
</View>
|
|
135
195
|
)
|
|
136
196
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
|
+
Platform,
|
|
4
5
|
NativeModules,
|
|
5
6
|
} from 'react-native'
|
|
6
7
|
|
|
@@ -20,17 +21,21 @@ export default class IdentifiersPage extends Component {
|
|
|
20
21
|
this.state = {
|
|
21
22
|
deviceUUID: storage.get('deviceUUID') ?? 'N/A',
|
|
22
23
|
appSetID: 'N/A',
|
|
23
|
-
|
|
24
|
+
airbridgeGeneratedDeviceUUID: storage.get('airbridgeGeneratedDeviceUUID') ?? 'N/A',
|
|
24
25
|
idfa: 'N/A',
|
|
25
26
|
idfv: 'N/A',
|
|
26
27
|
gaid: 'N/A',
|
|
27
28
|
fcmToken: storage.get('fcmToken') ?? 'N/A',
|
|
28
|
-
|
|
29
|
+
apnsToken: storage.get('apnsToken') ?? 'N/A',
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
this.confirmRef = React.createRef()
|
|
32
33
|
|
|
33
34
|
this.fetchIdentifiers()
|
|
35
|
+
|
|
36
|
+
if (Platform.OS === 'ios') {
|
|
37
|
+
fcmService.requestPermission()
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
fetchIdentifiers = async () => {
|
|
@@ -40,7 +45,6 @@ export default class IdentifiersPage extends Component {
|
|
|
40
45
|
const data = jsonData['data']
|
|
41
46
|
this.setState({
|
|
42
47
|
appSetID: data['appSetID'] ?? 'N/A',
|
|
43
|
-
generatedDeviceUUID: data['generatedDeviceUUID'] ?? 'N/A',
|
|
44
48
|
gaid: data['gaid'] ?? 'N/A',
|
|
45
49
|
idfa: data['idfa'] ?? 'N/A',
|
|
46
50
|
idfv: data['idfv'] ?? 'N/A',
|
|
@@ -74,7 +78,7 @@ export default class IdentifiersPage extends Component {
|
|
|
74
78
|
accessibilityLabel={'appSetId'} />
|
|
75
79
|
<VerticalPreference
|
|
76
80
|
title={'GeneratedDeviceUUID'}
|
|
77
|
-
text={this.state.
|
|
81
|
+
text={this.state.airbridgeGeneratedDeviceUUID}
|
|
78
82
|
accessibilityLabel={'generatedDeviceUUID'} />
|
|
79
83
|
<VerticalPreference
|
|
80
84
|
title={'Google Advertising ID (GAID)'}
|
|
@@ -83,11 +87,11 @@ export default class IdentifiersPage extends Component {
|
|
|
83
87
|
<VerticalPreference
|
|
84
88
|
title={'Apple Advertising ID (IDFA)'}
|
|
85
89
|
text={this.state.idfa}
|
|
86
|
-
accessibilityLabel={'
|
|
90
|
+
accessibilityLabel={'airbridgeIDFA'} />
|
|
87
91
|
<VerticalPreference
|
|
88
92
|
title={'Apple Vendor ID (IDFV)'}
|
|
89
93
|
text={this.state.idfv}
|
|
90
|
-
accessibilityLabel={'
|
|
94
|
+
accessibilityLabel={'airbridgeIDFV'} />
|
|
91
95
|
<VerticalPreference
|
|
92
96
|
title={'Firebase Cloud Messaging Token'}
|
|
93
97
|
text={this.state.fcmToken}
|
|
@@ -7,7 +7,7 @@ import { Colors } from '../common/Colors'
|
|
|
7
7
|
|
|
8
8
|
import UrlInputDialog from '../component/UrlInputDialog'
|
|
9
9
|
|
|
10
|
-
import Airbridge from 'airbridge-react-native-sdk'
|
|
10
|
+
import { Airbridge } from 'airbridge-react-native-sdk-restricted'
|
|
11
11
|
|
|
12
12
|
export default function PlacementPage() {
|
|
13
13
|
|
|
@@ -29,10 +29,10 @@ export default function PlacementPage() {
|
|
|
29
29
|
|
|
30
30
|
<UrlInputDialog
|
|
31
31
|
ref={clickUrlRef}
|
|
32
|
-
onConfirm={(value) => Airbridge.
|
|
32
|
+
onConfirm={(value) => Airbridge.click(value)} />
|
|
33
33
|
<UrlInputDialog
|
|
34
34
|
ref={impressionUrlRef}
|
|
35
|
-
onConfirm={(value) => Airbridge.
|
|
35
|
+
onConfirm={(value) => Airbridge.impression(value)} />
|
|
36
36
|
</View>
|
|
37
37
|
)
|
|
38
38
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { Component } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
} from 'react-native'
|
|
5
|
+
|
|
6
|
+
import { Styles } from '../common/Styles'
|
|
7
|
+
import { Colors } from '../common/Colors'
|
|
8
|
+
import CustomButton from '../component/CustomButton'
|
|
9
|
+
import CustomTextInput from '../component/CustomTextInput'
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
Airbridge,
|
|
13
|
+
AirbridgeCategory,
|
|
14
|
+
AirbridgeAttribute
|
|
15
|
+
} from 'airbridge-react-native-sdk-restricted';
|
|
16
|
+
|
|
17
|
+
export default class SkadPage extends Component {
|
|
18
|
+
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props);
|
|
21
|
+
|
|
22
|
+
this.state = {
|
|
23
|
+
skCategory: '',
|
|
24
|
+
skAttributes: ''
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
post = () => {
|
|
29
|
+
var outputCategory = this.state.skCategory.trim()
|
|
30
|
+
var outputAttributes = this.state.skAttributes.trim()
|
|
31
|
+
outputCategory = outputCategory.length == 0 ? null : outputCategory
|
|
32
|
+
outputAttributes = outputAttributes.length == 0 ? null : outputAttributes
|
|
33
|
+
|
|
34
|
+
console.log(`outputCategory: ${outputCategory}`)
|
|
35
|
+
console.log(`outputAttributes: ${outputAttributes}`)
|
|
36
|
+
|
|
37
|
+
if (outputCategory == null || outputAttributes == null) {
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const dValue = parseFloat(outputAttributes)
|
|
42
|
+
|
|
43
|
+
Airbridge.trackEvent(
|
|
44
|
+
outputCategory, {
|
|
45
|
+
[AirbridgeAttribute.VALUE]: dValue,
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
return (
|
|
52
|
+
<View style={Styles.container}>
|
|
53
|
+
<CustomTextInput
|
|
54
|
+
title={'skCategory'}
|
|
55
|
+
placeholder={'skCategory'}
|
|
56
|
+
accessibilityLabel='skCategory'
|
|
57
|
+
onChangeText={newText => this.setState({ skCategory: newText })}
|
|
58
|
+
value={this.state.value} />
|
|
59
|
+
<View style={{ margin: 4 }} />
|
|
60
|
+
<CustomTextInput
|
|
61
|
+
title={'skAttributes'}
|
|
62
|
+
placeholder={'skAttributes'}
|
|
63
|
+
accessibilityLabel='skAttributes'
|
|
64
|
+
onChangeText={newText => this.setState({ skAttributes: newText })}
|
|
65
|
+
value={this.state.value} />
|
|
66
|
+
<View style={{ margin: 8 }} />
|
|
67
|
+
<CustomButton
|
|
68
|
+
buttonColor={Colors.blue}
|
|
69
|
+
title={'skPost'}
|
|
70
|
+
titleColor='white'
|
|
71
|
+
accessibilityLabel={'skPost'}
|
|
72
|
+
onPress={() => this.post()} />
|
|
73
|
+
</View>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useRef } from 'react'
|
|
2
2
|
|
|
3
|
-
import { View
|
|
3
|
+
import { View } from 'react-native'
|
|
4
4
|
|
|
5
5
|
import { Styles } from '../common/Styles'
|
|
6
6
|
import { Colors } from '../common/Colors'
|
|
@@ -10,7 +10,7 @@ import ValueInputDialog from '../component/ValueInputDialog'
|
|
|
10
10
|
import AttributeEntryInputDialog from '../component/AttributeEntryInputDialog'
|
|
11
11
|
import EntryInputDialog from '../component/EntryInputDialog'
|
|
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 function UserInfoPage() {
|
|
16
16
|
|
|
@@ -36,7 +36,9 @@ export default function UserInfoPage() {
|
|
|
36
36
|
buttonColor={Colors.red}
|
|
37
37
|
title={'CLEAR ID'}
|
|
38
38
|
accessibilityLabel={'clearId'}
|
|
39
|
-
onPress={() =>
|
|
39
|
+
onPress={() => {
|
|
40
|
+
Airbridge.clearUserID()
|
|
41
|
+
}} />
|
|
40
42
|
|
|
41
43
|
<CustomButton
|
|
42
44
|
buttonColor={Colors.pink}
|
|
@@ -48,7 +50,9 @@ export default function UserInfoPage() {
|
|
|
48
50
|
buttonColor={Colors.pink}
|
|
49
51
|
title={'CLEAR EMAIL'}
|
|
50
52
|
accessibilityLabel={'clearEmail'}
|
|
51
|
-
onPress={() =>
|
|
53
|
+
onPress={() => {
|
|
54
|
+
Airbridge.clearUserEmail()
|
|
55
|
+
}} />
|
|
52
56
|
|
|
53
57
|
<CustomButton
|
|
54
58
|
buttonColor={Colors.purple}
|
|
@@ -60,7 +64,9 @@ export default function UserInfoPage() {
|
|
|
60
64
|
buttonColor={Colors.purple}
|
|
61
65
|
title={'CLEAR PHONE'}
|
|
62
66
|
accessibilityLabel={'clearPhone'}
|
|
63
|
-
onPress={() =>
|
|
67
|
+
onPress={() => {
|
|
68
|
+
Airbridge.clearUserPhone()
|
|
69
|
+
}} />
|
|
64
70
|
|
|
65
71
|
<CustomButton
|
|
66
72
|
buttonColor={Colors.deepPurple}
|
|
@@ -78,7 +84,9 @@ export default function UserInfoPage() {
|
|
|
78
84
|
buttonColor={Colors.blue}
|
|
79
85
|
title={'CLEAR ATTRIBUTE'}
|
|
80
86
|
accessibilityLabel={'clearAttributes'}
|
|
81
|
-
onPress={() =>
|
|
87
|
+
onPress={() => {
|
|
88
|
+
Airbridge.clearUserAttributes()
|
|
89
|
+
}} />
|
|
82
90
|
|
|
83
91
|
<CustomButton
|
|
84
92
|
buttonColor={Colors.lightBlue}
|
|
@@ -96,73 +104,84 @@ export default function UserInfoPage() {
|
|
|
96
104
|
buttonColor={Colors.teal}
|
|
97
105
|
title={'CLEAR ALIAS'}
|
|
98
106
|
accessibilityLabel={'clearAlias'}
|
|
99
|
-
onPress={() =>
|
|
107
|
+
onPress={() => {
|
|
108
|
+
Airbridge.clearUserAlias()
|
|
109
|
+
}} />
|
|
100
110
|
|
|
101
111
|
<CustomButton
|
|
102
112
|
buttonColor={Colors.green}
|
|
103
113
|
title={'CLEAR ALL'}
|
|
104
114
|
accessibilityLabel={'clearAll'}
|
|
105
|
-
onPress={() =>
|
|
115
|
+
onPress={() => {
|
|
116
|
+
Airbridge.clearUser()
|
|
117
|
+
}} />
|
|
106
118
|
|
|
107
119
|
<View style={{ margin: 16}} />
|
|
108
120
|
<CustomButton
|
|
109
121
|
buttonColor={Colors.lime}
|
|
110
122
|
title={'SEND DUMMY EVENT'}
|
|
111
123
|
accessibilityLabel={'dummyEvent'}
|
|
112
|
-
onPress={() =>
|
|
124
|
+
onPress={() => {
|
|
125
|
+
Airbridge.trackEvent('dummy_event')
|
|
126
|
+
}} />
|
|
113
127
|
|
|
114
128
|
<ValueInputDialog
|
|
115
129
|
ref={idRef}
|
|
116
|
-
onConfirm={(value) =>
|
|
130
|
+
onConfirm={(value) => {
|
|
131
|
+
Airbridge.setUserID(value)
|
|
132
|
+
}} />
|
|
117
133
|
<ValueInputDialog
|
|
118
134
|
ref={emailRef}
|
|
119
|
-
onConfirm={(value) =>
|
|
135
|
+
onConfirm={(value) => {
|
|
136
|
+
Airbridge.setUserEmail(value)
|
|
137
|
+
}} />
|
|
120
138
|
<ValueInputDialog
|
|
121
139
|
ref={phoneRef}
|
|
122
|
-
onConfirm={(value) =>
|
|
140
|
+
onConfirm={(value) => {
|
|
141
|
+
Airbridge.setUserPhone(value)
|
|
142
|
+
}} />
|
|
123
143
|
|
|
124
144
|
<AttributeEntryInputDialog
|
|
125
145
|
ref={attrEntryRef}
|
|
126
146
|
onConfirm={(key, value, type) => {
|
|
127
|
-
let
|
|
128
|
-
'key': key,
|
|
129
|
-
'type': type.toLowerCase()
|
|
130
|
-
}
|
|
147
|
+
let parsedValue
|
|
131
148
|
switch (type.toLowerCase()) {
|
|
132
149
|
case 'int':
|
|
133
150
|
case 'long':
|
|
134
|
-
|
|
135
|
-
//NativeModules.UserInfoInteractor.addAttribute(key, parseInt(value))
|
|
151
|
+
parsedValue = parseInt(value)
|
|
136
152
|
break;
|
|
137
153
|
case 'float':
|
|
138
154
|
case 'double':
|
|
139
|
-
|
|
140
|
-
//NativeModules.UserInfoInteractor.addAttribute(key, parseFloat(value))
|
|
155
|
+
parsedValue = parseFloat(value)
|
|
141
156
|
break;
|
|
142
157
|
case 'boolean':
|
|
143
|
-
|
|
144
|
-
//NativeModules.UserInfoInteractor.addAttribute(key, value == "true" ? true : false)
|
|
158
|
+
parsedValue = value == "true" ? true : false
|
|
145
159
|
break
|
|
146
160
|
case 'string':
|
|
147
|
-
|
|
148
|
-
//NativeModules.UserInfoInteractor.addAttribute(key, value)
|
|
161
|
+
parsedValue = value
|
|
149
162
|
break;
|
|
150
163
|
default:
|
|
151
164
|
break;
|
|
152
165
|
}
|
|
153
|
-
|
|
166
|
+
Airbridge.setUserAttribute(key, parsedValue)
|
|
154
167
|
}} />
|
|
155
168
|
<ValueInputDialog
|
|
156
169
|
ref={attrKeyRef}
|
|
157
|
-
onConfirm={(
|
|
170
|
+
onConfirm={(key) => {
|
|
171
|
+
Airbridge.removeUserAttribute(key)
|
|
172
|
+
} } />
|
|
158
173
|
|
|
159
174
|
<EntryInputDialog
|
|
160
175
|
ref={aliasEntryRef}
|
|
161
|
-
onConfirm={(key, value) =>
|
|
176
|
+
onConfirm={(key, value) => {
|
|
177
|
+
Airbridge.setUserAlias(key, value)
|
|
178
|
+
} } />
|
|
162
179
|
|
|
163
180
|
<ValueInputDialog
|
|
164
181
|
ref={aliasKeyRef}
|
|
165
|
-
onConfirm={(
|
|
182
|
+
onConfirm={(key) => {
|
|
183
|
+
Airbridge.removeUserAlias(key)
|
|
184
|
+
} } />
|
|
166
185
|
</View>
|
|
167
186
|
)
|
|
168
187
|
}
|
package/readme.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# airbridge-react-native-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Airbridge SDK for React Native
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
npm install --save airbridge-react-native-sdk
|
|
7
|
-
```
|
|
5
|
+
## Document
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
- https://help.airbridge.io/
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
### Reference
|
|
10
|
+
|
|
11
|
+
- https://reference.airbridge.io/airbridge-react-native-sdk/latest/
|
|
@@ -6,9 +6,10 @@ BUFFER_DIRECTORY="$(readlink -f "$(
|
|
|
6
6
|
mktemp -d --suffix=AIRBRIDGE_BUILD_QA 2>/dev/null \
|
|
7
7
|
|| mktemp -d -t AIRBRIDGE_BUILD_QA
|
|
8
8
|
)")"
|
|
9
|
-
rm -rf build
|
|
10
|
-
mkdir -p build
|
|
9
|
+
rm -rf build/qa
|
|
10
|
+
mkdir -p build/qa
|
|
11
11
|
npm clean-install
|
|
12
|
+
npm run build
|
|
12
13
|
(
|
|
13
14
|
cd qa
|
|
14
15
|
npm clean-install
|
|
@@ -44,7 +45,7 @@ if [[ $BUILD_QA == all ]] || [[ $BUILD_QA == ios ]]; then
|
|
|
44
45
|
-exportPath "$BUFFER_DIRECTORY/ios-application" \
|
|
45
46
|
-exportOptionsPlist "$BUFFER_DIRECTORY/ios-application.plist" \
|
|
46
47
|
-allowProvisioningUpdates
|
|
47
|
-
cp -r "$BUFFER_DIRECTORY/ios-application/AirbridgeQA.ipa" 'build/ios-application.ipa'
|
|
48
|
+
cp -r "$BUFFER_DIRECTORY/ios-application/AirbridgeQA.ipa" 'build/qa/ios-application.ipa'
|
|
48
49
|
fi
|
|
49
50
|
|
|
50
51
|
# build android
|
|
@@ -57,7 +58,7 @@ if [[ $BUILD_QA == all ]] || [[ $BUILD_QA == android ]]; then
|
|
|
57
58
|
cd qa/android
|
|
58
59
|
./gradlew app:assembleRelease
|
|
59
60
|
)
|
|
60
|
-
cp -r 'qa/android/app/build/outputs/apk/release/app-release.apk' 'build/android-application.apk'
|
|
61
|
+
cp -r 'qa/android/app/build/outputs/apk/release/app-release.apk' 'build/qa/android-application.apk'
|
|
61
62
|
fi
|
|
62
63
|
|
|
63
64
|
# clean environment
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/bin/bash -e
|
|
2
|
+
|
|
3
|
+
# prepare environment
|
|
4
|
+
ROOT_DIRECTORY="$(readlink -f "$(dirname "$0")/..")"
|
|
5
|
+
rm -rf build/source
|
|
6
|
+
mkdir -p build/source
|
|
7
|
+
|
|
8
|
+
# build source
|
|
9
|
+
cd "$ROOT_DIRECTORY"
|
|
10
|
+
if [[ "$WATCH" == 1 ]]; then
|
|
11
|
+
npm run build:watch
|
|
12
|
+
else
|
|
13
|
+
npm run build
|
|
14
|
+
fi
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/bin/bash -e
|
|
2
|
+
|
|
3
|
+
# parameter
|
|
4
|
+
# - INTERNAL_IOS_VERSION
|
|
5
|
+
# - INTERNAL_ANDROID_VERSION
|
|
6
|
+
|
|
7
|
+
# prepare environment
|
|
8
|
+
ROOT_DIRECTORY="$(readlink -f "$(dirname "$0")/..")"
|
|
9
|
+
|
|
10
|
+
# apply INTERNAL_IOS_VERSION
|
|
11
|
+
if [[ $INTERNAL_IOS_VERSION == null ]]; then
|
|
12
|
+
perl -i -pe 's/("ios_version").*[^,\n](,?)/$1: null$2/g' "$ROOT_DIRECTORY/qa/airbridge_qa.json"
|
|
13
|
+
elif ! [[ -z $INTERNAL_IOS_VERSION ]]; then
|
|
14
|
+
perl -i -pe "s/(\"ios_version\").*[^,\\n](,?)/\$1: \"$INTERNAL_IOS_VERSION\"\$2/g" "$ROOT_DIRECTORY/qa/airbridge_qa.json"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# apply INTERNAL_ANDROID_VERSION
|
|
18
|
+
if [[ $INTERNAL_ANDROID_VERSION == null ]]; then
|
|
19
|
+
perl -i -pe 's/("android_version").*[^,\n](,?)/$1: null$2/g' "$ROOT_DIRECTORY/qa/airbridge_qa.json"
|
|
20
|
+
elif ! [[ -z $INTERNAL_ANDROID_VERSION ]]; then
|
|
21
|
+
perl -i -pe "s/(\"android_version\").*[^,\\n](,?)/\$1: \"$INTERNAL_ANDROID_VERSION\"\$2/g" "$ROOT_DIRECTORY/qa/airbridge_qa.json"
|
|
22
|
+
fi
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/bin/bash -e
|
|
2
|
+
|
|
3
|
+
# parameter
|
|
4
|
+
# - PRODUCTION_VERSION
|
|
5
|
+
# - PRODUCTION_IOS_VERSION
|
|
6
|
+
# - PRODUCTION_ANDROID_VERSION
|
|
7
|
+
|
|
8
|
+
# prepare environment
|
|
9
|
+
ROOT_DIRECTORY="$(readlink -f "$(dirname "$0")/..")"
|
|
10
|
+
|
|
11
|
+
# apply PRODUCTION_VERSION
|
|
12
|
+
if ! [[ -z $PRODUCTION_VERSION ]]; then
|
|
13
|
+
perl -i -pe "s/(\"version\").*[^,\\n](,?)/\$1: $PRODUCTION_VERSION\$2/g" "$ROOT_DIRECTORY/package.json"
|
|
14
|
+
cat changelog.md | grep '## Unreleased' && (
|
|
15
|
+
echo 'error: if Unreleased is exist on CHANGELOG.md change version is not working'
|
|
16
|
+
)
|
|
17
|
+
CHANGELOG+="## $PRODUCTION_VERSION\n\n"
|
|
18
|
+
CHANGELOG+='**CHANGED**\n'
|
|
19
|
+
if ! [[ -z $PRODUCTION_IOS_VERSION ]]; then
|
|
20
|
+
CHANGELOG+="* Update \`Airbridge iOS SDK\` to $PRODUCTION_IOS_VERSION\n"
|
|
21
|
+
fi
|
|
22
|
+
if ! [[ -z $PRODUCTION_ANDROID_VERSION ]]; then
|
|
23
|
+
CHANGELOG+="* Update \`Airbridge Android SDK\` to $PRODUCTION_ANDROID_VERSION\n"
|
|
24
|
+
fi
|
|
25
|
+
CHANGELOG+='\n'
|
|
26
|
+
perl -i -0pe "s/^/$CHANGELOG/g" "$ROOT_DIRECTORY/changelog.md"
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# apply PRODUCTION_IOS_VERSION
|
|
30
|
+
if ! [[ -z $PRODUCTION_IOS_VERSION ]]; then
|
|
31
|
+
perl -i -pe "s/(\"ios_version\").*[^,\\n](,?)/\$1: \"$PRODUCTION_IOS_VERSION\"\$2/g" "$ROOT_DIRECTORY/airbridge_sdk.json"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# apply PRODUCTION_ANDROID_VERSION
|
|
35
|
+
if ! [[ -z $PRODUCTION_ANDROID_VERSION ]]; then
|
|
36
|
+
perl -i -pe "s/(\"android_version\").*[^,\\n](,?)/\$1: \"$PRODUCTION_ANDROID_VERSION\"\$2/g" "$ROOT_DIRECTORY/airbridge_sdk.json"
|
|
37
|
+
fi
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/bash -e
|
|
2
|
+
|
|
3
|
+
# prepare environment
|
|
4
|
+
ROOT_DIRECTORY="$(readlink -f "$(dirname "$0")/..")"
|
|
5
|
+
|
|
6
|
+
echo 'Change restricted'
|
|
7
|
+
|
|
8
|
+
# change react native
|
|
9
|
+
echo "Change react native"
|
|
10
|
+
perl -i -pe 's/"airbridge-react-native-sdk"/"airbridge-react-native-sdk-restricted"/g' package.json
|
|
11
|
+
perl -i -pe 's/"airbridge-react-native-sdk"/"airbridge-react-native-sdk-restricted"/g' package-lock.json
|
|
12
|
+
|
|
13
|
+
# change ios
|
|
14
|
+
echo "Change ios"
|
|
15
|
+
perl -i -pe "s/'airbridge-ios-sdk'/'airbridge-ios-sdk-restricted'/g" "$ROOT_DIRECTORY/airbridge-react-native-sdk.podspec"
|
|
16
|
+
mv "$ROOT_DIRECTORY/airbridge-react-native-sdk.podspec" "$ROOT_DIRECTORY/airbridge-react-native-sdk-restricted.podspec"
|
|
17
|
+
|
|
18
|
+
# change android
|
|
19
|
+
echo "Change android"
|
|
20
|
+
perl -i -pe 's/implementation "io.airbridge:sdk-android:/implementation "io.airbridge:sdk-android-restricted:/g' "$ROOT_DIRECTORY/android/build.gradle"
|
|
21
|
+
|
|
22
|
+
# change qa
|
|
23
|
+
echo 'Change qa'
|
|
24
|
+
perl -i -pe 's/"airbridge-react-native-sdk"/"airbridge-react-native-sdk-restricted"/g' "$ROOT_DIRECTORY/qa/package.json"
|
|
25
|
+
perl -i -pe 's/"airbridge-react-native-sdk"/"airbridge-react-native-sdk-restricted"/g' "$ROOT_DIRECTORY/qa/package-lock.json"
|
|
26
|
+
perl -i -pe "s/from 'airbridge-react-native-sdk'/from 'airbridge-react-native-sdk-restricted'/g" "$ROOT_DIRECTORY"/qa/source/**/*
|
|
27
|
+
perl -i -pe "s/= 'airbridge-ios-sdk'/= 'airbridge-ios-sdk-restricted'/g" "$ROOT_DIRECTORY/qa/ios/InternalLibrary/airbridge-ios-sdk.podspec"
|
|
28
|
+
perl -i -pe 's/Airbridge.zip"/AirbridgeRestricted.zip"/g' "$ROOT_DIRECTORY/qa/ios/InternalLibrary/airbridge-ios-sdk.podspec"
|
|
29
|
+
mv "$ROOT_DIRECTORY/qa/ios/InternalLibrary/airbridge-ios-sdk.podspec" "$ROOT_DIRECTORY/qa/ios/InternalLibrary/airbridge-ios-sdk-restricted.podspec"
|
|
30
|
+
perl -i -pe "s/pod 'airbridge-ios-sdk'/pod 'airbridge-ios-sdk-restricted'/g" "$ROOT_DIRECTORY/qa/ios/Podfile"
|
|
31
|
+
perl -i -pe "s!:podspec => 'InternalLibrary/airbridge-ios-sdk.podspec'!:podspec => 'InternalLibrary/airbridge-ios-restricted.podspec'!g" "$ROOT_DIRECTORY/qa/ios/Podfile"
|
|
32
|
+
perl -i -pe 's/implementation "io.airbridge:sdk-android:/implementation "io.airbridge:sdk-android-restricted:/g' "$ROOT_DIRECTORY/qa/android/app/build.gradle"
|
|
33
|
+
|
|
34
|
+
echo 'Done'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/bin/bash -e
|
|
2
|
+
|
|
3
|
+
# prepare environment
|
|
4
|
+
ROOT_DIRECTORY="$(readlink -f "$(dirname "$0")/..")"
|
|
5
|
+
if [ -z $BUILD_NUMBER ]; then
|
|
6
|
+
BUILD_NUMBER=0
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
# generate content
|
|
10
|
+
BUILD_PARAMETER_FILE+="export const buildNumber = \"$BUILD_NUMBER\"\n"
|
|
11
|
+
|
|
12
|
+
IOS_SDK_VERSION=$(perl -ne '/"ios_version": "(.*)"/ && print $1' "$ROOT_DIRECTORY/airbridge_sdk.json")
|
|
13
|
+
BUILD_PARAMETER_FILE+="export const iOSSDKVersion = \"$IOS_SDK_VERSION\"\n"
|
|
14
|
+
|
|
15
|
+
ANDROID_SDK_VERSION=$(perl -ne '/"android_version": "(.*)"/ && print $1' "$ROOT_DIRECTORY/airbridge_sdk.json")
|
|
16
|
+
BUILD_PARAMETER_FILE+="export const androidSDKVersion = \"$ANDROID_SDK_VERSION\"\n"
|
|
17
|
+
|
|
18
|
+
REACTNATIVE_SDK_VERSION=$(perl -ne '/"version": "(.*)"/ && print $1' "$ROOT_DIRECTORY/package.json")
|
|
19
|
+
BUILD_PARAMETER_FILE+="export const reactNativeSDKVersion = \"$REACTNATIVE_SDK_VERSION\"\n"
|
|
20
|
+
|
|
21
|
+
BRANCH=$(git branch --show-current | sed 's/\//\\\//g')
|
|
22
|
+
BUILD_PARAMETER_FILE+="export const branchName = \"$BRANCH\"\n"
|
|
23
|
+
|
|
24
|
+
COMMIT=$(git rev-parse HEAD)
|
|
25
|
+
BUILD_PARAMETER_FILE+="export const commitRev = \"$COMMIT\"\n"
|
|
26
|
+
|
|
27
|
+
# generate file
|
|
28
|
+
printf "$BUILD_PARAMETER_FILE" > "$ROOT_DIRECTORY/qa/source/common/BuildParameter.generated.ts"
|