airbridge-react-native-sdk-restricted 2.8.6 → 2.8.8

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/airbridge-react-native-sdk-restricted.podspec +3 -1
  13. package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
  14. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeRN.java +19 -4
  15. package/android/src/main/java/co/ab180/airbridge/reactnative/ConfigReader.java +63 -40
  16. package/changelog.md +10 -0
  17. package/ios/AirbridgeRN/ARNConfigReader.h +1 -1
  18. package/ios/AirbridgeRN/ARNConfigReader.m +13 -15
  19. package/ios/AirbridgeRN/AirbridgeRN.m +23 -2
  20. package/ios/copy-config.rb +1 -1
  21. package/package.json +1 -1
  22. package/qa/.bundle/config +2 -0
  23. package/qa/.eslintrc.js +4 -0
  24. package/qa/.prettierrc.js +7 -0
  25. package/qa/.watchmanconfig +1 -0
  26. package/qa/Gemfile +9 -0
  27. package/qa/Gemfile.lock +105 -0
  28. package/qa/__tests__/App.test.tsx +17 -0
  29. package/qa/airbridge.json +7 -0
  30. package/qa/android/app/build.gradle +130 -0
  31. package/qa/android/app/debug.keystore +0 -0
  32. package/qa/android/app/google-services.json +29 -0
  33. package/qa/android/app/proguard-rules.pro +10 -0
  34. package/qa/android/app/src/debug/AndroidManifest.xml +9 -0
  35. package/qa/android/app/src/main/AndroidManifest.xml +65 -0
  36. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +49 -0
  37. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainActivity.kt +35 -0
  38. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainApplication.kt +46 -0
  39. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoInteractor.kt +60 -0
  40. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoUtils.kt +115 -0
  41. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/IdentifiersInteractor.kt +83 -0
  42. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/InstallReferrerInteractor.kt +91 -0
  43. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/ModuleInjector.kt +22 -0
  44. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/PermissionInteractor.kt +55 -0
  45. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/UserInfoInteractor.kt +74 -0
  46. package/qa/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  47. package/qa/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  48. package/qa/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  49. package/qa/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  50. package/qa/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  51. package/qa/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  52. package/qa/android/app/src/main/res/values/strings.xml +3 -0
  53. package/qa/android/app/src/main/res/values/styles.xml +9 -0
  54. package/qa/android/build.gradle +28 -0
  55. package/qa/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  56. package/qa/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  57. package/qa/android/gradle.properties +41 -0
  58. package/qa/android/gradlew +249 -0
  59. package/qa/android/gradlew.bat +92 -0
  60. package/qa/android/settings.gradle +4 -0
  61. package/qa/app.json +4 -0
  62. package/qa/babel.config.js +3 -0
  63. package/qa/index.js +5 -0
  64. package/qa/ios/.xcode.env +11 -0
  65. package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +17 -0
  66. package/qa/ios/AirbridgeQA/AppDelegate.h +6 -0
  67. package/qa/ios/AirbridgeQA/AppDelegate.mm +123 -0
  68. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.m +14 -0
  69. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.swift +151 -0
  70. package/qa/ios/AirbridgeQA/IdentifiersInteractor.m +14 -0
  71. package/qa/ios/AirbridgeQA/IdentifiersInteractor.swift +40 -0
  72. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  73. package/qa/ios/AirbridgeQA/Images.xcassets/Contents.json +6 -0
  74. package/qa/ios/AirbridgeQA/Info.plist +66 -0
  75. package/qa/ios/AirbridgeQA/LaunchScreen.storyboard +47 -0
  76. package/qa/ios/AirbridgeQA/PermissionInteractor.m +14 -0
  77. package/qa/ios/AirbridgeQA/PermissionInteractor.swift +19 -0
  78. package/qa/ios/AirbridgeQA/PrivacyInfo.xcprivacy +39 -0
  79. package/qa/ios/AirbridgeQA/UserInfoInteractor.m +57 -0
  80. package/qa/ios/AirbridgeQA/UserInfoInteractor.swift +49 -0
  81. package/qa/ios/AirbridgeQA/main.m +10 -0
  82. package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +771 -0
  83. package/qa/ios/AirbridgeQA.xcodeproj/xcshareddata/xcschemes/AirbridgeQA.xcscheme +88 -0
  84. package/qa/ios/AirbridgeQA.xcworkspace/contents.xcworkspacedata +10 -0
  85. package/qa/ios/AirbridgeQA.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  86. package/qa/ios/AirbridgeQATests/AirbridgeQATests.m +66 -0
  87. package/qa/ios/AirbridgeQATests/Info.plist +24 -0
  88. package/qa/ios/GoogleService-Info.plist +30 -0
  89. package/qa/ios/Library/airbridge-ios-sdk-qa-library.podspec +26 -0
  90. package/qa/ios/Podfile +44 -0
  91. package/qa/ios/Podfile.lock +1634 -0
  92. package/qa/jest.config.js +3 -0
  93. package/qa/metro.config.js +67 -0
  94. package/qa/package-lock.json +14289 -0
  95. package/qa/package.json +47 -0
  96. package/qa/resource/arrow_back.png +0 -0
  97. package/qa/resource/home.png +0 -0
  98. package/qa/resource/info.png +0 -0
  99. package/qa/resource/link.png +0 -0
  100. package/qa/resource/refresh.png +0 -0
  101. package/qa/resource/token.png +0 -0
  102. package/qa/source/App.js +58 -0
  103. package/qa/source/common/Colors.js +20 -0
  104. package/qa/source/common/FCMService.js +94 -0
  105. package/qa/source/common/Native.ts +39 -0
  106. package/qa/source/common/Storage.js +13 -0
  107. package/qa/source/common/Styles.js +39 -0
  108. package/qa/source/component/AttributeEntryInputDialog.js +117 -0
  109. package/qa/source/component/AttributeTypeInputDialog.js +100 -0
  110. package/qa/source/component/ConfirmDialog.js +72 -0
  111. package/qa/source/component/CustomButton.js +50 -0
  112. package/qa/source/component/CustomEventParamsDialog.js +150 -0
  113. package/qa/source/component/CustomTextInput.js +40 -0
  114. package/qa/source/component/EntryInputDialog.js +89 -0
  115. package/qa/source/component/HorizontalPreference.js +46 -0
  116. package/qa/source/component/ImageButton.js +35 -0
  117. package/qa/source/component/InjectInputDialog.js +80 -0
  118. package/qa/source/component/MessageDialog.js +81 -0
  119. package/qa/source/component/UrlInputDialog.js +80 -0
  120. package/qa/source/component/ValueInputDialog.js +80 -0
  121. package/qa/source/component/VerticalPreference.js +42 -0
  122. package/qa/source/navigations/Stack.js +110 -0
  123. package/qa/source/pages/Browse.js +118 -0
  124. package/qa/source/pages/DeviceInfo.js +135 -0
  125. package/qa/source/pages/Event.js +171 -0
  126. package/qa/source/pages/Home.js +136 -0
  127. package/qa/source/pages/Identifiers.js +108 -0
  128. package/qa/source/pages/InstallReferrer.js +64 -0
  129. package/qa/source/pages/Placement.js +38 -0
  130. package/qa/source/pages/RequestPermissions.tsx +41 -0
  131. package/qa/source/pages/UserInfo.js +168 -0
  132. package/qa/source/pages/appInfo.js +22 -0
  133. package/qa/tsconfig.json +3 -0
  134. package/scripts/addiOSFramework.js +48 -0
  135. package/scripts/build-qa.sh +64 -0
  136. package/scripts/change_restricted.sh +21 -0
  137. package/scripts/update_native_version.sh +104 -0
  138. package/src/State.js +10 -2
  139. package/src/WebInterface.js +1 -1
