react-native-nami-sdk 3.3.0-beta.22 → 3.3.0-beta.7
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 +3 -0
- package/.eslintrc.js +52 -0
- package/.github/workflows/CI.yaml +341 -0
- package/.github/workflows/app_prod.yaml +387 -0
- package/.github/workflows/app_stg.yaml +398 -0
- package/.github/workflows/build.yml +70 -0
- package/.pre-commit-config.yaml +24 -0
- package/.prettierrc.js +7 -0
- package/README.md +9 -9
- package/android/README.md +2 -3
- package/android/build.gradle +19 -27
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +0 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/nami/reactlibrary/Constants.kt +3 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +141 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgePackage.java +51 -0
- package/android/src/main/java/com/{namiml/reactnative → nami/reactlibrary}/NamiCampaignManagerBridge.kt +33 -25
- package/android/src/main/java/com/{namiml/reactnative → nami/reactlibrary}/NamiCustomerManagerBridge.kt +6 -14
- package/android/src/main/java/com/{namiml/reactnative/NamiEntitlementManagerBridge.kt → nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt} +8 -18
- package/android/src/main/java/com/nami/reactlibrary/NamiFlowManagerBridge.kt +58 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiMLManagerBridgeModule.kt +58 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiManagerBridge.kt +26 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +258 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiPurchaseManagerBridge.kt +108 -0
- package/android/src/main/java/com/{namiml/reactnative → nami/reactlibrary}/NamiUtil.kt +23 -26
- package/build-utils/get_version_code.py +140 -0
- package/build-utils/preflight.py +46 -0
- package/{dist/index.d.ts → index.d.ts} +2 -0
- package/index.ts +2 -0
- package/ios/Nami.m +88 -8
- package/ios/NamiCampaignManagerBridge.m +3 -3
- package/ios/NamiCampaignManagerBridge.swift +61 -49
- package/ios/NamiCustomerManager.m +2 -2
- package/ios/NamiCustomerManager.swift +3 -13
- package/ios/NamiEntitlementManagerBridge.m +3 -2
- package/ios/NamiEntitlementManagerBridge.swift +39 -48
- package/ios/NamiFlowManagerBridge.m +2 -2
- package/ios/NamiFlowManagerBridge.swift +6 -10
- package/ios/NamiMLManagerBridge.m +93 -0
- package/ios/NamiManager.m +18 -0
- package/ios/NamiManager.swift +30 -0
- package/ios/NamiPaywallManagerBridge.m +3 -3
- package/ios/NamiPaywallManagerBridge.swift +6 -16
- package/ios/NamiPurchaseManagerBridge.m +2 -3
- package/ios/NamiPurchaseManagerBridge.swift +10 -15
- package/ios/RNNami-Bridging-Header.h +3 -1
- package/ios/RNNami.h +10 -0
- package/ios/RNNami.m +13 -0
- package/package.json +8 -20
- package/react-native-nami-sdk.podspec +2 -10
- package/src/Nami.d.ts +8 -0
- package/src/Nami.ts +18 -28
- package/src/NamiCampaignManager.d.ts +18 -0
- package/src/NamiCampaignManager.ts +53 -57
- package/{dist/src → src}/NamiCustomerManager.d.ts +13 -11
- package/src/NamiCustomerManager.ts +81 -55
- package/src/NamiEntitlementManager.d.ts +15 -0
- package/src/NamiEntitlementManager.ts +36 -49
- package/src/NamiFlowManager.d.ts +32 -0
- package/src/NamiFlowManager.ts +45 -35
- package/src/NamiMLManager.d.ts +7 -0
- package/src/NamiMLManager.ts +13 -0
- package/src/NamiManager.d.ts +5 -0
- package/src/NamiManager.ts +14 -0
- package/src/NamiPaywallManager.d.ts +34 -0
- package/src/NamiPaywallManager.ts +139 -84
- package/src/NamiPurchaseManager.d.ts +20 -0
- package/src/NamiPurchaseManager.ts +70 -69
- package/{dist/src → src}/types.d.ts +6 -35
- package/src/types.ts +7 -39
- package/tsconfig.json +22 -24
- package/.prettierrc +0 -4
- package/android/src/main/java/com/namiml/reactnative/Constants.kt +0 -3
- package/android/src/main/java/com/namiml/reactnative/NamiBridgeModule.kt +0 -91
- package/android/src/main/java/com/namiml/reactnative/NamiBridgePackage.java +0 -140
- package/android/src/main/java/com/namiml/reactnative/NamiFlowManagerBridge.kt +0 -67
- package/android/src/main/java/com/namiml/reactnative/NamiPaywallManagerBridgeModule.kt +0 -196
- package/android/src/main/java/com/namiml/reactnative/NamiPurchaseManagerBridge.kt +0 -114
- package/dist/specs/NativeNami.d.ts +0 -15
- package/dist/specs/NativeNamiCampaignManager.d.ts +0 -82
- package/dist/specs/NativeNamiCustomerManager.d.ts +0 -29
- package/dist/specs/NativeNamiEntitlementManager.d.ts +0 -45
- package/dist/specs/NativeNamiFlowManager.d.ts +0 -8
- package/dist/specs/NativeNamiPaywallManager.d.ts +0 -71
- package/dist/specs/NativeNamiPurchaseManager.d.ts +0 -28
- package/dist/src/Nami.d.ts +0 -5
- package/dist/src/NamiCampaignManager.d.ts +0 -29
- package/dist/src/NamiEntitlementManager.d.ts +0 -13
- package/dist/src/NamiFlowManager.d.ts +0 -11
- package/dist/src/NamiPaywallManager.d.ts +0 -30
- package/dist/src/NamiPurchaseManager.d.ts +0 -17
- package/dist/src/transformers.d.ts +0 -3
- package/dist/src/version.d.ts +0 -5
- package/ios/Nami.swift +0 -85
- package/react-native-config.js +0 -9
- package/scripts/generate-version.ts +0 -18
- package/specs/NativeNami.ts +0 -16
- package/specs/NativeNamiCampaignManager.ts +0 -94
- package/specs/NativeNamiCustomerManager.ts +0 -37
- package/specs/NativeNamiEntitlementManager.ts +0 -54
- package/specs/NativeNamiFlowManager.ts +0 -12
- package/specs/NativeNamiPaywallManager.ts +0 -85
- package/specs/NativeNamiPurchaseManager.ts +0 -33
- package/src/transformers.ts +0 -21
- package/src/version.ts +0 -5
|
@@ -0,0 +1,398 @@
|
|
|
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 }}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 }}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
ADDED
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# React Native Bridge for the Nami SDK
|
|
4
4
|
|
|
5
|
-
Nami ML gives you everything you need to power your paywall, streamline subscription management, and drive revenue growth through instantly deployable paywalls, precise targeting and segmentation, and enterprise-grade security and
|
|
5
|
+
Nami ML gives you everything you need to power your paywall, streamline subscription management, and drive revenue growth through instantly deployable paywalls, precise targeting and segmentation, and enterprise-grade security and scaleability.
|
|
6
6
|
|
|
7
7
|
Go beyond basic IAP and focus on results with:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
* Library of smart paywall templates to choose from, implemented natively
|
|
10
|
+
* No-code paywall creator so you can launch a new paywall design instantly, without submitting an app update
|
|
11
|
+
* Experimentation engine to run paywall A/B tests so you can improve your conversion rates
|
|
12
|
+
* Built-in IAP & subscription management and analytics, so you don't need another solution
|
|
13
13
|
|
|
14
14
|
Nami is simple adopt while giving you the tools you need to improve revenue. Our free tier is generous, and gives you everything you need to get started. [Sign up for a free account](https://app.namiml.com/join/)
|
|
15
15
|
|
|
@@ -20,18 +20,18 @@ Get started by heading over to our [quick start guide](https://learn.namiml.com/
|
|
|
20
20
|
### Build the Bridge Locally
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
|
|
23
|
+
yarn pack
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
This will generate a file `react-native-nami-sdk-vx.x.x.tgz` with the current version number of the bridge.
|
|
26
|
+
This will generate a file `react-native-nami-sdk-vx.x.x.tgz` with the current version number of the bridge. You can add this to a project by
|
|
27
27
|
|
|
28
28
|
```
|
|
29
|
-
|
|
29
|
+
yarn add file:react-native-nami-sdk-vx.x.x.tgz
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
### Installing from NPM
|
|
33
33
|
|
|
34
|
-
The bridge is also available as a package on NPM.
|
|
34
|
+
The bridge is also available as a package on NPM. You can install it via yarn or npm
|
|
35
35
|
|
|
36
36
|
```
|
|
37
37
|
npm install react-native-nami-sdk --save
|
package/android/README.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
README
|
|
2
|
+
======
|
|
2
3
|
|
|
3
4
|
If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
|
|
4
5
|
|
|
5
6
|
1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
|
|
6
7
|
2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
|
|
7
|
-
|
|
8
8
|
```
|
|
9
9
|
ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
|
|
10
10
|
sdk.dir=/Users/{username}/Library/Android/sdk
|
|
11
11
|
```
|
|
12
|
-
|
|
13
12
|
3. Delete the `maven` folder
|
|
14
13
|
4. Run `./gradlew installArchives`
|
|
15
14
|
5. Verify that latest set of generated files is in the maven folder with the correct version number
|
package/android/build.gradle
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
// android/build.gradle
|
|
2
|
+
// based on:
|
|
3
|
+
//
|
|
4
|
+
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
|
|
5
|
+
// original location:
|
|
6
|
+
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
|
|
7
|
+
//
|
|
8
|
+
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
|
|
9
|
+
// original location:
|
|
10
|
+
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
|
|
11
|
+
def DEFAULT_BUILD_TOOLS_VERSION = '34.0.0'
|
|
2
12
|
def safeExtGet(prop, fallback) {
|
|
3
13
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
4
14
|
}
|
|
5
|
-
|
|
6
|
-
def isNewArchitectureEnabled() {
|
|
7
|
-
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (isNewArchitectureEnabled()) {
|
|
11
|
-
apply plugin: 'com.facebook.react'
|
|
12
|
-
}
|
|
13
|
-
|
|
14
15
|
apply plugin: 'com.android.library'
|
|
15
16
|
// apply plugin: 'maven'
|
|
16
17
|
apply plugin: "kotlin-android"
|
|
17
18
|
buildscript {
|
|
18
|
-
ext.kotlin_version = '1.
|
|
19
|
+
ext.kotlin_version = '1.8.20'
|
|
19
20
|
// The Android Gradle plugin is only required when opening the android folder stand-alone.
|
|
20
21
|
// This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
21
22
|
// module dependency in an application project.
|
|
@@ -26,20 +27,19 @@ buildscript {
|
|
|
26
27
|
google()
|
|
27
28
|
}
|
|
28
29
|
dependencies {
|
|
29
|
-
classpath 'com.android.tools.build:gradle:
|
|
30
|
+
classpath 'com.android.tools.build:gradle:7.4.2'
|
|
30
31
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
android {
|
|
35
|
-
compileSdkVersion
|
|
36
|
+
compileSdkVersion 34
|
|
36
37
|
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
37
38
|
defaultConfig {
|
|
38
|
-
minSdkVersion
|
|
39
|
-
targetSdkVersion
|
|
39
|
+
minSdkVersion 22
|
|
40
|
+
targetSdkVersion 34
|
|
40
41
|
versionCode 1
|
|
41
42
|
versionName "1.0"
|
|
42
|
-
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
|
|
43
43
|
}
|
|
44
44
|
compileOptions {
|
|
45
45
|
coreLibraryDesugaringEnabled true
|
|
@@ -85,20 +85,12 @@ dependencies {
|
|
|
85
85
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
86
86
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
87
87
|
|
|
88
|
-
playImplementation "com.namiml:sdk-android:3.3.0-beta.
|
|
89
|
-
amazonImplementation "com.namiml:sdk-amazon:3.3.0-beta.
|
|
88
|
+
playImplementation "com.namiml:sdk-android:3.3.0-beta.07"
|
|
89
|
+
amazonImplementation "com.namiml:sdk-amazon:3.3.0-beta.07"
|
|
90
90
|
|
|
91
91
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
92
|
-
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:
|
|
93
|
-
|
|
94
|
-
}
|
|
92
|
+
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
|
95
93
|
|
|
96
|
-
if (isNewArchitectureEnabled()) {
|
|
97
|
-
react {
|
|
98
|
-
jsRootDir = file("../src/")
|
|
99
|
-
libraryName = "Nami"
|
|
100
|
-
codegenJavaPackageName = "com.namiml.reactnative"
|
|
101
|
-
}
|
|
102
94
|
}
|
|
103
95
|
|
|
104
96
|
configurations {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#Wed May 26 17:12:26 EDT 2021
|
|
2
2
|
distributionBase=GRADLE_USER_HOME
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
|
4
4
|
distributionPath=wrapper/dists
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
6
6
|
zipStoreBase=GRADLE_USER_HOME
|
package/android/gradlew
CHANGED
|
File without changes
|