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/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 - - 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/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/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", 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); }