Skip to content

Commit

Permalink
Merge branch 'release/3.3.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro committed Jun 23, 2020
2 parents 7ad422f + 77a4ba7 commit 264dc41
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
39 changes: 18 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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


1 change: 1 addition & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
@@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ android {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 26)
versionCode 1
versionName '3.3.0'
versionName '3.3.1'
}
}

Expand Down
10 changes: 7 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>} Returns when setup completes
*/
static setup(apiKey: string, appUserID?: string | null, observerMode?: boolean, userDefaultsSuiteName?: string): any;
Expand Down Expand Up @@ -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 {};
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>} Returns when setup completes
*/
Purchases.setup = function (apiKey, appUserID, observerMode, userDefaultsSuiteName) {
Expand Down Expand Up @@ -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);
};
/**
Expand Down
2 changes: 1 addition & 1 deletion ios/RNPurchases.m
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ - (NSString *)platformFlavor {
}

- (NSString *)platformFlavorVersion {
return @"3.3.0";
return @"3.3.1";
}

@end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 7 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>} Returns when setup completes
*/
public static setup(
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 264dc41

Please sign in to comment.