From d1d3bca063a464a419237836d8ee9fa34b2db464 Mon Sep 17 00:00:00 2001 From: Cesar de la Vega Date: Fri, 19 Jun 2020 15:23:39 -0700 Subject: [PATCH 1/3] renames Purchases.setProxyURLString to Purchases.setProxyURL (#148) --- index.d.ts | 10 +++++++--- index.js | 10 +++++++--- src/index.ts | 10 +++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/index.d.ts b/index.d.ts index aa81eef9..ee758390 100644 --- a/index.d.ts +++ b/index.d.ts @@ -538,8 +538,9 @@ export default class Purchases { * @param {String} apiKey RevenueCat API Key. Needs to be a String * @param {String?} appUserID An optional unique id for identifying the user. Needs to be a string. * @param {Boolean?} observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and want to use only RevenueCat's backend. Default is FALSE. - * @param {String?} userDefaultsSuiteName An optional string. iOS only. Set this to use a specific NSUserDefaults suite for RevenueCat. - * This might be handy if you are deleting all NSUserDefaults in your app and leaving RevenueCat in a bad state. + * @param {String?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android. + * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults. + * Default is null, which will make the SDK use standardUserDefaults. * @returns {Promise} Returns when setup completes */ static setup(apiKey: string, appUserID?: string | null, observerMode?: boolean, userDefaultsSuiteName?: string): any; @@ -784,6 +785,9 @@ export default class Purchases { * @param pushToken null will delete the subscriber attribute. */ static setPushToken(pushToken: string | null): void; - static setProxyURLString(url: string): void; + /** + * Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact. + */ + static setProxyURL(url: string): void; } export {}; diff --git a/index.js b/index.js index 5943a4f7..1c6dc2d6 100644 --- a/index.js +++ b/index.js @@ -129,8 +129,9 @@ var Purchases = /** @class */ (function () { * @param {String} apiKey RevenueCat API Key. Needs to be a String * @param {String?} appUserID An optional unique id for identifying the user. Needs to be a string. * @param {Boolean?} observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and want to use only RevenueCat's backend. Default is FALSE. - * @param {String?} userDefaultsSuiteName An optional string. iOS only. Set this to use a specific NSUserDefaults suite for RevenueCat. - * This might be handy if you are deleting all NSUserDefaults in your app and leaving RevenueCat in a bad state. + * @param {String?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android. + * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults. + * Default is null, which will make the SDK use standardUserDefaults. * @returns {Promise} Returns when setup completes */ Purchases.setup = function (apiKey, appUserID, observerMode, userDefaultsSuiteName) { @@ -506,7 +507,10 @@ var Purchases = /** @class */ (function () { Purchases.setPushToken = function (pushToken) { RNPurchases.setPushToken(pushToken); }; - Purchases.setProxyURLString = function (url) { + /** + * Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact. + */ + Purchases.setProxyURL = function (url) { RNPurchases.setProxyURLString(url); }; /** diff --git a/src/index.ts b/src/index.ts index 2201c443..c654aaf9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -605,8 +605,9 @@ export default class Purchases { * @param {String} apiKey RevenueCat API Key. Needs to be a String * @param {String?} appUserID An optional unique id for identifying the user. Needs to be a string. * @param {Boolean?} observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and want to use only RevenueCat's backend. Default is FALSE. - * @param {String?} userDefaultsSuiteName An optional string. iOS only. Set this to use a specific NSUserDefaults suite for RevenueCat. - * This might be handy if you are deleting all NSUserDefaults in your app and leaving RevenueCat in a bad state. + * @param {String?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android. + * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults. + * Default is null, which will make the SDK use standardUserDefaults. * @returns {Promise} Returns when setup completes */ public static setup( @@ -1093,7 +1094,10 @@ export default class Purchases { RNPurchases.setPushToken(pushToken); } - public static setProxyURLString(url: string) { + /** + * Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact. + */ + public static setProxyURL(url: string) { RNPurchases.setProxyURLString(url); } From ef2b786dec9421c84045f5d038cc84f85434fbbe Mon Sep 17 00:00:00 2001 From: aboedo Date: Mon, 22 Jun 2020 19:53:22 -0300 Subject: [PATCH 2/3] update framework docs to include common framework (#150) * updated iOS docs: moved the Cocoapods section to the top, and added mentions of PurchasesHybridCommon.framework * updated giphys --- README.md | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 4974042e..2dd3079d 100644 --- a/README.md +++ b/README.md @@ -41,23 +41,32 @@ or `$ react-native link react-native-purchases` -#### Additional iOS Setup (for manual installation) -Purchases.framework also needs to be added to your iOS project. The npm install will download the correct framework version. +### Additional iOS Setup -Alternatively you can install the framework via [CocoaPods](https://cocoapods.org/pods/Purchases). For instructions go [here](#installing-with-cocoapods--expokit). +#### If your project uses Cocoapods +If your project already uses Cocoapods to install iOS dependencies, common in ExpoKit projects, linking the library should have added it to the podfile. If it hasn't, add the following to your project's podfile to reference the library from your node_modules folder: -##### Create a Framework Reference in your project +```ruby +pod 'RNPurchases', :path => '../node_modules/react-native-purchases' + :inhibit_warnings => true +``` + +In your `ios` folder, run `pod install`. If you've just upgraded ExpoKit, you might need to upgrade cocoapods to the newest version: `sudo gem install cocoapods`. -1. Drag `Purchases.framework` from the `RNPurchases`sub-project under the libraries section to the outer project and create a reference. +#### Manual installation (if your project doesn't use CocoapodsCreate) -![](https://media.giphy.com/media/83fBXlBYPF8oxMQvhN/giphy.gif) +##### Make a Framework Reference in your project -##### Add iOS Framework to Embedded Binaries +1. Drag `Purchases.framework` and `PurchasesHybridCommon.framework` from the `RNPurchases`sub-project under the libraries section to the outer project and create a reference. + +![](https://media.giphy.com/media/W6LvZkQnvc3QnnPza7/giphy.gif) + +##### Add iOS Frameworks to Embedded Binaries 1. In Xcode, in project manager, select your app target. 1. Select the general tab -1. Drag `Purchases.framework` from your project to the Embedded Binaries section +1. Drag `Purchases.framework` and `PurchasesHybridCommon.framework` from your project to the Embedded Binaries section -![](https://media.giphy.com/media/dCCyG7rmjIyByLS9ju/giphy.gif) +![](https://media.giphy.com/media/iIdIuEkAzlntxANSiV/giphy.gif) Add `$(PROJECT_DIR)/../node_modules/react-native-purchases/ios` to Framework Search paths in build settings @@ -77,18 +86,6 @@ The `react-native link` command should have added the `libRNPurchases.a` library ![](https://media.giphy.com/media/U2MMgrdYlkRhEcy80J/giphy.gif) -### Installing with Cocoapods / ExpoKit -If your project already uses Cocoapods to install iOS dependencies, common in ExpoKit projects, linking the library should have added it to the podfile. If it hasn't, add the following to your project's podfile to reference the library from your `node_modules` folder: - -``` - pod 'RNPurchases', :path => '../node_modules/react-native-purchases' - :inhibit_warnings => true -``` - -In your `ios` folder, run `pod install`. If you've just upgraded ExpoKit, you might need to upgrade cocoapods to the newest version: `sudo gem install cocoapods`. - ## Getting Started Please follow the [Quickstart Guide](https://docs.revenuecat.com/docs/) for more information on how to use the SDK - - From 77a4ba7d7209ec3abb4cd63704ea047a209bad2f Mon Sep 17 00:00:00 2001 From: Cesar de la Vega Date: Mon, 22 Jun 2020 16:03:27 -0700 Subject: [PATCH 3/3] prepares release (#149) --- CHANGELOG.md | 4 ++++ VERSIONS.md | 1 + android/build.gradle | 2 +- ios/RNPurchases.m | 2 +- package.json | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a670b63b..8c4bab07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.3.1 + +- Renames setProxyURLString with setProxyURL + ## 3.3.0 - Bumped iOS to 3.4.0 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases) diff --git a/VERSIONS.md b/VERSIONS.md index c3f44c09..e92e2688 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -1,5 +1,6 @@ | Version | iOS version | Android version | Common files version | |---------|-------------|-----------------|----------------------| +| 3.3.1 | 3.4.0 | 3.2.0 | 1.2.0 | | 3.3.0 | 3.4.0 | 3.2.0 | 1.2.0 | | 3.2.0 | 3.2.1 | 3.1.0 | 1.0.10 | | 3.1.0 | 3.2.1 | 3.1.0 | 1.0.9 | diff --git a/android/build.gradle b/android/build.gradle index a1d5adbe..e9ddeabe 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,7 +26,7 @@ android { minSdkVersion safeExtGet('minSdkVersion', 16) targetSdkVersion safeExtGet('targetSdkVersion', 26) versionCode 1 - versionName '3.3.0' + versionName '3.3.1' } } diff --git a/ios/RNPurchases.m b/ios/RNPurchases.m index d554f786..5a5027a2 100644 --- a/ios/RNPurchases.m +++ b/ios/RNPurchases.m @@ -277,7 +277,7 @@ - (NSString *)platformFlavor { } - (NSString *)platformFlavorVersion { - return @"3.3.0"; + return @"3.3.1"; } @end diff --git a/package.json b/package.json index 15c9a631..13d3b3bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-purchases", "title": "React Native Purchases", - "version": "3.3.0", + "version": "3.3.1", "description": "React Native in-app purchases and subscriptions made easy.", "main": "index.js", "types": "index.d.ts",