Skip to content

Releases: RevenueCat/react-native-purchases

4.5.3

21 Mar 19:16
7a27e9f
Compare
Choose a tag to compare
  • Fix warnings regarding new NativeEventEmitter() being called without the required addListener and removeListeners methods, which fixes this issue

4.5.2

09 Feb 14:57
6df3927
Compare
Choose a tag to compare

4.5.1

03 Jan 12:50
7e0f8f7
Compare
Choose a tag to compare
  • Fix Expo 44 compatibility by fixing RCTEventEmitter import PR Issue

4.5.0

08 Dec 16:14
38e3337
Compare
Choose a tag to compare

This release has some changes that should help prevent "There is no singleton instance" errors issue, PR.

  • Added isConfigured function to be able to check if the instance of Purchases has been configured before calling any function that accesses the singleton instance.
  • These functions that were returning void, now return Promise<void>:
Integrations Subscriber attributes Configuration and other
addAttributionData collectDeviceIdentifiers invalidatePurchaserInfoCache
setAd setAttributes presentCodeRedemptionSheet
setAdGroup setDisplayName setAllowSharingStoreAccount
setAdjustID setEmail setAutomaticAppleSearchAdsAttributionCollection
setAirshipChannelID setPhoneNumber setDebugLogsEnabled
setAppsflyerID setPushToken setFinishTransactions
setCampaign setSimulatesAskToBuyInSandbox
setCreative syncPurchases
setFBAnonymousID
setKeyword
setMediaSource
setMparticleID
setOnesignalID
  • Accessing a function that accesses the singleton instance before it has been setup will now reject with a UninitializedPurchasesError.

  • Bumppurchases-hybrid-common to 1.11.1 Changelog here

  • Bump purchases-ios to 3.13.1 (Changelog here)

  • Bump purchases-android to 4.6.0 (Changelog here)

4.4.1

12 Nov 13:49
9241069
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 4.4.0...4.4.1

4.4.0

11 Nov 17:30
be90be3
Compare
Choose a tag to compare

4.4.0

4.3.3

29 Oct 00:55
3b57e02
Compare
Choose a tag to compare

4.3.2

26 Oct 01:02
121f1d0
Compare
Choose a tag to compare
  • Fixed return type of isAnonymous
    #302
  • Fix EntitlementInfo.store type
    #296

4.3.1

07 Sep 20:06
d7c4d8d
Compare
Choose a tag to compare

amazon.alpha.1

28 Aug 01:02
Compare
Choose a tag to compare
amazon.alpha.1 Pre-release
Pre-release

Adds initial Amazon store support. In order to use please point to this tag in your package.json like this:

    "react-native-purchases": "RevenueCat/react-native-purchases#amazon.alpha.1"

Then configure the package using your RevenueCat API key specific for Amazon and passing useAmazon: true:

    Purchases.setup({apiKey: "api_key", useAmazon: true});

Please note that the setup call has changed and now accepts an object. This is to be able to use named arguments.

Check your android/app/build.gradle to make sure there is a dependency on everything included in the libs folder. React Native adds this by default:

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])

The next step would be to add the jar to your project. For that you can use the following gradle task that can be added to android/app/build.gradle and run via ./gradlew getAmazonLibrary in the android folder of your project or via Android Studio :

// Gradle task to download Amazon library
ext {
    iapVersion = "2.0.76"
}

task getAmazonLibrary {
    ext {
        downloadURL = "https://amzndevresources.com/iap/sdk/AmazonInAppPurchasing_Android.zip"
        fileToExtract = "in-app-purchasing-${iapVersion}.jar"
        destFile = new File( projectDir, "libs/$fileToExtract" )
    }

    inputs.property( 'downloadURL', downloadURL )
    inputs.property( 'fileToExtract', fileToExtract )
    outputs.file( destFile )

    doLast {
        File destDir = destFile.parentFile
        destDir.mkdirs()

        File downloadFile = new File( temporaryDir, 'download.zip' )
        new URL( downloadURL ).withInputStream { is ->
            downloadFile.withOutputStream { it << is }
        }

        project.copy {
            from {
                zipTree(downloadFile).matching { include "**/$fileToExtract" }.singleFile
            }

            into( destDir )
        }
    }
}

That gradle task will add the jar to the libs folder inside app:

Screen Shot 2021-08-27 at 5 58 53 PM

Alternatively, you can do this manually by downloading the .zip from Amazon and then unzipping and moving the in-app-purchasing-2.0.76.jar into your projects android/app/libs/ folder like in the screenshot above.

Due to some limitations, RevenueCat will only validate purchases made in production or in Live App Testing and won't validate purchases made with the Amazon App Tester.