react-native-nami-sdk 3.3.0-beta.7 → 3.3.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.
Files changed (106) hide show
  1. package/.prettierrc +4 -0
  2. package/README.md +9 -9
  3. package/android/README.md +3 -2
  4. package/android/build.gradle +27 -19
  5. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  6. package/android/gradlew +0 -0
  7. package/android/src/main/AndroidManifest.xml +1 -1
  8. package/android/src/main/java/com/namiml/reactnative/Constants.kt +3 -0
  9. package/android/src/main/java/com/namiml/reactnative/NamiBridgeModule.kt +91 -0
  10. package/android/src/main/java/com/namiml/reactnative/NamiBridgePackage.java +140 -0
  11. package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiCampaignManagerBridge.kt +24 -30
  12. package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiCustomerManagerBridge.kt +14 -6
  13. package/android/src/main/java/com/{nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt → namiml/reactnative/NamiEntitlementManagerBridge.kt} +18 -8
  14. package/android/src/main/java/com/namiml/reactnative/NamiFlowManagerBridge.kt +67 -0
  15. package/android/src/main/java/com/namiml/reactnative/NamiPaywallManagerBridgeModule.kt +196 -0
  16. package/android/src/main/java/com/namiml/reactnative/NamiPurchaseManagerBridge.kt +114 -0
  17. package/android/src/main/java/com/{nami/reactlibrary → namiml/reactnative}/NamiUtil.kt +26 -23
  18. package/{index.d.ts → dist/index.d.ts} +0 -2
  19. package/dist/specs/NativeNami.d.ts +15 -0
  20. package/dist/specs/NativeNamiCampaignManager.d.ts +82 -0
  21. package/dist/specs/NativeNamiCustomerManager.d.ts +29 -0
  22. package/dist/specs/NativeNamiEntitlementManager.d.ts +45 -0
  23. package/dist/specs/NativeNamiFlowManager.d.ts +8 -0
  24. package/dist/specs/NativeNamiPaywallManager.d.ts +71 -0
  25. package/dist/specs/NativeNamiPurchaseManager.d.ts +28 -0
  26. package/dist/src/Nami.d.ts +5 -0
  27. package/dist/src/NamiCampaignManager.d.ts +29 -0
  28. package/{src → dist/src}/NamiCustomerManager.d.ts +11 -13
  29. package/dist/src/NamiEntitlementManager.d.ts +13 -0
  30. package/dist/src/NamiFlowManager.d.ts +11 -0
  31. package/dist/src/NamiPaywallManager.d.ts +30 -0
  32. package/dist/src/NamiPurchaseManager.d.ts +17 -0
  33. package/dist/src/transformers.d.ts +3 -0
  34. package/{src → dist/src}/types.d.ts +35 -6
  35. package/dist/src/version.d.ts +5 -0
  36. package/index.ts +0 -2
  37. package/ios/Nami.m +8 -88
  38. package/ios/Nami.swift +85 -0
  39. package/ios/NamiCampaignManagerBridge.m +3 -3
  40. package/ios/NamiCampaignManagerBridge.swift +49 -61
  41. package/ios/NamiCustomerManager.m +2 -2
  42. package/ios/NamiCustomerManager.swift +13 -3
  43. package/ios/NamiEntitlementManagerBridge.m +2 -3
  44. package/ios/NamiEntitlementManagerBridge.swift +48 -39
  45. package/ios/NamiFlowManagerBridge.m +2 -2
  46. package/ios/NamiFlowManagerBridge.swift +10 -6
  47. package/ios/NamiPaywallManagerBridge.m +3 -3
  48. package/ios/NamiPaywallManagerBridge.swift +16 -6
  49. package/ios/NamiPurchaseManagerBridge.m +3 -2
  50. package/ios/NamiPurchaseManagerBridge.swift +15 -10
  51. package/ios/RNNami-Bridging-Header.h +1 -3
  52. package/package.json +20 -8
  53. package/react-native-config.js +9 -0
  54. package/react-native-nami-sdk.podspec +11 -3
  55. package/scripts/generate-version.ts +18 -0
  56. package/specs/NativeNami.ts +16 -0
  57. package/specs/NativeNamiCampaignManager.ts +94 -0
  58. package/specs/NativeNamiCustomerManager.ts +37 -0
  59. package/specs/NativeNamiEntitlementManager.ts +54 -0
  60. package/specs/NativeNamiFlowManager.ts +12 -0
  61. package/specs/NativeNamiPaywallManager.ts +85 -0
  62. package/specs/NativeNamiPurchaseManager.ts +33 -0
  63. package/src/Nami.ts +28 -18
  64. package/src/NamiCampaignManager.ts +57 -53
  65. package/src/NamiCustomerManager.ts +55 -81
  66. package/src/NamiEntitlementManager.ts +49 -36
  67. package/src/NamiFlowManager.ts +35 -45
  68. package/src/NamiPaywallManager.ts +84 -139
  69. package/src/NamiPurchaseManager.ts +69 -70
  70. package/src/transformers.ts +21 -0
  71. package/src/types.ts +39 -7
  72. package/src/version.ts +5 -0
  73. package/tsconfig.json +24 -22
  74. package/.eslintignore +0 -3
  75. package/.eslintrc.js +0 -52
  76. package/.github/workflows/CI.yaml +0 -341
  77. package/.github/workflows/app_prod.yaml +0 -387
  78. package/.github/workflows/app_stg.yaml +0 -398
  79. package/.github/workflows/build.yml +0 -70
  80. package/.pre-commit-config.yaml +0 -24
  81. package/.prettierrc.js +0 -7
  82. package/android/src/main/java/com/nami/reactlibrary/Constants.kt +0 -3
  83. package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +0 -141
  84. package/android/src/main/java/com/nami/reactlibrary/NamiBridgePackage.java +0 -51
  85. package/android/src/main/java/com/nami/reactlibrary/NamiFlowManagerBridge.kt +0 -58
  86. package/android/src/main/java/com/nami/reactlibrary/NamiMLManagerBridgeModule.kt +0 -58
  87. package/android/src/main/java/com/nami/reactlibrary/NamiManagerBridge.kt +0 -26
  88. package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +0 -258
  89. package/android/src/main/java/com/nami/reactlibrary/NamiPurchaseManagerBridge.kt +0 -108
  90. package/build-utils/get_version_code.py +0 -140
  91. package/build-utils/preflight.py +0 -46
  92. package/ios/NamiMLManagerBridge.m +0 -93
  93. package/ios/NamiManager.m +0 -18
  94. package/ios/NamiManager.swift +0 -30
  95. package/ios/RNNami.h +0 -10
  96. package/ios/RNNami.m +0 -13
  97. package/src/Nami.d.ts +0 -8
  98. package/src/NamiCampaignManager.d.ts +0 -18
  99. package/src/NamiEntitlementManager.d.ts +0 -15
  100. package/src/NamiFlowManager.d.ts +0 -32
  101. package/src/NamiMLManager.d.ts +0 -7
  102. package/src/NamiMLManager.ts +0 -13
  103. package/src/NamiManager.d.ts +0 -5
  104. package/src/NamiManager.ts +0 -14
  105. package/src/NamiPaywallManager.d.ts +0 -34
  106. package/src/NamiPurchaseManager.d.ts +0 -20
