Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Example - PurchaseTester TypeScript #320

Merged
merged 37 commits into from
Jan 13, 2022
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b5165d3
Initial commit of purchaseTester typescript example
Dec 15, 2021
7d74043
Made things a little prettier for offering detail
joshdholtz Dec 28, 2021
64df393
Removed console log
joshdholtz Dec 28, 2021
bfbf128
Typescript example using local RNPurchases pod
joshdholtz Dec 28, 2021
e29289a
Fix some things were states weren't updating
joshdholtz Dec 28, 2021
2d8685e
Trying to fix CircleCI
joshdholtz Dec 28, 2021
c3a1f54
This is it
joshdholtz Dec 28, 2021
cc86f42
name isn't a thing for the RN builds
joshdholtz Dec 28, 2021
e88abde
name also isn't a thing for iOS RN builds
joshdholtz Dec 28, 2021
b69a88a
Add set attributes which isnt really working yet
joshdholtz Dec 29, 2021
4e052af
Fix broken test
joshdholtz Dec 29, 2021
2239b1d
Fix broken test... again
joshdholtz Dec 29, 2021
42ef1b7
Ignore package-lock.json, try using rn/yarn_install on circleci, move…
joshdholtz Jan 3, 2022
1cd69fc
Trying to get yarn_install to run in the example directory
joshdholtz Jan 3, 2022
60735a0
Change yarn cache folder
joshdholtz Jan 3, 2022
f238ce8
Try bringing in the yarn install from the orb for testing
joshdholtz Jan 3, 2022
9f7b4d9
Try yarn cwd before calling rn/yarn_install
joshdholtz Jan 3, 2022
84226f7
That didn't work
joshdholtz Jan 3, 2022
f2505ba
This should fix android
joshdholtz Jan 3, 2022
13c11ad
This should fix macos symlink issue
joshdholtz Jan 3, 2022
2ac8df6
Reset cache to see if fix worked
joshdholtz Jan 3, 2022
ccd9151
Lets start over on circleci
joshdholtz Jan 3, 2022
23919bb
Add path for yarn pod
joshdholtz Jan 3, 2022
0549cf0
Experimenting
joshdholtz Jan 3, 2022
6264551
This should do it
joshdholtz Jan 3, 2022
92a68bf
--cwd doesnt work with yarn pods
joshdholtz Jan 3, 2022
e656e8d
Need to warn install both examples
joshdholtz Jan 3, 2022
4ad51cc
Try with rn/yarn_install but copied over with path param
joshdholtz Jan 3, 2022
03b5b48
Forgot to replace cache path
joshdholtz Jan 3, 2022
55e8ee2
Cleanup because things works :)
joshdholtz Jan 3, 2022
fb32dab
Need to put path to ios directory
joshdholtz Jan 3, 2022
d45adc2
Use conditional logic and use --cwd if not empty string
joshdholtz Jan 3, 2022
f9b5e97
Rename to use standard revenuecat tester package and bundle id
joshdholtz Jan 3, 2022
74810a5
Bump to react-native-community/[email protected]
joshdholtz Jan 4, 2022
422a4f2
Rename isSetup to hasKeys
joshdholtz Jan 5, 2022
8843578
Setup local testing for PurchaseTester Typescript (#326)
joshdholtz Jan 11, 2022
01e36e9
Rename storekit config file and add second target that does not use s…
joshdholtz Jan 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
This is it
joshdholtz committed Dec 28, 2021
commit c3a1f54d63a285c2b1b69763d415ecfb2765a65f
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -74,7 +74,11 @@ jobs:
- checkout
- yarn_install_example
- rn/android_build:
name: Build Android APK (examples/purchaseTester)
project_path: examples/purchaseTester/android
- rn/android_build:
name: Build Android APK (examples/purchaseTesterTypescript)
project_path: examples/purchaseTesterTypescript/android
ios:
executor:
name: rn/macos
@@ -86,12 +90,21 @@ jobs:
- yarn_install_example
- install_pods
- rn/ios_build:
name: Build iOS App (examples/purchaseTester)
build_configuration: Release
device: iPhone 11 Pro
derived_data_path: ~/DerivedData
project_type: workspace
project_path: examples/purchaseTester/ios/ReactNativeSample.xcworkspace
scheme: ReactNativeSample
- rn/ios_build:
name: Build iOS App (examples/purchaseTesterTypescript)
build_configuration: Release
device: iPhone 11 Pro
derived_data_path: ~/DerivedData
project_type: workspace
project_path: examples/purchaseTesterTypescript/ios/PurchaseTester.xcworkspace
scheme: ReactNativeSample

workflows:
test:
8 changes: 4 additions & 4 deletions examples/purchaseTester/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -323,7 +323,7 @@ PODS:
- React-perflogger (= 0.64.3)
- RNGestureHandler (1.10.3):
- React-Core
- RNPurchases (4.4.1):
- RNPurchases (4.5.0):
- PurchasesHybridCommon (= 1.11.1)
- React-Core
- RNScreens (2.18.1):
@@ -473,7 +473,7 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: c71c5917ec0ad2de41d5d06a5855f6d5eda06971
FBReactNativeSpec: a2b6216a2bf6c8d5ea8963a88fa38290bbbdc414
FBReactNativeSpec: 6a7ee9cb0839006f75cc5c23f6d5283dc6080c4d
Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c
@@ -511,11 +511,11 @@ SPEC CHECKSUMS:
React-runtimeexecutor: 493d9abb8b23c3f84e19ae221eeba92cadcb70dc
ReactCommon: 8fea6422328e2fc093e25c9fac67adbcf0f04fb4
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNPurchases: ac0462ae7af5921b5f3e6578a542b24f207efcb4
RNPurchases: aa1b4dff749eb760c6de50f1d987aa45455e58a8
RNScreens: f7ad633b2e0190b77b6a7aab7f914fad6f198d8d
Yoga: e6ecf3fa25af9d4c87e94ad7d5d292eedef49749
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: ef0169631a326f7a668fc6ea8da5bdfe60d83f4c

COCOAPODS: 1.10.1
COCOAPODS: 1.11.2
Original file line number Diff line number Diff line change
@@ -202,7 +202,7 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSample/Pods-ReactNativeSample-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
@@ -384,7 +384,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -438,7 +438,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Original file line number Diff line number Diff line change
@@ -34,13 +34,6 @@ const CustomerInfoHeader: React.FC<Props> = ({appUserID, customerInfo, isAnonymo
toggleModalVisibility()
}

const onModalClose = async () => {
if (inputValue && inputValue.length > 0) {
await Purchases.logIn(inputValue);
await refreshData();
}
}

const logout = async () => {
try {
await Purchases.logOut();
@@ -50,7 +43,12 @@ const CustomerInfoHeader: React.FC<Props> = ({appUserID, customerInfo, isAnonymo
}
}

const toggleModalVisibility = () => {
const toggleModalVisibility = async () => {
if (isModalVisible && inputValue && inputValue.length > 0) {
await Purchases.logIn(inputValue);
await refreshData();
}

setModalVisible(!isModalVisible);
};

@@ -77,8 +75,7 @@ const CustomerInfoHeader: React.FC<Props> = ({appUserID, customerInfo, isAnonymo

<Modal animationType="slide"
transparent visible={isModalVisible}
presentationStyle="overFullScreen"
onDismiss={onModalClose}>
presentationStyle="overFullScreen">
<View style={styles.viewWrapper}>
<View style={styles.modalView}>
<Text>Enter identifier for login</Text>