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

1.3.4 #20

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

The changelog for `Superwall`. Also see the [releases](https://github.com/superwall/react-native-superwall/releases) on GitHub.

## 1.3.4

### Enhancements

- Upgrades Android SDK to 1.3.1 [View Android SDK release notes](https://github.com/superwall-me/Superwall-Android/releases/tag/1.3.1)
- Upgrades iOS SDK to 3.11.1 [View iOS SDK release notes](https://github.com/superwall-me/Superwall-iOS/releases/tag/3.11.1)
- Adds `preloadAllPaywalls` and `preloadPaywalls(eventNames: Set<String>)` method to `Superwall` which preloads all paywalls or paywalls for the event names passed in the argument.

### Fixes

- Fixes issue with the `Experiment` inside `PaywallInfo` being `null` in the `handleSuperwallEvent` delegate for iOS.

## 1.3.3

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ dependencies {
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

implementation "com.superwall.sdk:superwall-android:1.3.0"
implementation "com.superwall.sdk:superwall-android:1.3.1"
implementation 'com.android.billingclient:billing:6.1.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.modules.core.DeviceEventManagerModule
import com.superwall.sdk.Superwall
import com.superwall.sdk.identity.identify
Expand Down Expand Up @@ -251,4 +252,16 @@ class SuperwallReactNativeModule(private val reactContext: ReactApplicationConte
}
}
}

@ReactMethod
fun preloadPaywalls(eventNames: ReadableArray) {
val eventNames = eventNames.toArrayList().toSet() as Set<String>
Superwall.instance.preloadPaywalls(eventNames)
}

@ReactMethod
fun preloadAllPaywalls(promise: Promise) {
Superwall.instance.preloadAllPaywalls()
promise.resolve(null)
}
}
14 changes: 9 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1118,12 +1118,14 @@ PODS:
- PurchasesHybridCommon (= 9.7.2)
- React-Core
- SocketRocket (0.6.1)
- superwall-react-native (1.3.2):
- Superscript (0.1.12)
- superwall-react-native (1.3.4):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- SuperwallKit (= 3.10.1)
- SuperwallKit (3.10.1)
- SuperwallKit (= 3.11.1)
- SuperwallKit (3.11.1):
- Superscript (= 0.1.12)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -1220,6 +1222,7 @@ SPEC REPOS:
- PurchasesHybridCommon
- RevenueCat
- SocketRocket
- Superscript
- SuperwallKit

EXTERNAL SOURCES:
Expand Down Expand Up @@ -1389,8 +1392,9 @@ SPEC CHECKSUMS:
RevenueCat: 7be0d7bde9efb2fc1ebd1888522c55bb4f9feb18
RNPurchases: 06957eb2f35bd7bb336d32fccf3534d45a3fda8a
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
superwall-react-native: 9092fa4e0d385c480e835a032132b46a3c13b2bc
SuperwallKit: 89cfaba57c139f97a578efc6bbb1f3963d2aa6b2
Superscript: 1ed1b4364f93bd16be05d085bba7357dbab95c83
superwall-react-native: be4cd6ea0670a4f2f08986309a7ca27ee5f0e684
SuperwallKit: ff739c94ebc351ae210c8b0f0b3931e930d74053
Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312

PODFILE CHECKSUM: 76fced934770e056b70a3087a2bc377b3556bae1
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import { StyleSheet, View, Platform, Button, Linking } from 'react-native';
import Superwall, { SuperwallOptions } from '@superwall/react-native-superwall';
import Superwall from '@superwall/react-native-superwall';
import { RCPurchaseController } from './RCPurchaseController';
import { MySuperwallDelegate } from './MySuperwallDelegate';

Expand All @@ -19,7 +19,7 @@
Superwall.configure(apiKey, null, purchaseController);
Superwall.shared.identify('abc');
Superwall.shared.setDelegate(delegate);
Superwall.shared.setUserAttributes({ test: "abc" });

Check failure on line 22 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Replace `"abc"` with `'abc'`
purchaseController.syncSubscriptionStatus();
};

Expand All @@ -41,7 +41,7 @@
return () => {
linkingListener.remove();
};
}, []);

Check failure on line 44 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook React.useEffect has a missing dependency: 'delegate'. Either include it or remove the dependency array

const register = () => {
Superwall.shared.register('flutter');
Expand Down
4 changes: 4 additions & 0 deletions ios/SuperwallReactNative.mm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ @interface RCT_EXTERN_MODULE(SuperwallReactNative, NSObject)
withRejecter:(RCTPromiseRejectBlock)reject
)

RCT_EXTERN_METHOD(preloadAllPaywalls)

RCT_EXTERN_METHOD(preloadPaywalls:(NSArray<NSString *> *)eventNames)

+ (BOOL)requiresMainQueueSetup
{
return NO;
Expand Down
10 changes: 10 additions & 0 deletions ios/SuperwallReactNative.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,14 @@ class SuperwallReactNative: RCTEventEmitter {
resolve(assignments.map { $0.toJson() })
}
}

@objc(preloadPaywalls:)
func preloadPaywalls(forEvents eventNames: [String]) {
Superwall.shared.preloadPaywalls(forEvents: Set(eventNames))
}

@objc(preloadAllPaywalls)
func preloadAllPaywalls() {
Superwall.shared.preloadAllPaywalls()
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superwall/react-native-superwall",
"version": "1.3.3",
"version": "1.3.4",
"description": "The React Native package for Superwall",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
10 changes: 10 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
);

this.eventEmitter.addListener('restore', async () => {
var restorationResult =

Check failure on line 140 in src/index.tsx

View workflow job for this annotation

GitHub Actions / lint

Delete `··`
await Superwall.purchaseController?.restorePurchases();
if (restorationResult == null) {
return;
Expand Down Expand Up @@ -359,6 +359,16 @@
return userAttributes;
}

async preloadAllPaywalls() {
await this.awaitConfig();
await SuperwallReactNative.preloadAllPaywalls();
}

async preloadPaywalls(eventNames: Set<string>) {
await this.awaitConfig();
await SuperwallReactNative.preloadPaywalls(eventNames);
}

async setUserAttributes(userAttributes: UserAttributes) {
await this.awaitConfig();
await SuperwallReactNative.setUserAttributes(userAttributes);
Expand Down
2 changes: 1 addition & 1 deletion superwall-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/superwall-me/Superwall-React-Native.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm,swift}"
s.dependency "SuperwallKit", '3.10.1'
s.dependency "SuperwallKit", '3.11.1'

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
Expand Down
Loading