react-native-nami-sdk 3.0.9 → 3.0.10
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/.eslintignore +2 -0
- package/.eslintrc.js +12 -0
- package/.github/workflows/CI.yaml +610 -0
- package/.github/workflows/app_prod.yaml +316 -0
- package/.github/workflows/app_stg.yaml +114 -1
- package/.pre-commit-config.yaml +0 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +5 -18
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgePackage.java +0 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt +45 -27
- package/android/src/main/java/com/nami/reactlibrary/NamiCustomerManagerBridge.kt +26 -20
- package/android/src/main/java/com/nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt +15 -12
- package/android/src/main/java/com/nami/reactlibrary/NamiMLManagerBridgeModule.kt +8 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +142 -95
- package/android/src/main/java/com/nami/reactlibrary/NamiPurchaseManagerBridge.kt +12 -14
- package/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt +3 -47
- package/ios/Nami.m +3 -25
- package/ios/NamiCampaignManagerBridge.swift +13 -7
- package/ios/NamiCustomerManager.swift +26 -7
- package/ios/NamiEntitlementManagerBridge.swift +9 -1
- package/ios/NamiMLManagerBridge.m +0 -2
- package/ios/NamiPaywallManagerBridge.m +2 -59
- package/ios/NamiPaywallManagerBridge.swift +67 -58
- package/ios/NamiPurchaseManagerBridge.m +2 -98
- package/ios/NamiPurchaseManagerBridge.swift +45 -5
- package/ios/RNNami-Bridging-Header.h +0 -1
- package/ios/RNNami.xcodeproj/project.pbxproj +1 -62
- package/ios/RNNami.xcworkspace/contents.xcworkspacedata +0 -3
- package/package.json +14 -4
- package/react-native-nami-sdk.podspec +4 -2
- package/src/Nami.d.ts +0 -1
- package/src/NamiCustomerManager.js +2 -2
- package/src/NamiMLManager.d.ts +3 -3
- package/src/NamiMLManager.js +1 -1
- package/src/NamiPaywallManager.d.ts +11 -30
- package/src/NamiPaywallManager.js +13 -8
- package/src/NamiPurchaseManager.d.ts +7 -3
- package/src/types.ts +10 -3
- package/android/src/main/java/com/nami/reactlibrary/NamiEmitter.kt +0 -163
- package/ios/NamiBridgeUtil.h +0 -32
- package/ios/NamiBridgeUtil.m +0 -231
- package/ios/NamiEmitter.m +0 -350
- package/ios/Podfile +0 -71
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
name: Generate Test React PROD
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
inputs:
|
|
5
|
+
ref:
|
|
6
|
+
default: develop
|
|
7
|
+
description: "Git Tag, Branch or SHA to build"
|
|
8
|
+
required: true
|
|
9
|
+
secrets:
|
|
10
|
+
BUILD_USER_PAT:
|
|
11
|
+
required: true
|
|
12
|
+
|
|
13
|
+
pull_request:
|
|
14
|
+
types:
|
|
15
|
+
- closed
|
|
16
|
+
branches:
|
|
17
|
+
- develop
|
|
18
|
+
secrets:
|
|
19
|
+
BUILD_USER_PAT:
|
|
20
|
+
required: true
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
build-android:
|
|
24
|
+
name: Generate Play Store STG
|
|
25
|
+
permissions:
|
|
26
|
+
actions: write
|
|
27
|
+
contents: write
|
|
28
|
+
id-token: write
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/setup-node@v3
|
|
32
|
+
with:
|
|
33
|
+
node-version: "16"
|
|
34
|
+
|
|
35
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
36
|
+
uses: actions/checkout@v2
|
|
37
|
+
with:
|
|
38
|
+
path: source
|
|
39
|
+
ref: '${{ inputs.ref }}'
|
|
40
|
+
|
|
41
|
+
- name: Install Google API python client
|
|
42
|
+
run: |
|
|
43
|
+
pip install google-api-python-client
|
|
44
|
+
|
|
45
|
+
- name: Get new version code
|
|
46
|
+
run: |
|
|
47
|
+
echo $GOOGLE_PLAY_SERVICE_ACCOUNT > $RUNNER_TEMP/.service_account
|
|
48
|
+
python3 build-utils/get_version_code.py $RUNNER_TEMP/.service_account com.namiml.stg.testreactnative internal --quiet >> $RUNNER_TEMP/.new_version_code
|
|
49
|
+
rm -f .service_account
|
|
50
|
+
env:
|
|
51
|
+
GOOGLE_PLAY_SERVICE_ACCOUNT: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
|
|
52
|
+
working-directory: source
|
|
53
|
+
|
|
54
|
+
- name: Update version code
|
|
55
|
+
working-directory: source/examples/Basic/android/app
|
|
56
|
+
run: |
|
|
57
|
+
NEW_VERSION_CODE=`cat $RUNNER_TEMP/.new_version_code`
|
|
58
|
+
echo $NEW_VERSION_CODE
|
|
59
|
+
sed -i "s/versionCode 1/versionCode $NEW_VERSION_CODE/" build.gradle
|
|
60
|
+
|
|
61
|
+
- name: Create the Keystore
|
|
62
|
+
run: |
|
|
63
|
+
# import keystore from secrets
|
|
64
|
+
echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore
|
|
65
|
+
env:
|
|
66
|
+
KEYSTORE_BASE64: '${{ secrets.KEY_STORE_BASE64 }}'
|
|
67
|
+
|
|
68
|
+
- name: Install test app dependencies
|
|
69
|
+
run: |
|
|
70
|
+
yarn install
|
|
71
|
+
working-directory: source/examples/Basic
|
|
72
|
+
|
|
73
|
+
- name: Build Android App Bundle
|
|
74
|
+
run: |
|
|
75
|
+
./gradlew clean bundleStagingRelease
|
|
76
|
+
working-directory: source/examples/Basic/android
|
|
77
|
+
|
|
78
|
+
- name: Sign Android App Bundle
|
|
79
|
+
run: |
|
|
80
|
+
jarsigner -keystore $RUNNER_TEMP/my_production.keystore -storepass '${{ secrets.KEY_STORE_PASSWORD }}' -keypass '${{ secrets.KEY_PASSWORD }}' -sigalg SHA256withRSA -digestalg SHA-256 -signedjar build/outputs/bundle/stagingRelease/app-staging-release-signed.aab build/outputs/bundle/stagingRelease/app-staging-release.aab '${{ secrets.KEY_ALIAS }}'
|
|
81
|
+
working-directory: source/examples/Basic/android/app
|
|
82
|
+
|
|
83
|
+
- name: Uploading to test track
|
|
84
|
+
uses: r0adkll/upload-google-play@v1.0.17
|
|
85
|
+
with:
|
|
86
|
+
packageName: 'com.namiml.stg.testreactnative'
|
|
87
|
+
releaseFiles: source/examples/Basic/android/app/build/outputs/bundle/stagingRelease/app-staging-release-signed.aab
|
|
88
|
+
serviceAccountJsonPlainText: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
|
|
89
|
+
status: completed
|
|
90
|
+
track: internal
|
|
91
|
+
build-ios-prod:
|
|
92
|
+
name: Build TestNami iOS PROD
|
|
93
|
+
permissions:
|
|
94
|
+
actions: write
|
|
95
|
+
contents: write
|
|
96
|
+
id-token: write
|
|
97
|
+
runs-on: macos-12
|
|
98
|
+
timeout-minutes: 40
|
|
99
|
+
steps:
|
|
100
|
+
- uses: actions/setup-node@v3
|
|
101
|
+
with:
|
|
102
|
+
node-version: "16"
|
|
103
|
+
|
|
104
|
+
- name: "Checkout ${{ inputs.ref }}"
|
|
105
|
+
uses: actions/checkout@v2
|
|
106
|
+
with:
|
|
107
|
+
path: source
|
|
108
|
+
ref: "${{ inputs.ref }}"
|
|
109
|
+
|
|
110
|
+
- name: Checkout appstoreconnect-build-tools
|
|
111
|
+
uses: actions/checkout@v2
|
|
112
|
+
with:
|
|
113
|
+
path: appstoreconnect-build-tools
|
|
114
|
+
ref: main
|
|
115
|
+
repository: namiml/appstoreconnect-build-tools
|
|
116
|
+
|
|
117
|
+
- name: Set up Python
|
|
118
|
+
uses: actions/setup-python@v1
|
|
119
|
+
with:
|
|
120
|
+
python-version: "3.10"
|
|
121
|
+
|
|
122
|
+
- name: Get expected build number
|
|
123
|
+
run: |
|
|
124
|
+
pip3 install requests
|
|
125
|
+
pip3 install pydantic
|
|
126
|
+
pip3 install cryptography
|
|
127
|
+
pip3 install PyJWT
|
|
128
|
+
echo "1.0" > $RUNNER_TEMP/.current_version
|
|
129
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
130
|
+
python3 get_next_build.py com.namiml.app.testreactnative --prerelease --version=$CURRENT_VERSION --platform=IOS > $RUNNER_TEMP/.next_build_number
|
|
131
|
+
working-directory: appstoreconnect-build-tools
|
|
132
|
+
env:
|
|
133
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
134
|
+
APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
|
|
135
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
136
|
+
|
|
137
|
+
- name: Install Apple Certificate
|
|
138
|
+
uses: apple-actions/import-codesign-certs@v1
|
|
139
|
+
with:
|
|
140
|
+
p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
|
|
141
|
+
p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
|
|
142
|
+
|
|
143
|
+
- name: Install the provisioning profile
|
|
144
|
+
run: |
|
|
145
|
+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
|
146
|
+
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
|
|
147
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
148
|
+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
|
149
|
+
env:
|
|
150
|
+
PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_PROD }}"
|
|
151
|
+
|
|
152
|
+
- name: Store App Store Private Key
|
|
153
|
+
run: |
|
|
154
|
+
mkdir ~/.private_keys
|
|
155
|
+
echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
|
|
156
|
+
|
|
157
|
+
- name: Update ExportOptions.plist
|
|
158
|
+
run: |
|
|
159
|
+
sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
|
|
160
|
+
sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_PROD }}/g" ExportOptions.plist
|
|
161
|
+
working-directory: source/examples/Basic/ios
|
|
162
|
+
|
|
163
|
+
- name: Adjust version & build number
|
|
164
|
+
run: |-
|
|
165
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
166
|
+
export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
|
|
167
|
+
sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
|
|
168
|
+
sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
|
|
169
|
+
sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Basic/Info.plist
|
|
170
|
+
working-directory: source/examples/Basic
|
|
171
|
+
|
|
172
|
+
- name: Install test app dependencies
|
|
173
|
+
run: |
|
|
174
|
+
yarn install
|
|
175
|
+
working-directory: source/examples/Basic
|
|
176
|
+
|
|
177
|
+
- name: Install test iOS dependencies
|
|
178
|
+
run: |
|
|
179
|
+
pod install
|
|
180
|
+
working-directory: source/examples/Basic/ios
|
|
181
|
+
|
|
182
|
+
- name: Build resolve Swift dependencies
|
|
183
|
+
run: |
|
|
184
|
+
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme BasicProduction -configuration Release
|
|
185
|
+
working-directory: source/examples/Basic
|
|
186
|
+
|
|
187
|
+
- name: Build xArchive
|
|
188
|
+
run: |
|
|
189
|
+
xcodebuild -workspace ios/Basic.xcworkspace -scheme BasicProduction -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app-prod.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_PROD }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
|
|
190
|
+
working-directory: source/examples/Basic
|
|
191
|
+
|
|
192
|
+
- name: Export IPA
|
|
193
|
+
run: |
|
|
194
|
+
xcodebuild -exportArchive -archivePath build-output/app-prod.xcarchive -exportPath build-output/ios-prod -exportOptionsPlist ios/ExportOptions.plist
|
|
195
|
+
working-directory: source/examples/Basic
|
|
196
|
+
|
|
197
|
+
- name: Upload app to TestFlight
|
|
198
|
+
run: |
|
|
199
|
+
xcrun altool --upload-app --type ios --file build-output/ios-prod/BasicProduction.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
|
|
200
|
+
working-directory: source/examples/Basic
|
|
201
|
+
env:
|
|
202
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
203
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
204
|
+
build-tvos-prod:
|
|
205
|
+
name: Build TestNamiTV tvOS PROD
|
|
206
|
+
permissions:
|
|
207
|
+
actions: write
|
|
208
|
+
contents: write
|
|
209
|
+
id-token: write
|
|
210
|
+
runs-on: macos-12
|
|
211
|
+
timeout-minutes: 40
|
|
212
|
+
steps:
|
|
213
|
+
- uses: actions/setup-node@v3
|
|
214
|
+
with:
|
|
215
|
+
node-version: "16"
|
|
216
|
+
|
|
217
|
+
- name: "Checkout ${{ inputs.ref }}"
|
|
218
|
+
uses: actions/checkout@v2
|
|
219
|
+
with:
|
|
220
|
+
path: source
|
|
221
|
+
ref: "${{ inputs.ref }}"
|
|
222
|
+
|
|
223
|
+
- name: Checkout appstoreconnect-build-tools
|
|
224
|
+
uses: actions/checkout@v2
|
|
225
|
+
with:
|
|
226
|
+
path: appstoreconnect-build-tools
|
|
227
|
+
ref: main
|
|
228
|
+
repository: namiml/appstoreconnect-build-tools
|
|
229
|
+
|
|
230
|
+
- name: Set up Python
|
|
231
|
+
uses: actions/setup-python@v1
|
|
232
|
+
with:
|
|
233
|
+
python-version: "3.10"
|
|
234
|
+
|
|
235
|
+
- name: Get expected build number
|
|
236
|
+
run: |
|
|
237
|
+
pip3 install requests
|
|
238
|
+
pip3 install pydantic
|
|
239
|
+
pip3 install cryptography
|
|
240
|
+
pip3 install PyJWT
|
|
241
|
+
echo "1.0" > $RUNNER_TEMP/.current_version
|
|
242
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
243
|
+
python3 get_next_build.py com.namiml.stg.testreactnative --prerelease --platform=TV_OS > $RUNNER_TEMP/.next_build_number
|
|
244
|
+
working-directory: appstoreconnect-build-tools
|
|
245
|
+
env:
|
|
246
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
247
|
+
APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
|
|
248
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
249
|
+
|
|
250
|
+
- name: Install Apple Certificate
|
|
251
|
+
uses: apple-actions/import-codesign-certs@v1
|
|
252
|
+
with:
|
|
253
|
+
p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
|
|
254
|
+
p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
|
|
255
|
+
|
|
256
|
+
- name: Install the provisioning profile
|
|
257
|
+
run: |
|
|
258
|
+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
|
259
|
+
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
|
|
260
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
261
|
+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
|
262
|
+
env:
|
|
263
|
+
PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_TVOS_PROD }}"
|
|
264
|
+
|
|
265
|
+
- name: Store App Store Private Key
|
|
266
|
+
run: |
|
|
267
|
+
mkdir ~/.private_keys
|
|
268
|
+
echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
|
|
269
|
+
|
|
270
|
+
- name: Update ExportOptions.plist
|
|
271
|
+
run: |
|
|
272
|
+
sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
|
|
273
|
+
sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_PROD }}/g" ExportOptions.plist
|
|
274
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
275
|
+
|
|
276
|
+
- name: Adjust version & build number
|
|
277
|
+
run: |-
|
|
278
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
279
|
+
export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
|
|
280
|
+
sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
|
|
281
|
+
sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
|
|
282
|
+
sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Info-PROD.plist
|
|
283
|
+
working-directory: source/examples/TestNamiTV
|
|
284
|
+
|
|
285
|
+
- name: Install test app dependencies
|
|
286
|
+
run: |
|
|
287
|
+
yarn install
|
|
288
|
+
working-directory: source/examples/TestNamiTV
|
|
289
|
+
|
|
290
|
+
- name: Install test tvOS dependencies
|
|
291
|
+
run: |
|
|
292
|
+
RCT_NEW_ARCH_ENABLED=0 SWIFT_VERSION=5 pod install
|
|
293
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
294
|
+
|
|
295
|
+
- name: Build resolve Swift dependencies
|
|
296
|
+
run: |
|
|
297
|
+
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme Basic-tvOS-PROD -configuration Release
|
|
298
|
+
working-directory: source/examples/TestNamiTV
|
|
299
|
+
|
|
300
|
+
- name: Build xArchive
|
|
301
|
+
run: |
|
|
302
|
+
xcodebuild -workspace ios/Basic.xcworkspace -scheme Basic-tvOS-PROD -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'appletvos' -destination 'generic/platform=tvOS' -archivePath build-output/app-prod.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_PROD }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
|
|
303
|
+
working-directory: source/examples/TestNamiTV
|
|
304
|
+
|
|
305
|
+
- name: Export IPA
|
|
306
|
+
run: |
|
|
307
|
+
xcodebuild -exportArchive -archivePath build-output/app-prod.xcarchive -exportPath build-output/tvos-prod -exportOptionsPlist ios/ExportOptions.plist
|
|
308
|
+
working-directory: source/examples/TestNamiTV
|
|
309
|
+
|
|
310
|
+
- name: Upload app to TestFlight
|
|
311
|
+
run: |
|
|
312
|
+
xcrun altool --upload-app --type tvos --file build-output/tvos-prod/Basic-tvOS-PROD.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
|
|
313
|
+
working-directory: source/examples/TestNamiTV
|
|
314
|
+
env:
|
|
315
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
316
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
@@ -88,7 +88,7 @@ jobs:
|
|
|
88
88
|
serviceAccountJsonPlainText: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
|
|
89
89
|
status: completed
|
|
90
90
|
track: internal
|
|
91
|
-
build-ios:
|
|
91
|
+
build-ios-stg:
|
|
92
92
|
name: Generate Apple STG
|
|
93
93
|
permissions:
|
|
94
94
|
actions: write
|
|
@@ -201,3 +201,116 @@ jobs:
|
|
|
201
201
|
env:
|
|
202
202
|
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
203
203
|
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
204
|
+
build-tvos-stg:
|
|
205
|
+
name: Build TestNamiTV tvOS STG
|
|
206
|
+
permissions:
|
|
207
|
+
actions: write
|
|
208
|
+
contents: write
|
|
209
|
+
id-token: write
|
|
210
|
+
runs-on: macos-12
|
|
211
|
+
timeout-minutes: 40
|
|
212
|
+
steps:
|
|
213
|
+
- uses: actions/setup-node@v3
|
|
214
|
+
with:
|
|
215
|
+
node-version: "16"
|
|
216
|
+
|
|
217
|
+
- name: "Checkout ${{ inputs.ref }}"
|
|
218
|
+
uses: actions/checkout@v2
|
|
219
|
+
with:
|
|
220
|
+
path: source
|
|
221
|
+
ref: "${{ inputs.ref }}"
|
|
222
|
+
|
|
223
|
+
- name: Checkout appstoreconnect-build-tools
|
|
224
|
+
uses: actions/checkout@v2
|
|
225
|
+
with:
|
|
226
|
+
path: appstoreconnect-build-tools
|
|
227
|
+
ref: main
|
|
228
|
+
repository: namiml/appstoreconnect-build-tools
|
|
229
|
+
|
|
230
|
+
- name: Set up Python
|
|
231
|
+
uses: actions/setup-python@v1
|
|
232
|
+
with:
|
|
233
|
+
python-version: "3.10"
|
|
234
|
+
|
|
235
|
+
- name: Get expected build number
|
|
236
|
+
run: |
|
|
237
|
+
pip3 install requests
|
|
238
|
+
pip3 install pydantic
|
|
239
|
+
pip3 install cryptography
|
|
240
|
+
pip3 install PyJWT
|
|
241
|
+
echo "1.0" > $RUNNER_TEMP/.current_version
|
|
242
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
243
|
+
python3 get_next_build.py com.namiml.stg.testreactnative --prerelease --platform=TV_OS > $RUNNER_TEMP/.next_build_number
|
|
244
|
+
working-directory: appstoreconnect-build-tools
|
|
245
|
+
env:
|
|
246
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
247
|
+
APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
|
|
248
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
249
|
+
|
|
250
|
+
- name: Install Apple Certificate
|
|
251
|
+
uses: apple-actions/import-codesign-certs@v1
|
|
252
|
+
with:
|
|
253
|
+
p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
|
|
254
|
+
p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
|
|
255
|
+
|
|
256
|
+
- name: Install the provisioning profile
|
|
257
|
+
run: |
|
|
258
|
+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
|
259
|
+
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
|
|
260
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
261
|
+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
|
262
|
+
env:
|
|
263
|
+
PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_TVOS_STG }}"
|
|
264
|
+
|
|
265
|
+
- name: Store App Store Private Key
|
|
266
|
+
run: |
|
|
267
|
+
mkdir ~/.private_keys
|
|
268
|
+
echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
|
|
269
|
+
|
|
270
|
+
- name: Update ExportOptions.plist
|
|
271
|
+
run: |
|
|
272
|
+
sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
|
|
273
|
+
sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_STG }}/g" ExportOptions.plist
|
|
274
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
275
|
+
|
|
276
|
+
- name: Adjust version & build number
|
|
277
|
+
run: |-
|
|
278
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
279
|
+
export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
|
|
280
|
+
sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
|
|
281
|
+
sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
|
|
282
|
+
sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Info-STG.plist
|
|
283
|
+
working-directory: source/examples/TestNamiTV
|
|
284
|
+
|
|
285
|
+
- name: Install test app dependencies
|
|
286
|
+
run: |
|
|
287
|
+
yarn install
|
|
288
|
+
working-directory: source/examples/TestNamiTV
|
|
289
|
+
|
|
290
|
+
- name: Install test tvOS dependencies
|
|
291
|
+
run: |
|
|
292
|
+
RCT_NEW_ARCH_ENABLED=0 SWIFT_VERSION=5 pod install
|
|
293
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
294
|
+
|
|
295
|
+
- name: Build resolve Swift dependencies
|
|
296
|
+
run: |
|
|
297
|
+
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme Basic-tvOS -configuration Release
|
|
298
|
+
working-directory: source/examples/TestNamiTV
|
|
299
|
+
|
|
300
|
+
- name: Build xArchive
|
|
301
|
+
run: |
|
|
302
|
+
xcodebuild -workspace ios/Basic.xcworkspace -scheme Basic-tvOS -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'appletvos' -destination 'generic/platform=tvOS' -archivePath build-output/app-stg.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_STG }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
|
|
303
|
+
working-directory: source/examples/TestNamiTV
|
|
304
|
+
|
|
305
|
+
- name: Export IPA
|
|
306
|
+
run: |
|
|
307
|
+
xcodebuild -exportArchive -archivePath build-output/app-stg.xcarchive -exportPath build-output/tvos-stg -exportOptionsPlist ios/ExportOptions.plist
|
|
308
|
+
working-directory: source/examples/TestNamiTV
|
|
309
|
+
|
|
310
|
+
- name: Upload app to TestFlight
|
|
311
|
+
run: |
|
|
312
|
+
xcrun altool --upload-app --type tvos --file build-output/tvos-stg/Basic-tvOS.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
|
|
313
|
+
working-directory: source/examples/TestNamiTV
|
|
314
|
+
env:
|
|
315
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
316
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
package/.pre-commit-config.yaml
CHANGED
package/android/build.gradle
CHANGED
|
@@ -39,7 +39,7 @@ android {
|
|
|
39
39
|
compileSdkVersion 33
|
|
40
40
|
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
41
41
|
defaultConfig {
|
|
42
|
-
minSdkVersion
|
|
42
|
+
minSdkVersion 25
|
|
43
43
|
targetSdkVersion 33
|
|
44
44
|
versionCode 1
|
|
45
45
|
versionName "1.0"
|
|
@@ -81,7 +81,7 @@ dependencies {
|
|
|
81
81
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
82
82
|
|
|
83
83
|
implementation 'com.github.jeziellago:compose-markdown:0.3.0'
|
|
84
|
-
implementation "com.namiml:sdk-android:3.0.
|
|
84
|
+
implementation "com.namiml:sdk-android:3.0.11"
|
|
85
85
|
|
|
86
86
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
87
87
|
}
|
|
@@ -10,13 +10,11 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
|
10
10
|
import com.facebook.react.bridge.ReactMethod
|
|
11
11
|
import com.facebook.react.bridge.ReadableArray
|
|
12
12
|
import com.facebook.react.bridge.ReadableMap
|
|
13
|
-
import com.facebook.react.bridge.WritableArray
|
|
14
|
-
import com.facebook.react.bridge.WritableNativeArray
|
|
15
13
|
import com.namiml.Nami
|
|
16
14
|
import com.namiml.NamiConfiguration
|
|
17
15
|
import com.namiml.NamiLanguageCode
|
|
18
16
|
import com.namiml.NamiLogLevel
|
|
19
|
-
//import com.namiml.NamiApiResponseHandler
|
|
17
|
+
// import com.namiml.NamiApiResponseHandler
|
|
20
18
|
|
|
21
19
|
class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
22
20
|
ReactContextBaseJavaModule(reactContext) {
|
|
@@ -37,7 +35,6 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
37
35
|
|
|
38
36
|
@ReactMethod
|
|
39
37
|
fun configure(configDict: ReadableMap, completion: Callback) {
|
|
40
|
-
|
|
41
38
|
// Need to be sure we have some valid string.
|
|
42
39
|
val appPlatformID: String = if (configDict.hasKey(CONFIG_MAP_PLATFORM_ID_KEY)) {
|
|
43
40
|
configDict.getString(CONFIG_MAP_PLATFORM_ID_KEY) ?: PLATFORM_ID_ERROR_VALUE
|
|
@@ -54,7 +51,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
54
51
|
Log.i(LOG_TAG, "Configure called with (context as Application) $isApplication.")
|
|
55
52
|
Log.i(LOG_TAG, "End Application check ")
|
|
56
53
|
|
|
57
|
-
//Application fred = (reactContext as Application);
|
|
54
|
+
// Application fred = (reactContext as Application);
|
|
58
55
|
|
|
59
56
|
val builder: NamiConfiguration.Builder =
|
|
60
57
|
NamiConfiguration.Builder(appContext, appPlatformID)
|
|
@@ -92,16 +89,6 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
92
89
|
builder.developmentMode = true
|
|
93
90
|
}
|
|
94
91
|
|
|
95
|
-
val bypassStoreMode = if (configDict.hasKey(CONFIG_MAP_BYPASS_STORE_KEY)) {
|
|
96
|
-
configDict.getBoolean(CONFIG_MAP_BYPASS_STORE_KEY)
|
|
97
|
-
} else {
|
|
98
|
-
false
|
|
99
|
-
}
|
|
100
|
-
Log.i(LOG_TAG, "Nami Configuration bypassStoreMode is $bypassStoreMode")
|
|
101
|
-
if (bypassStoreMode) {
|
|
102
|
-
builder.bypassStore = true
|
|
103
|
-
}
|
|
104
|
-
|
|
105
92
|
val languageCode = if (configDict.hasKey(CONFIG_MAP_LANGUAGE_CODE_KEY)) {
|
|
106
93
|
configDict.getString(CONFIG_MAP_LANGUAGE_CODE_KEY)
|
|
107
94
|
} else {
|
|
@@ -113,7 +100,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
113
100
|
Log.w(
|
|
114
101
|
LOG_TAG,
|
|
115
102
|
"Nami language code from config dictionary \"$code\" not " +
|
|
116
|
-
"found in list of available Nami Language Codes:\n"
|
|
103
|
+
"found in list of available Nami Language Codes:\n",
|
|
117
104
|
)
|
|
118
105
|
} else {
|
|
119
106
|
builder.namiLanguageCode = namiLanguageCode
|
|
@@ -127,7 +114,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
127
114
|
} else {
|
|
128
115
|
Arguments.createArray()
|
|
129
116
|
}
|
|
130
|
-
val settingsList = mutableListOf("extendedClientInfo:react-native:3.0.
|
|
117
|
+
val settingsList = mutableListOf("extendedClientInfo:react-native:3.0.10")
|
|
131
118
|
namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
|
|
132
119
|
settingsList.addAll(commandsFromReact)
|
|
133
120
|
}
|
|
@@ -145,4 +132,4 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
145
132
|
completion.invoke(resultMap)
|
|
146
133
|
}
|
|
147
134
|
}
|
|
148
|
-
}
|
|
135
|
+
}
|
|
@@ -26,7 +26,6 @@ public class NamiBridgePackage implements ReactPackage {
|
|
|
26
26
|
moduleList.add(new NamiMLManagerBridgeModule(reactContext));
|
|
27
27
|
moduleList.add(new NamiCustomerManagerBridgeModule(reactContext));
|
|
28
28
|
moduleList.add(new NamiCampaignManagerBridgeModule(reactContext));
|
|
29
|
-
moduleList.add(new NamiEmitter(reactContext));
|
|
30
29
|
|
|
31
30
|
return moduleList;
|
|
32
31
|
}
|