react-native-nami-sdk 2.0.0 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build.yml +70 -0
- package/README.md +13 -2
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +1 -1
- package/build-utils/preflight.py +45 -0
- package/ios/Nami.m +1 -1
- package/ios/Podfile +1 -1
- package/package.json +10 -7
- package/react-native-nami-sdk.podspec +2 -2
|
@@ -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: "develop"
|
|
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 }}
|
package/README.md
CHANGED
|
@@ -2,9 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
# React Native Bridge for the Nami SDK
|
|
4
4
|
|
|
5
|
-
Nami is
|
|
5
|
+
Nami is easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This library helps you easily offer in-app purchases and subscriptions using Apple App Store StoreKit & Google Play Billing APIs.
|
|
8
|
+
- No IAP code to write.
|
|
9
|
+
- Focus on your app experience.
|
|
10
|
+
- All edge cases are handled and no server is required.
|
|
11
|
+
- Includes is powerful built-in paywalls templates, built with native SwiftUI and Jetpack Compose
|
|
12
|
+
- Update paywalls easily using a browser-based paywall CMS.
|
|
13
|
+
- Conduct paywall A/B tests, to improve your conversion rate.
|
|
14
|
+
- Robust subscription analytics, webhooks, and much more.
|
|
15
|
+
|
|
16
|
+
Requires an account with Nami. The free tier is generous and includes everything you need to get up and running.
|
|
17
|
+
|
|
18
|
+
See https://www.namiml.com for more details and to create a free account.
|
|
8
19
|
|
|
9
20
|
## Getting started with React Native and Nami
|
|
10
21
|
|
package/android/build.gradle
CHANGED
|
@@ -74,7 +74,7 @@ dependencies {
|
|
|
74
74
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
75
75
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
76
76
|
|
|
77
|
-
implementation "com.namiml:sdk-android:2.0.
|
|
77
|
+
implementation "com.namiml:sdk-android:2.0.1"
|
|
78
78
|
|
|
79
79
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
80
80
|
}
|
|
@@ -127,7 +127,7 @@ class NamiBridgeModule(reactContext: ReactApplicationContext) :
|
|
|
127
127
|
} else {
|
|
128
128
|
Arguments.createArray()
|
|
129
129
|
}
|
|
130
|
-
val settingsList = mutableListOf("extendedClientInfo:react-native:
|
|
130
|
+
val settingsList = mutableListOf("extendedClientInfo:react-native:2.0.2")
|
|
131
131
|
namiCommandsReact?.toArrayList()?.filterIsInstance<String>()?.let { commandsFromReact ->
|
|
132
132
|
settingsList.addAll(commandsFromReact)
|
|
133
133
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import json
|
|
3
|
+
import sys
|
|
4
|
+
import re
|
|
5
|
+
import subprocess
|
|
6
|
+
|
|
7
|
+
# Regex to validate version numbers
|
|
8
|
+
PROD_VERSION_RE = re.compile(r"^\d+\.\d+\.\d+$")
|
|
9
|
+
PRERELEASE_VERSION_RE = re.compile(r"^\d+\.\d+\.\d+-(alpha|beta|rc)\.\d{2}$")
|
|
10
|
+
|
|
11
|
+
early_access = str(os.getenv("EARLY_ACCESS"))
|
|
12
|
+
|
|
13
|
+
# get the version out of source of truth
|
|
14
|
+
with open("package.json", "r") as f:
|
|
15
|
+
package = json.load(f)
|
|
16
|
+
nami_sdk_version = package["version"]
|
|
17
|
+
|
|
18
|
+
# Get git version
|
|
19
|
+
git_long_hash = (
|
|
20
|
+
subprocess.check_output(["git", "log", "-1", "--format=%H"]).decode("utf-8").strip()
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Check what kind of release this is and guard against non-conforming version numbers
|
|
24
|
+
if PROD_VERSION_RE.match(nami_sdk_version):
|
|
25
|
+
if early_access == "true":
|
|
26
|
+
print(f"Early access value ('{early_access}') is not compatible with production version format '{nami_sdk_version}'")
|
|
27
|
+
sys.exit(1)
|
|
28
|
+
type_mods = ""
|
|
29
|
+
elif PRERELEASE_VERSION_RE.match(nami_sdk_version):
|
|
30
|
+
if early_access == "false":
|
|
31
|
+
print(f"Early access value ('{early_access}') is not compatible with early access version format '{nami_sdk_version}'")
|
|
32
|
+
sys.exit(1)
|
|
33
|
+
type_mods = "--prerelease"
|
|
34
|
+
else:
|
|
35
|
+
print(f"SDK version '{nami_sdk_version}' does not conform to version spec")
|
|
36
|
+
sys.exit(1)
|
|
37
|
+
|
|
38
|
+
# generate a shell command to create a release later
|
|
39
|
+
with open("gh-release-command.sh", "w") as f:
|
|
40
|
+
f.write(
|
|
41
|
+
f"gh release create --generate-notes --title v{nami_sdk_version} {type_mods} --target {git_long_hash} v{nami_sdk_version}"
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# report our status
|
|
45
|
+
print(f"Identified Version: {nami_sdk_version}")
|
package/ios/Nami.m
CHANGED
|
@@ -83,7 +83,7 @@ RCT_EXPORT_METHOD(configure: (NSDictionary *)configDict) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// Start commands with header iformation for Nami to let them know this is a React client.
|
|
86
|
-
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:2.0.
|
|
86
|
+
NSMutableArray *namiCommandStrings = [NSMutableArray arrayWithArray:@[@"extendedClientInfo:react-native:2.0.2"]];
|
|
87
87
|
|
|
88
88
|
// Add additional namiCommands app may have sent in.
|
|
89
89
|
NSObject *appCommandStrings = configDict[@"namiCommands"];
|
package/ios/Podfile
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nami-sdk",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "React Native Module for Nami -
|
|
3
|
+
"version": "2.0.3",
|
|
4
|
+
"description": "React Native Module for Nami - Easy subscriptions & in-app purchases, with powerful built-in paywalls and A/B testing.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -20,12 +20,15 @@
|
|
|
20
20
|
"paywall",
|
|
21
21
|
"react-native",
|
|
22
22
|
"storekit",
|
|
23
|
-
"subscriptions"
|
|
23
|
+
"subscriptions",
|
|
24
|
+
"iap",
|
|
25
|
+
"play-billing",
|
|
26
|
+
"payments"
|
|
24
27
|
],
|
|
25
28
|
"author": {
|
|
26
|
-
"username": "
|
|
27
|
-
"name": "Nami ML
|
|
28
|
-
"email": "
|
|
29
|
+
"username": "hellonami",
|
|
30
|
+
"name": "Nami ML Inc.",
|
|
31
|
+
"email": "hello@namiml.com"
|
|
29
32
|
},
|
|
30
33
|
"contributors": [
|
|
31
34
|
{
|
|
@@ -51,7 +54,7 @@
|
|
|
51
54
|
"type": "git",
|
|
52
55
|
"url": "git+https://github.com/namiml/react-native-nami-sdk.git"
|
|
53
56
|
},
|
|
54
|
-
"homepage": "https://www.
|
|
57
|
+
"homepage": "https://www.namiml.com",
|
|
55
58
|
"bugs": {
|
|
56
59
|
"url": "https://github.com/namiml/react-native-nami-sdk/issues"
|
|
57
60
|
}
|
|
@@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|
|
8
8
|
s.version = package['version']
|
|
9
9
|
s.summary = package['description']
|
|
10
10
|
|
|
11
|
-
s.author = { "Nami ML
|
|
11
|
+
s.author = { "Nami ML Inc." => "info@namiml.com" }
|
|
12
12
|
|
|
13
13
|
s.homepage = package['homepage']
|
|
14
14
|
s.license = package['license']
|
|
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
|
|
|
18
18
|
s.source_files = "ios/**/*.{h,m}"
|
|
19
19
|
s.requires_arc = true
|
|
20
20
|
|
|
21
|
-
s.dependency 'Nami', '2.9.
|
|
21
|
+
s.dependency 'Nami', '2.9.5'
|
|
22
22
|
s.dependency 'React'
|
|
23
23
|
|
|
24
24
|
end
|