@@ -0,0 +1,136 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import messaging from '@react-native-firebase/messaging'
4
+ import { Platform, Switch, View } from 'react-native'
5
+ import CustomButton from '../component/CustomButton'
6
+ import { Styles } from '../common/Styles'
7
+ import { Colors } from '../common/Colors'
8
+ import { native } from '../common/Native'
9
+
10
+ import Toast from 'react-native-simple-toast'
11
+ import airbridge from 'airbridge-react-native-sdk'
12
+
13
+ export default function HomePage({navigation}) {
14
+
15
+ const [isEnabled, setEnabled] = useState(true);
16
+
17
+ return (
18
+ <View style={Styles.container}>
19
+ <CustomButton
20
+ buttonColor={Colors.red}
21
+ title={'User Info'}
22
+ accessibilityLabel={'userInfo'}
23
+ onPress={() => navigation.navigate('userInfo')} />
24
+ <CustomButton
25
+ buttonColor={Colors.pink}
26
+ title={'Occurring Event'}
27
+ accessibilityLabel={'occurringEvent'}
28
+ onPress={() => navigation.navigate('occurringEvent')} />
29
+
30
+ <View style={Styles.line} />
31
+
32
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
33
+ <View style={{flex: 1}}>
34
+ <CustomButton
35
+ height={50}
36
+ buttonColor={Colors.purple}
37
+ title={'identifiers'}
38
+ accessibilityLabel={'identifiers'}
39
+ onPress={() => navigation.navigate('identifiers')} />
40
+ </View>
41
+ <View style={{ margin: 4}} />
42
+ <View style={{flex: 1}}>
43
+ <CustomButton
44
+ height={50}
45
+ buttonColor={Colors.deepPurple}
46
+ title={'Install\nReferrer'}
47
+ accessibilityLabel={'installReferrer'}
48
+ onPress={() => navigation.navigate('installReferrer')} />
49
+ </View>
50
+ <View style={{ margin: 4}} />
51
+ <View style={{flex: 1}}>
52
+ <CustomButton
53
+ height={50}
54
+ buttonColor={Colors.purple}
55
+ title={'Device Info'}
56
+ accessibilityLabel={'deviceInfo'}
57
+ onPress={() => navigation.navigate('deviceInfo')} />
58
+ </View>
59
+ </View>
60
+
61
+ <View style={Styles.line} />
62
+
63
+ <CustomButton
64
+ buttonColor={Colors.indigo}
65
+ title={'Request Permission'}
66
+ accessibilityLabel={'requestPermissions'}
67
+ onPress={() => {
68
+ if (Platform.OS === 'ios') {
69
+ messaging().requestPermission()
70
+ native.permission.ios.aceessTracking()
71
+ }
72
+ else if (Platform.OS === 'android') {
73
+ navigation.navigate('requestPermissions')
74
+ }
75
+ else {
76
+ Toast.show('Not implementation')
77
+ }
78
+ }} />
79
+ <CustomButton
80
+ buttonColor={Colors.blue}
81
+ title={'Tracking Links Within Apps'}
82
+ accessibilityLabel={'trackingLinksWithinApps'}
83
+ onPress={() => navigation.navigate('trackingLinksWithinApps')} />
84
+ <CustomButton
85
+ buttonColor={Colors.teal}
86
+ title={'Browse'}
87
+ accessibilityLabel={'browse'}
88
+ onPress={() => navigation.navigate('browse')} />
89
+ <CustomButton
90
+ buttonColor={Colors.green}
91
+ title={'Logs'}
92
+ accessibilityLabel={'logs'}
93
+ onPress={() => Toast.show('Not implementation')} />
94
+
95
+ <View style={Styles.line} />
96
+
97
+ <CustomButton
98
+ buttonColor={Colors.blue}
99
+ title={'Version'}
100
+ accessibilityLabel={'appInfo'}
101
+ onPress={() => navigation.navigate('appInfo')} />
102
+ <CustomButton
103
+ buttonColor={Colors.deepBlue}
104
+ title={'Start Tracking'}
105
+ accessibilityLabel={'startTracking'}
106
+ onPress={() => airbridge.state.startTracking()} />
107
+
108
+ <View style={Styles.line} />
109
+
110
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
111
+ <View style={{flex: 1}}>
112
+ <CustomButton
113
+ buttonColor={Colors.deepBlue}
114
+ title={'DisableSdk'}
115
+ accessibilityLabel={'disableSdk'}
116
+ onPress={() => setEnabled(false)} />
117
+ </View>
118
+ <View style={{ margin: 4}} />
119
+ <View style={{flex: 1}}>
120
+ <CustomButton
121
+ buttonColor={Colors.deepBlue}
122
+ title={'EnableSdk'}
123
+ accessibilityLabel={'enableSdk'}
124
+ onPress={() => setEnabled(true) } />
125
+ </View>
126
+ <View style={{ margin: 4}} />
127
+ <Switch
128
+ disabled={true}
129
+ trackColor={{true: Colors.blue, false: Colors.grey}}
130
+ thumbColor={'#f4f3f4'}
131
+ value={isEnabled} />
132
+ </View>
133
+
134
+ </View>
135
+ )
136
+ }
@@ -0,0 +1,108 @@
1
+ import React, { Component } from 'react'
2
+ import {
3
+ View,
4
+ NativeModules,
5
+ } from 'react-native'
6
+
7
+ import { Styles } from '../common/Styles'
8
+
9
+ import { storage } from '../common/Storage'
10
+ import { fcmService } from '../common/FCMService'
11
+
12
+ import VerticalPreference from '../component/VerticalPreference';
13
+ import ConfirmDialog from '../component/ConfirmDialog'
14
+
15
+ export default class IdentifiersPage extends Component {
16
+
17
+ constructor(props) {
18
+ super(props);
19
+
20
+ this.state = {
21
+ deviceUUID: storage.get('deviceUUID') ?? 'N/A',
22
+ appSetID: 'N/A',
23
+ generatedDeviceUUID: 'N/A',
24
+ idfa: 'N/A',
25
+ idfv: 'N/A',
26
+ gaid: 'N/A',
27
+ fcmToken: storage.get('fcmToken') ?? 'N/A',
28
+ pushToken: storage.get('apnsToken') ?? 'N/A',
29
+ };
30
+
31
+ this.confirmRef = React.createRef()
32
+
33
+ this.fetchIdentifiers()
34
+ }
35
+
36
+ fetchIdentifiers = async () => {
37
+ const response = await NativeModules.IdentifiersInteractor.identifiers()
38
+ console.log('response : ' + response)
39
+ const jsonData = JSON.parse(response)
40
+ const data = jsonData['data']
41
+ this.setState({
42
+ appSetID: data['appSetID'] ?? 'N/A',
43
+ generatedDeviceUUID: data['generatedDeviceUUID'] ?? 'N/A',
44
+ gaid: data['gaid'] ?? 'N/A',
45
+ idfa: data['idfa'] ?? 'N/A',
46
+ idfv: data['idfv'] ?? 'N/A',
47
+ })
48
+ }
49
+
50
+ reloadToken = async () => {
51
+ this.setState({
52
+ fcmToken: 'Reloading..',
53
+ })
54
+
55
+ await fcmService.deleteToken()
56
+
57
+ await fcmService.updateToken()
58
+
59
+ this.setState({
60
+ fcmToken: storage.get('fcmToken') ?? 'N/A',
61
+ })
62
+ }
63
+
64
+ render() {
65
+ return (
66
+ <View style={Styles.container}>
67
+ <VerticalPreference
68
+ title={'UUID'}
69
+ text={this.state.deviceUUID}
70
+ accessibilityLabel={'airbridgeDeviceId'} />
71
+ <VerticalPreference
72
+ title={'AppSetID'}
73
+ text={this.state.appSetID}
74
+ accessibilityLabel={'appSetId'} />
75
+ <VerticalPreference
76
+ title={'GeneratedDeviceUUID'}
77
+ text={this.state.generatedDeviceUUID}
78
+ accessibilityLabel={'generatedDeviceUUID'} />
79
+ <VerticalPreference
80
+ title={'Google Advertising ID (GAID)'}
81
+ text={this.state.gaid}
82
+ accessibilityLabel={'googleAdvertisingId'} />
83
+ <VerticalPreference
84
+ title={'Apple Advertising ID (IDFA)'}
85
+ text={this.state.idfa}
86
+ accessibilityLabel={'appleAdvertisingId'} />
87
+ <VerticalPreference
88
+ title={'Apple Vendor ID (IDFV)'}
89
+ text={this.state.idfv}
90
+ accessibilityLabel={'appleVendorId'} />
91
+ <VerticalPreference
92
+ title={'Firebase Cloud Messaging Token'}
93
+ text={this.state.fcmToken}
94
+ accessibilityLabel={'fcmToken'}
95
+ onPress={() => this.confirmRef.current.show() } />
96
+ <VerticalPreference
97
+ title={'PushToken'}
98
+ text={this.state.apnsToken}
99
+ accessibilityLabel={'airbridgePushToken'} />
100
+
101
+ <ConfirmDialog
102
+ ref={this.confirmRef}
103
+ message={'Firebase Cloud Messaging Token Deleted'}
104
+ onConfirm={() => { this.reloadToken() }} />
105
+ </View>
106
+ )
107
+ }
108
+ }
@@ -0,0 +1,64 @@
1
+ import React, { Component } from 'react'
2
+ import { View, NativeModules } from 'react-native'
3
+
4
+ import { storage } from '../common/Storage'
5
+ import { Styles } from '../common/Styles'
6
+
7
+ import VerticalPreference from '../component/VerticalPreference';
8
+
9
+ export default class InstallReferrerPage extends Component {
10
+
11
+ constructor(props) {
12
+ super(props);
13
+
14
+ this.state = {
15
+ attributeResult: storage.get('attributeResult'),
16
+ };
17
+
18
+ this.addRef = React.createRef()
19
+ this.removeRef = React.createRef()
20
+
21
+ this.fetch()
22
+ }
23
+
24
+ fetch = async () => {
25
+ const response = await NativeModules.InstallReferrerInteractor.installReferrer()
26
+ console.log('response : ' + response)
27
+ const jsonData = JSON.parse(response)
28
+ const data = jsonData['data']
29
+ const NA = 'N/A'
30
+ this.setState({
31
+ google: data['google'] ?? NA,
32
+ oneStore: data['oneStore'] ?? NA,
33
+ huawei: data['huawei'] ?? NA,
34
+ galaxyStore: data['galaxyStore'] ?? NA,
35
+ })
36
+ }
37
+
38
+ render() {
39
+ return (
40
+ <View style={Styles.container}>
41
+ <VerticalPreference
42
+ title='Google install referrer'
43
+ text={this.state.google}
44
+ accessibilityLabel={'googleInstallReferrer'} />
45
+ <VerticalPreference
46
+ title='ONE Store install referrer'
47
+ text={this.state.oneStore}
48
+ accessibilityLabel={'oneStoreInstallReferrer'} />
49
+ <VerticalPreference
50
+ title='Huawei install referrer'
51
+ text={this.state.huawei}
52
+ accessibilityLabel={'huaweiInstallReferrer'} />
53
+ <VerticalPreference
54
+ title='Galaxy Store install referrer'
55
+ text={this.state.galaxyStore}
56
+ accessibilityLabel={'galaxyStoreInstallReferrer'} />
57
+ <VerticalPreference
58
+ title='Attributed touch point'
59
+ text={this.state.attributeResult}
60
+ accessibilityLabel={'attributedTouchPoint'} />
61
+ </View>
62
+ )
63
+ }
64
+ }
@@ -0,0 +1,38 @@
1
+ import React, { useRef } from 'react'
2
+
3
+ import { View } from 'react-native'
4
+ import CustomButton from '../component/CustomButton'
5
+ import { Styles } from '../common/Styles'
6
+ import { Colors } from '../common/Colors'
7
+
8
+ import UrlInputDialog from '../component/UrlInputDialog'
9
+
10
+ import Airbridge from 'airbridge-react-native-sdk'
11
+
12
+ export default function PlacementPage() {
13
+
14
+ const clickUrlRef = useRef();
15
+ const impressionUrlRef = useRef();
16
+
17
+ return (
18
+ <View style={Styles.container}>
19
+ <CustomButton
20
+ buttonColor={Colors.red}
21
+ title={'CLICK'}
22
+ accessibilityLabel={'click'}
23
+ onPress={() => clickUrlRef.current.show()} />
24
+ <CustomButton
25
+ buttonColor={Colors.pink}
26
+ title={'IMPRESSION'}
27
+ accessibilityLabel={'impression'}
28
+ onPress={() => impressionUrlRef.current.show()} />
29
+
30
+ <UrlInputDialog
31
+ ref={clickUrlRef}
32
+ onConfirm={(value) => Airbridge.placement.click(value)} />
33
+ <UrlInputDialog
34
+ ref={impressionUrlRef}
35
+ onConfirm={(value) => Airbridge.placement.impression(value)} />
36
+ </View>
37
+ )
38
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react'
2
+ import {
3
+ View,
4
+ Platform,
5
+ } from 'react-native'
6
+
7
+ import { native } from '../common/Native'
8
+ import CustomButton from '../component/CustomButton'
9
+ import { Styles } from '../common/Styles'
10
+ import { Colors } from '../common/Colors'
11
+
12
+ import Toast from 'react-native-simple-toast'
13
+
14
+ export const RequestPermissionsPage = () => {
15
+ return <View style={Styles.container}>
16
+ <CustomButton
17
+ buttonColor={Colors.red}
18
+ title={'ACCESS_FINE_LOCATION'}
19
+ accessibilityLabel={'accessFineLocation'}
20
+ onPress={() => {
21
+ if (Platform.OS === 'android') {
22
+ native.permission.android.accessFineLocation()
23
+ }
24
+ else {
25
+ Toast.show('Not supported this platform', 1)
26
+ }
27
+ }} />
28
+ <CustomButton
29
+ buttonColor={Colors.pink}
30
+ title={'ACCESS_COARSE_LOCATION'}
31
+ accessibilityLabel={'accessCoarseLocation'}
32
+ onPress={() => {
33
+ if (Platform.OS === 'android') {
34
+ native.permission.android.accessCoarseLocation()
35
+ }
36
+ else {
37
+ Toast.show('Not supported this platform', 1)
38
+ }
39
+ }} />
40
+ </View>
41
+ }
@@ -0,0 +1,168 @@
1
+ import React, { useRef } from 'react'
2
+
3
+ import { View, NativeModules, Platform } from 'react-native'
4
+
5
+ import { Styles } from '../common/Styles'
6
+ import { Colors } from '../common/Colors'
7
+
8
+ import CustomButton from '../component/CustomButton'
9
+ import ValueInputDialog from '../component/ValueInputDialog'
10
+ import AttributeEntryInputDialog from '../component/AttributeEntryInputDialog'
11
+ import EntryInputDialog from '../component/EntryInputDialog'
12
+
13
+ import Airbridge from 'airbridge-react-native-sdk'
14
+
15
+ export default function UserInfoPage() {
16
+
17
+ const idRef = useRef();
18
+ const emailRef = useRef();
19
+ const phoneRef = useRef();
20
+
21
+ const attrEntryRef = useRef();
22
+ const attrKeyRef = useRef();
23
+
24
+ const aliasEntryRef = useRef();
25
+ const aliasKeyRef = useRef();
26
+
27
+ return (
28
+ <View style={Styles.container}>
29
+ <CustomButton
30
+ buttonColor={Colors.red}
31
+ title={'SET ID'}
32
+ accessibilityLabel={'setId'}
33
+ arrow={true}
34
+ onPress={() => idRef.current.show()} />
35
+ <CustomButton
36
+ buttonColor={Colors.red}
37
+ title={'CLEAR ID'}
38
+ accessibilityLabel={'clearId'}
39
+ onPress={() => NativeModules.UserInfoInteractor.clearId()} />
40
+
41
+ <CustomButton
42
+ buttonColor={Colors.pink}
43
+ title={'SET EMAIL'}
44
+ accessibilityLabel={'setEmail'}
45
+ arrow={true}
46
+ onPress={() => emailRef.current.show()} />
47
+ <CustomButton
48
+ buttonColor={Colors.pink}
49
+ title={'CLEAR EMAIL'}
50
+ accessibilityLabel={'clearEmail'}
51
+ onPress={() => NativeModules.UserInfoInteractor.clearEmail()} />
52
+
53
+ <CustomButton
54
+ buttonColor={Colors.purple}
55
+ title={'SET PHONE'}
56
+ accessibilityLabel={'setPhone'}
57
+ arrow={true}
58
+ onPress={() => phoneRef.current.show()} />
59
+ <CustomButton
60
+ buttonColor={Colors.purple}
61
+ title={'CLEAR PHONE'}
62
+ accessibilityLabel={'clearPhone'}
63
+ onPress={() => NativeModules.UserInfoInteractor.clearPhone()} />
64
+
65
+ <CustomButton
66
+ buttonColor={Colors.deepPurple}
67
+ title={'ADD ATTRIBUTE'}
68
+ accessibilityLabel={'addAttribute'}
69
+ arrow={true}
70
+ onPress={() => attrEntryRef.current.show()} />
71
+ <CustomButton
72
+ buttonColor={Colors.indigo}
73
+ title={'REMOVE ATTRIBUTE'}
74
+ accessibilityLabel={'removeAttribute'}
75
+ arrow={true}
76
+ onPress={() => attrKeyRef.current.show()} />
77
+ <CustomButton
78
+ buttonColor={Colors.blue}
79
+ title={'CLEAR ATTRIBUTE'}
80
+ accessibilityLabel={'clearAttributes'}
81
+ onPress={() => NativeModules.UserInfoInteractor.clearAttributes()} />
82
+
83
+ <CustomButton
84
+ buttonColor={Colors.lightBlue}
85
+ title={'ADD ALIAS'}
86
+ accessibilityLabel={'addAlias'}
87
+ arrow={true}
88
+ onPress={() => aliasEntryRef.current.show()} />
89
+ <CustomButton
90
+ buttonColor={Colors.cyan}
91
+ title={'REMOVE ALIAS'}
92
+ accessibilityLabel={'removeAlias'}
93
+ arrow={true}
94
+ onPress={() => aliasKeyRef.current.show()} />
95
+ <CustomButton
96
+ buttonColor={Colors.teal}
97
+ title={'CLEAR ALIAS'}
98
+ accessibilityLabel={'clearAlias'}
99
+ onPress={() => NativeModules.UserInfoInteractor.clearAlias()} />
100
+
101
+ <CustomButton
102
+ buttonColor={Colors.green}
103
+ title={'CLEAR ALL'}
104
+ accessibilityLabel={'clearAll'}
105
+ onPress={() => Airbridge.state.setUser({})} />
106
+
107
+ <View style={{ margin: 16}} />
108
+ <CustomButton
109
+ buttonColor={Colors.lime}
110
+ title={'SEND DUMMY EVENT'}
111
+ accessibilityLabel={'dummyEvent'}
112
+ onPress={() => Airbridge.trackEvent("dummy_event")} />
113
+
114
+ <ValueInputDialog
115
+ ref={idRef}
116
+ onConfirm={(value) => Airbridge.state.updateUser({ID:value})} />
117
+ <ValueInputDialog
118
+ ref={emailRef}
119
+ onConfirm={(value) => Airbridge.state.updateUser({email:value})} />
120
+ <ValueInputDialog
121
+ ref={phoneRef}
122
+ onConfirm={(value) => Airbridge.state.updateUser({phone:value})} />
123
+
124
+ <AttributeEntryInputDialog
125
+ ref={attrEntryRef}
126
+ onConfirm={(key, value, type) => {
127
+ let argument = {
128
+ 'key': key,
129
+ 'type': type.toLowerCase()
130
+ }
131
+ switch (type.toLowerCase()) {
132
+ case 'int':
133
+ case 'long':
134
+ argument['value'] = parseInt(value)
135
+ //NativeModules.UserInfoInteractor.addAttribute(key, parseInt(value))
136
+ break;
137
+ case 'float':
138
+ case 'double':
139
+ argument['value'] = parseFloat(value)
140
+ //NativeModules.UserInfoInteractor.addAttribute(key, parseFloat(value))
141
+ break;
142
+ case 'boolean':
143
+ argument['value'] = value == "true" ? true : false
144
+ //NativeModules.UserInfoInteractor.addAttribute(key, value == "true" ? true : false)
145
+ break
146
+ case 'string':
147
+ argument['value'] = value
148
+ //NativeModules.UserInfoInteractor.addAttribute(key, value)
149
+ break;
150
+ default:
151
+ break;
152
+ }
153
+ NativeModules.UserInfoInteractor.addAttribute(argument)
154
+ }} />
155
+ <ValueInputDialog
156
+ ref={attrKeyRef}
157
+ onConfirm={(value) => NativeModules.UserInfoInteractor.removeAttributes(value) } />
158
+
159
+ <EntryInputDialog
160
+ ref={aliasEntryRef}
161
+ onConfirm={(key, value) => NativeModules.UserInfoInteractor.addAlias(key, value) } />
162
+
163
+ <ValueInputDialog
164
+ ref={aliasKeyRef}
165
+ onConfirm={(value) => NativeModules.UserInfoInteractor.removeAlias(value) } />
166
+ </View>
167
+ )
168
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+ import {
3
+ View
4
+ } from 'react-native';
5
+
6
+ import { Styles } from '../common/Styles'
7
+
8
+ import CustomInfo from '../component/VerticalPreference';
9
+
10
+ export default function AppInfoPage() {
11
+
12
+ return (
13
+ <View style={Styles.container}>
14
+ <CustomInfo
15
+ title='Package Nanme'
16
+ text={'-'} />
17
+ <CustomInfo
18
+ title='Version'
19
+ text={'build : 2024.07.24. pm. 2:30'} />
20
+ </View>
21
+ )
22
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "@react-native/typescript-config/tsconfig.json"
3
+ }
@@ -0,0 +1,48 @@
1
+ process.mainModule.paths.push(process.cwd() + '/node_modules');
2
+
3
+ const fs = require('fs');
4
+ const xcode = require('xcode');
5
+ const path = require('path');
6
+
7
+ const projectName = getProjectName();
8
+ const targetName = projectName.substring(0, projectName.length - 10);
9
+
10
+ const pbxPath = path.join('.', 'ios', projectName, 'project.pbxproj');
11
+
12
+ const project = xcode.project(pbxPath);
13
+ project.parse(function(error) {
14
+ if(error) {
15
+ console.error('fail to add framework');
16
+ console.error('please add AdSupport, iAd, CoreTelephony, StoreKit, AppTrackingTransparency framewoks on xcodeproj');
17
+ return;
18
+ }
19
+
20
+ const target = project.findTargetKey(targetName);
21
+
22
+ project.addFramework('AdSupport.framework', { target: target, weak: true });
23
+ project.addFramework('iAd.framework', { target: target, weak: true });
24
+ project.addFramework('CoreTelephony.framework', { target: target, weak: true });
25
+ project.addFramework('StoreKit.framework', { target: target, weak: true });
26
+ project.addFramework('AppTrackingTransparency.framework', { target: target, weak: true });
27
+
28
+ fs.writeFileSync(pbxPath, project.writeSync());
29
+
30
+ console.info('AdSupport.framework linked to project');
31
+ console.info('iAd.framework linked to project');
32
+ console.info('CoreTelephony.framework linked to project');
33
+ console.info('StoreKit.framework linked to project');
34
+ console.info('AppTrackingTransparency.framework linked to project');
35
+ });
36
+
37
+ function getProjectName() {
38
+ const files = fs.readdirSync(path.join('.', 'ios'));
39
+ const name = files.find(function(file) {
40
+ if(file.indexOf('.xcodeproj') >= 0) {
41
+ return file;
42
+ }
43
+ });
44
+
45
+ if(!name) return '';
46
+
47
+ return name;
48
+ }