@@ -1,398 +0,0 @@
1
- name: Generate Test React STG
2
- env:
3
- DEVELOPER_DIR: /Applications/Xcode_16.0.0.app/Contents/Developer
4
- on:
5
- workflow_dispatch:
6
- inputs:
7
- ref:
8
- default: main
9
- description: "Git Tag, Branch or SHA to build"
10
- required: true
11
- secrets:
12
- BUILD_USER_PAT:
13
- required: true
14
-
15
- pull_request:
16
- types:
17
- - closed
18
- branches:
19
- - main
20
- secrets:
21
- BUILD_USER_PAT:
22
- required: true
23
-
24
- jobs:
25
- build-android-stg:
26
- name: Generate Play Store STG
27
- permissions:
28
- actions: write
29
- contents: write
30
- id-token: write
31
- runs-on: ubuntu-latest
32
- steps:
33
- - uses: actions/setup-node@v3
34
- with:
35
- node-version: "18"
36
-
37
- - name: 'Checkout ${{ inputs.ref }}'
38
- uses: actions/checkout@v2
39
- with:
40
- path: source
41
- ref: '${{ inputs.ref }}'
42
-
43
- - name: Setup Java
44
- uses: actions/setup-java@v3
45
- with:
46
- cache: gradle
47
- distribution: temurin
48
- java-version: 17
49
-
50
- - name: Install Google API python client
51
- run: |
52
- pip install google-api-python-client
53
-
54
- - name: Get new version code
55
- run: |
56
- echo $GOOGLE_PLAY_SERVICE_ACCOUNT > $RUNNER_TEMP/.service_account
57
- python3 build-utils/get_version_code.py $RUNNER_TEMP/.service_account com.namiml.stg.testreactnative internal --quiet >> $RUNNER_TEMP/.new_version_code
58
- rm -f .service_account
59
- env:
60
- GOOGLE_PLAY_SERVICE_ACCOUNT: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
61
- working-directory: source
62
-
63
- - name: Update version code
64
- working-directory: source/examples/Basic/android/app
65
- run: |
66
- NEW_VERSION_CODE=`cat $RUNNER_TEMP/.new_version_code`
67
- echo $NEW_VERSION_CODE
68
- sed -i "s/versionCode 1/versionCode $NEW_VERSION_CODE/" build.gradle
69
-
70
- - name: Update App Platform ID
71
- working-directory: source/examples/Basic/config/
72
- run: |
73
- sed -i "s/ANDROID_STG_APP_PLATFORM_ID/$BASIC_ANDROID_STG_APP_PLATFORM_ID/" index.ts
74
- env:
75
- BASIC_ANDROID_STG_APP_PLATFORM_ID: '${{ secrets.ANDROID_STG_APP_PLATFORM_ID }}'
76
-
77
- - name: Create the Keystore
78
- run: |
79
- # import keystore from secrets
80
- echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore
81
- env:
82
- KEYSTORE_BASE64: '${{ secrets.KEY_STORE_BASE64 }}'
83
-
84
- - name: Pack the SDK
85
- run: |
86
- npm pack
87
- working-directory: source/
88
-
89
- - name: Install test app dependencies
90
- run: |
91
- yarn install
92
- working-directory: source/examples/Basic
93
-
94
- - name: Manually create the bundle
95
- run: |
96
- mkdir -p android/app/src/main/assets/
97
- npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle
98
- working-directory: source/examples/Basic
99
-
100
- - name: Build Android App Bundle
101
- run: |
102
- ./gradlew clean bundleStagingRelease
103
- working-directory: source/examples/Basic/android
104
-
105
- - name: Sign Android App Bundle
106
- run: |
107
- 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 }}'
108
- working-directory: source/examples/Basic/android/app
109
-
110
- - name: Uploading to test track
111
- uses: r0adkll/upload-google-play@v1.0.17
112
- with:
113
- packageName: 'com.namiml.stg.testreactnative'
114
- releaseFiles: source/examples/Basic/android/app/build/outputs/bundle/stagingRelease/app-staging-release-signed.aab
115
- serviceAccountJsonPlainText: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
116
- status: completed
117
- track: internal
118
- build-ios-stg:
119
- name: Generate Apple STG
120
- permissions:
121
- actions: write
122
- contents: write
123
- id-token: write
124
- runs-on: macos-15
125
- timeout-minutes: 40
126
- steps:
127
- - uses: actions/setup-node@v3
128
- with:
129
- node-version: "18"
130
-
131
- - name: "Checkout ${{ inputs.ref }}"
132
- uses: actions/checkout@v2
133
- with:
134
- path: source
135
- ref: "${{ inputs.ref }}"
136
-
137
- - name: Checkout appstoreconnect-build-tools
138
- uses: actions/checkout@v2
139
- with:
140
- path: appstoreconnect-build-tools
141
- ref: main
142
- repository: namiml/appstoreconnect-build-tools
143
-
144
- - name: Set up Python
145
- uses: actions/setup-python@v5
146
- with:
147
- python-version: "3.13"
148
-
149
- - name: Get expected build number
150
- run: |
151
- pip3 install requests
152
- pip3 install pydantic==1.10.11
153
- pip3 install cryptography
154
- pip3 install PyJWT
155
- echo "1.0" > $RUNNER_TEMP/.current_version
156
- export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
157
- python3 get_next_build.py com.namiml.stg.testreactnative --prerelease --version=$CURRENT_VERSION --platform=IOS > $RUNNER_TEMP/.next_build_number
158
- working-directory: appstoreconnect-build-tools
159
- env:
160
- APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
161
- APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
162
- APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
163
-
164
- - name: Install Apple Certificate
165
- uses: apple-actions/import-codesign-certs@v1
166
- with:
167
- p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
168
- p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
169
-
170
- - name: Install the provisioning profile
171
- run: |
172
- PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
173
- echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode -o $PP_PATH
174
- mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
175
- cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
176
- env:
177
- PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_STG }}"
178
-
179
- - name: Store App Store Private Key
180
- run: |
181
- mkdir ~/.private_keys
182
- echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
183
-
184
- - name: Update ExportOptions.plist
185
- run: |
186
- sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
187
- sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_STG }}/g" ExportOptions.plist
188
- working-directory: source/examples/Basic/ios
189
-
190
- - name: Adjust version & build number
191
- run: |-
192
- export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
193
- export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
194
- sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
195
- sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
196
- sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Basic/Info.plist
197
- echo "BUILD_NUMBER=$(cat ~/.next_build_number)" >> $GITHUB_ENV
198
- echo "CURRENT_VERSION=$(cat ~/.current_version)" >> $GITHUB_ENV
199
- working-directory: source/examples/Basic
200
-
201
- - name: Pack the SDK
202
- run: |
203
- npm pack
204
- working-directory: source/
205
-
206
- - name: Install test app dependencies
207
- run: |
208
- yarn install
209
- working-directory: source/examples/Basic
210
-
211
- - name: Update App Platform ID
212
- working-directory: source/examples/Basic/config/
213
- run: |
214
- sed -i '' -e "s/APPLE_STG_APP_PLATFORM_ID/$BASIC_APPLE_STG_APP_PLATFORM_ID/" index.ts
215
- env:
216
- BASIC_APPLE_STG_APP_PLATFORM_ID: '${{ secrets.APPLE_STG_APP_PLATFORM_ID }}'
217
-
218
- - name: Install test iOS dependencies
219
- run: |
220
- pod install --repo-update
221
- working-directory: source/examples/Basic/ios
222
-
223
- - name: Add initial config
224
- run: |
225
- echo $INITIAL_CONFIG_APPLE_STG > nami_initial_config_apple_stg.json
226
- working-directory: source/examples/Basic
227
- env:
228
- INITIAL_CONFIG_APPLE_STG: '${{ secrets.INITIAL_CONFIG_APPLE_STG }}'
229
-
230
- - name: Build resolve Swift dependencies
231
- run: |
232
- xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme Basic -configuration Release
233
- working-directory: source/examples/Basic
234
-
235
- - name: Build xArchive
236
- run: |
237
- xcodebuild -workspace ios/Basic.xcworkspace -scheme Basic -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app-stg.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_STG }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
238
- working-directory: source/examples/Basic
239
-
240
- - name: Export IPA
241
- run: |
242
- xcodebuild -exportArchive -archivePath build-output/app-stg.xcarchive -exportPath build-output/ios-stg -exportOptionsPlist ios/ExportOptions.plist
243
- working-directory: source/examples/Basic
244
-
245
- - name: Upload app to TestFlight
246
- run: |
247
- xcrun altool --upload-app --type ios --file build-output/ios-stg/Basic.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
248
- working-directory: source/examples/Basic
249
- env:
250
- APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
251
- APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
252
-
253
- - name: Upload PR Title to TestFlight Whats New
254
- working-directory: appstoreconnect-build-tools
255
- run: |-
256
- sleep 120
257
- python3 upload_testflight_whats_new.py com.namiml.stg.testreactnative --notes="${{ env.PR_TITLE }}" --version=${{ env.CURRENT_VERSION }} --platform=IOS --prerelease
258
- env:
259
- APPSTORE_API_PRIVATE_KEY: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
260
- APPSTORE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
261
- APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
262
- build-tvos-stg:
263
- name: Build TestNamiTV tvOS STG
264
- permissions:
265
- actions: write
266
- contents: write
267
- id-token: write
268
- runs-on: macos-15
269
- timeout-minutes: 40
270
- steps:
271
- - uses: actions/setup-node@v3
272
- with:
273
- node-version: "18"
274
-
275
- - name: "Checkout ${{ inputs.ref }}"
276
- uses: actions/checkout@v2
277
- with:
278
- path: source
279
- ref: "${{ inputs.ref }}"
280
-
281
- - name: Checkout appstoreconnect-build-tools
282
- uses: actions/checkout@v2
283
- with:
284
- path: appstoreconnect-build-tools
285
- ref: main
286
- repository: namiml/appstoreconnect-build-tools
287
-
288
- - name: Set up Python
289
- uses: actions/setup-python@v5
290
- with:
291
- python-version: "3.13"
292
-
293
- - name: Get expected build number
294
- run: |
295
- pip3 install requests
296
- pip3 install pydantic==1.10.11
297
- pip3 install cryptography
298
- pip3 install PyJWT
299
- echo "1.0" > $RUNNER_TEMP/.current_version
300
- export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
301
- python3 get_next_build.py com.namiml.stg.testreactnative --prerelease --platform=TV_OS > $RUNNER_TEMP/.next_build_number
302
- working-directory: appstoreconnect-build-tools
303
- env:
304
- APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
305
- APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
306
- APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
307
-
308
- - name: Install Apple Certificate
309
- uses: apple-actions/import-codesign-certs@v1
310
- with:
311
- p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
312
- p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
313
-
314
- - name: Install the provisioning profile
315
- run: |
316
- PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
317
- echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode -o $PP_PATH
318
- mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
319
- cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
320
- env:
321
- PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_TVOS_STG }}"
322
-
323
- - name: Store App Store Private Key
324
- run: |
325
- mkdir ~/.private_keys
326
- echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
327
-
328
- - name: Update ExportOptions.plist
329
- run: |
330
- sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
331
- sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_STG }}/g" ExportOptions.plist
332
- working-directory: source/examples/TestNamiTV/ios
333
-
334
- - name: Adjust version & build number
335
- run: |-
336
- export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
337
- export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
338
- sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
339
- sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
340
- sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Info-STG.plist
341
- echo "BUILD_NUMBER=$(cat ~/.next_build_number)" >> $GITHUB_ENV
342
- echo "CURRENT_VERSION=$(cat ~/.current_version)" >> $GITHUB_ENV
343
- working-directory: source/examples/TestNamiTV
344
-
345
- - name: Install test app dependencies
346
- run: |
347
- yarn install
348
- working-directory: source/examples/TestNamiTV
349
-
350
- - name: Update App Platform ID
351
- working-directory: source/examples/TestNamiTV/config/
352
- run: |
353
- sed -i '' -e "s/APPLE_STAGE_APP_PLATFORM_ID/$TESTNAMITV_APPLE_STG_APP_PLATFORM_ID/" index.ts
354
- env:
355
- TESTNAMITV_APPLE_STG_APP_PLATFORM_ID: '${{ secrets.APPLE_STG_APP_PLATFORM_ID }}'
356
-
357
- - name: Install test tvOS dependencies
358
- run: |
359
- RCT_NEW_ARCH_ENABLED=0 SWIFT_VERSION=5 pod install --repo-update
360
- working-directory: source/examples/TestNamiTV/ios
361
-
362
- # - name: Apply Patches
363
- # run: |
364
- # patch -p0 < *.patch
365
- # working-directory: source/examples/TestNamiTV/patches
366
-
367
- - name: Build resolve Swift dependencies
368
- run: |
369
- xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme Basic-tvOS -configuration Release
370
- working-directory: source/examples/TestNamiTV
371
-
372
- - name: Build xArchive
373
- run: |
374
- 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 }}'
375
- working-directory: source/examples/TestNamiTV
376
-
377
- - name: Export IPA
378
- run: |
379
- xcodebuild -exportArchive -archivePath build-output/app-stg.xcarchive -exportPath build-output/tvos-stg -exportOptionsPlist ios/ExportOptions.plist
380
- working-directory: source/examples/TestNamiTV
381
-
382
- - name: Upload app to TestFlight
383
- run: |
384
- xcrun altool --upload-app --type tvos --file build-output/tvos-stg/Basic-tvOS.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
385
- working-directory: source/examples/TestNamiTV
386
- env:
387
- APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
388
- APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
389
-
390
- - name: Upload PR Title to TestFlight Whats New
391
- working-directory: appstoreconnect-build-tools
392
- run: |-
393
- sleep 120
394
- python3 upload_testflight_whats_new.py com.namiml.stg.testreactnative --notes="${{ env.PR_TITLE }}" --version=${{ env.CURRENT_VERSION }} --platform=TV_OS --prerelease
395
- env:
396
- APPSTORE_API_PRIVATE_KEY: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
397
- APPSTORE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
398
- APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
@@ -1,70 +0,0 @@
1
- name: Build Bridge
2
-
3
- on:
4
- workflow_dispatch:
5
- inputs:
6
- ref:
7
- description: "Git Tag, Branch or SHA to build"
8
- required: true
9
- default: "main"
10
- earlyaccess:
11
- description: "Is this a early access build?"
12
- default: true
13
- type: boolean
14
- secrets:
15
- BUILD_USER_PAT:
16
- required: true
17
-
18
- jobs:
19
- build:
20
- name: Build Bridge release
21
- timeout-minutes: 30
22
- runs-on: ubuntu-latest
23
- permissions:
24
- actions: write
25
- contents: write
26
- id-token: write
27
- steps:
28
-
29
- # clone the repo at a specific version
30
- - name: Checkout ${{ inputs.ref }}
31
- uses: actions/checkout@v2
32
- with:
33
- ref: ${{ inputs.ref }}
34
-
35
- # human error checks
36
- - name: Set up Python
37
- uses: actions/setup-python@v1
38
- with:
39
- python-version: "3.10"
40
-
41
- - name: Release Preflight Checks
42
- run: |
43
- python3 build-utils/preflight.py
44
- env:
45
- NAMI_SDK_VERSION: ${{ inputs.version }}
46
-
47
- - name: Setup .npmrc
48
- run: |
49
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
50
- env:
51
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52
-
53
- - name: Run Yarn
54
- run: |
55
- yarn --frozen-lockfile
56
- env:
57
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58
-
59
- - name: Publish
60
- run: |
61
- npm publish --access public
62
- env:
63
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
64
-
65
- - name: Create Github Release
66
- run: |-
67
- #sh gh-release-command.sh
68
- echo "Release me"
69
- env:
70
- GITHUB_TOKEN: ${{ github.token }}
@@ -1,24 +0,0 @@
1
- repos:
2
- - repo: https://github.com/pre-commit/mirrors-eslint
3
- rev: v8.8.0
4
- hooks:
5
- - id: eslint
6
- - repo: https://github.com/pre-commit/pre-commit-hooks
7
- rev: v2.3.0
8
- hooks:
9
- - id: check-added-large-files
10
- - id: check-merge-conflict
11
- - id: check-symlinks
12
- - id: check-yaml
13
- args: [--allow-multiple-documents]
14
- - id: end-of-file-fixer
15
- - id: trailing-whitespace
16
- exclude: ^.*\b(\.(js|jsx|tsx).snap)\b$
17
- - repo: https://github.com/nicklockwood/SwiftFormat
18
- rev: 0.50.8
19
- hooks:
20
- - id: swiftformat
21
- - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
22
- rev: v2.6.0
23
- hooks:
24
- - id: pretty-format-kotlin
package/.prettierrc.js DELETED
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- bracketSpacing: true,
3
- jsxBracketSameLine: true,
4
- singleQuote: true,
5
- trailingComma: 'all',
6
- arrowParens: 'avoid',
7
- };
@@ -1,3 +0,0 @@
1
- package com.nami.reactlibrary
2
-
3
- const val LOG_TAG = "NamiBridge"
@@ -1,141 +0,0 @@
1
- package com.nami.reactlibrary
2
-
3
- import android.content.Context
4
- import android.util.Log
5
- import com.facebook.react.bridge.Arguments
6
- import com.facebook.react.bridge.Callback
7
- import com.facebook.react.bridge.ReactApplicationContext
8
- import com.facebook.react.bridge.ReactContextBaseJavaModule
9
- import com.facebook.react.bridge.ReactMethod
10
- import com.facebook.react.bridge.ReadableArray
11
- import com.facebook.react.bridge.ReadableMap
12
- import com.namiml.Nami
13
- import com.namiml.NamiConfiguration
14
- import com.namiml.NamiLanguageCode
15
- import com.namiml.NamiLogLevel
16
- // import com.namiml.NamiApiResponseHandler
17
-
18
- class NamiBridgeModule(reactContext: ReactApplicationContext) :
19
- ReactContextBaseJavaModule(reactContext) {
20
-
21
- companion object {
22
- private const val CONFIG_MAP_PLATFORM_ID_KEY = "appPlatformID-android"
23
- private const val CONFIG_MAP_LOG_LEVEL_KEY = "logLevel"
24
- private const val CONFIG_MAP_DEVELOPMENT_MODE_KEY = "developmentMode"
25
- private const val CONFIG_MAP_BYPASS_STORE_KEY = "bypassStore"
26
- private const val CONFIG_MAP_NAMI_COMMANDS_KEY = "namiCommands"
27
- private const val CONFIG_MAP_LANGUAGE_CODE_KEY = "namiLanguageCode"
28
- private const val CONFIG_MAP_INITIAL_CONFIG_KEY = "initialConfig"
29
- private const val PLATFORM_ID_ERROR_VALUE = "APPPLATFORMID_NOT_FOUND"
30
- }
31
-
32
- override fun getName(): String {
33
- return "NamiBridge"
34
- }
35
-
36
- @ReactMethod
37
- fun configure(configDict: ReadableMap, completion: Callback) {
38
- // Need to be sure we have some valid string.
39
- val appPlatformID: String = if (configDict.hasKey(CONFIG_MAP_PLATFORM_ID_KEY)) {
40
- configDict.getString(CONFIG_MAP_PLATFORM_ID_KEY) ?: PLATFORM_ID_ERROR_VALUE
41
- } else {
42
- PLATFORM_ID_ERROR_VALUE
43
- }
44
-
45
- val appContext: Context = reactApplicationContext.applicationContext
46
- Log.d(LOG_TAG, "NAMI: RN Bridge - Configure called with appPlatformID $appPlatformID")
47
-
48
- val builder: NamiConfiguration.Builder =
49
- NamiConfiguration.Builder(appContext, appPlatformID)
50
-
51
- // React native will crash if you request a key from a map that does not exist, so always check key first
52
- val logLevelString = if (configDict.hasKey(CONFIG_MAP_LOG_LEVEL_KEY)) {
53
- configDict.getString(CONFIG_MAP_LOG_LEVEL_KEY)
54
- } else {
55
- ""
56
- }
57
- when (logLevelString) {
58
- "INFO" -> {
59
- builder.logLevel(NamiLogLevel.INFO)
60
- }
61
- "WARN" -> {
62
- builder.logLevel(NamiLogLevel.WARN)
63
- }
64
- "ERROR" -> {
65
- builder.logLevel(NamiLogLevel.ERROR)
66
- }
67
- else -> {
68
- // Any other parameters, just turn on full debugging so they can see everything.
69
- builder.logLevel(NamiLogLevel.DEBUG)
70
- }
71
- }
72
- Log.d(LOG_TAG, "NAMI: RN Bridge - configuration log level is $logLevelString")
73
-
74
- val developmentMode = if (configDict.hasKey(CONFIG_MAP_DEVELOPMENT_MODE_KEY)) {
75
- configDict.getBoolean(CONFIG_MAP_DEVELOPMENT_MODE_KEY)
76
- } else {
77
- false
78
- }
79
- if (developmentMode) {
80
- Log.d(LOG_TAG, "NAMI: RN Bridge - development mode is $developmentMode")
81
- builder.developmentMode = true
82
- }
83
-
84
- val languageCode = if (configDict.hasKey(CONFIG_MAP_LANGUAGE_CODE_KEY)) {
85
- configDict.getString(CONFIG_MAP_LANGUAGE_CODE_KEY)
86
- } else {
87
- null
88
- }
89
- languageCode?.let { code ->
90
- NamiLanguageCode.values().find { it.code == code }.let { namiLanguageCode ->
91
- if (namiLanguageCode == null) {
92
- Log.w(
93
- LOG_TAG,
94
- "Nami language code from config dictionary \"$code\" not " +
95
- "found in list of available Nami Language Codes:\n",
96
- )
97
- } else {
98
- builder.namiLanguageCode = namiLanguageCode
99
- }
100
- }
101
- }
102
-
103
- val namiCommandsReact: ReadableArray? =
104
- if (configDict.hasKey(CONFIG_MAP_NAMI_COMMANDS_KEY)) {
105
- configDict.getArray(CONFIG_MAP_NAMI_COMMANDS_KEY)
106
- } else {
107
- Arguments.createArray()
108
- }
109
- val settingsList = mutableListOf("extendedClientInfo:react-native:3.3.0-beta.7")
110
- namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
111
- settingsList.addAll(commandsFromReact)
112
- }
113
- Log.d(LOG_TAG, "Nami Configuration command settings are $settingsList")
114
- builder.settingsList = settingsList
115
-
116
- val initialConfig = if (configDict.hasKey(CONFIG_MAP_INITIAL_CONFIG_KEY)) {
117
- configDict.getString(CONFIG_MAP_INITIAL_CONFIG_KEY)
118
- } else {
119
- null
120
- }
121
- initialConfig?.let { initialConfigString ->
122
- Log.d(
123
- LOG_TAG,
124
- "Nami Configuration initialConfig found.",
125
- )
126
- builder.initialConfig = initialConfigString
127
- }
128
-
129
- val builtConfig: NamiConfiguration = builder.build()
130
- Log.d(LOG_TAG, "Nami Configuration object is $builtConfig")
131
-
132
- reactApplicationContext.runOnUiQueueThread {
133
- // Configure must be called on main thread
134
- Nami.configure(builtConfig) { result ->
135
- val resultMap = Arguments.createMap()
136
- resultMap.putBoolean("success", result)
137
- completion.invoke(resultMap)
138
- }
139
- }
140
- }
141
- }