Skip to content

Commit

Permalink
Merge pull request #11 from superwall/develop
Browse files Browse the repository at this point in the history
1.2.6
  • Loading branch information
yusuftor authored Aug 22, 2024
2 parents 889ef52 + 7531a38 commit e19bd4f
Show file tree
Hide file tree
Showing 96 changed files with 25,794 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ android.iml
# Cocoapods
#
example/ios/Pods
expo-example/ios/Pods

# Ruby
example/vendor/
expo-example/vendor/

# node.js
#
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## 1.2.6

### Enhancements

- Upgrades iOS SDK to 3.7.3. [View iOS SDK release notes](https://github.com/superwall-me/Superwall-iOS/releases/tag/3.7.3)
- Upgrades Android SDK to 1.2.4. [View Android SDK release notes](https://github.com/superwall-me/Superwall-Android/releases/tag/1.2.4)

## 1.2.5

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ yarn

> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
We have two example apps – one built [with expo](/expo/) and one built [without expo](/example/), which demonstrate usage of the library. You need to run it to test any changes you make.

It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.

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.2.1"
implementation "com.superwall.sdk:superwall-android:1.2.4"
implementation 'com.android.billingclient:billing:6.1.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.superwall.sdk.Superwall
import com.superwall.sdk.identity.identify
import com.superwall.sdk.identity.setUserAttributes
import com.superwall.sdk.misc.ActivityProvider
import com.superwall.sdk.misc.sdkVersion
import com.superwall.sdk.paywall.presentation.PaywallPresentationHandler
import com.superwall.sdk.paywall.presentation.dismiss
import com.superwall.sdk.paywall.presentation.register
Expand Down Expand Up @@ -44,6 +45,7 @@ class SuperwallReactNativeModule(private val reactContext: ReactApplicationConte
apiKey: String,
options: ReadableMap? = null,
usingPurchaseController: Boolean,
platformVersion: String,
completion: Promise
) {
val options = options?.let {
Expand Down Expand Up @@ -73,7 +75,10 @@ class SuperwallReactNativeModule(private val reactContext: ReactApplicationConte
)
}

Superwall.instance.setPlatformWrapper("React Native");
Superwall.instance.setPlatformWrapper(
"React Native",
version = sdkVersion
);
}

@ReactMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,22 @@ class SuperwallEvent {
is SuperwallEvent.SurveyClose -> {
map.putString("event", "surveyClose")
}
is SuperwallEvent.ConfigAttributes -> {
map.putString("event", "configAttributes")
}
is SuperwallEvent.CustomPlacement -> {
map.putString("event", "customPlacement")
map.putString("name", superwallEvent.placementName)
map.putMap("params", convertMapToReadableMap(superwallEvent.params))
map.putMap("paywallInfo", superwallEvent.paywallInfo.toJson())
}
is SuperwallEvent.PaywallWebviewLoadFallback -> {
map.putString("event", "paywallWebviewLoadFallback")
map.putMap("paywallInfo", superwallEvent.paywallInfo.toJson())
}
is SuperwallEvent.ErrorThrown -> {
map.putString("event", "errorThrown")
}
}
return map
}
Expand Down
16 changes: 15 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,19 @@ target 'SuperwallReactNativeExample' do
config[:reactNativePath],
:mac_catalyst_enabled => false
)

installer.pods_project.targets.each do |target|
if target.name == 'Flipper'
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
contents = File.read(file_path)
unless contents.include?('#include <functional>')
File.chmod(0755, file_path)
File.open(file_path, 'w') do |file|
file.puts('#include <functional>')
file.puts(contents)
end
end
end
end
end
end
end
10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1122,8 +1122,8 @@ PODS:
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- SuperwallKit (= 3.7.0)
- SuperwallKit (3.7.0)
- SuperwallKit (= 3.7.3)
- SuperwallKit (3.7.3)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -1389,10 +1389,10 @@ SPEC CHECKSUMS:
RevenueCat: 7be0d7bde9efb2fc1ebd1888522c55bb4f9feb18
RNPurchases: 06957eb2f35bd7bb336d32fccf3534d45a3fda8a
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
superwall-react-native: 7608d6b28032a2fec4757df086fdbbe41d6d7d0d
SuperwallKit: 5db90223421220fb745a7a9814c684a3a71f7449
superwall-react-native: dbe9dad5ca0313b7092017d2683d5a22ca07354a
SuperwallKit: 3ff5d6783715428752d2bff9580897f2c74f7b2c
Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312

PODFILE CHECKSUM: ef933d85d2e37cf2166eefe876125fde9d6d2a1e
PODFILE CHECKSUM: 76fced934770e056b70a3087a2bc377b3556bae1

COCOAPODS: 1.15.2
76 changes: 76 additions & 0 deletions expo-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# @generated expo-cli sync-b5df6a44d8735348b729920a7406b633cfb74d4c
# The following patterns were generated by expo-cli

# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

# @end expo-cli
45 changes: 45 additions & 0 deletions expo-example/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Superwall, { LogLevel, LogScope, SuperwallOptions } from '@superwall/react-native-superwall';

Check failure on line 1 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

Replace `·LogLevel,·LogScope,·SuperwallOptions·` with `⏎··LogLevel,⏎··LogScope,⏎··SuperwallOptions,⏎`
import { StatusBar } from 'expo-status-bar';

Check warning on line 2 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

'StatusBar' is defined but never used
import { Button, Platform, StyleSheet, Text, View } from 'react-native';

Check warning on line 3 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

'Text' is defined but never used

export default function App() {
const options = new SuperwallOptions();
options.logging.level = LogLevel.Debug;
options.logging.scopes = [LogScope.All];

const apiKey =
Platform.OS === 'ios'

Check failure on line 11 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
? 'pk_5f6d9ae96b889bc2c36ca0f2368de2c4c3d5f6119aacd3d2'

Check failure on line 12 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

Insert `··`
: 'pk_d1f0959f70c761b1d55bb774a03e22b2b6ed290ce6561f85';

Check failure on line 13 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

Insert `··`

Superwall.configure(apiKey, options, null);

const register = () => {
Superwall.shared.register('campaign_trigger');
};

const identify = () => {
Superwall.shared.identify('abc');
};

const reset = () => {
Superwall.shared.reset();
};

return (
<View style={styles.container}>

Check warning on line 30 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

'React' must be in scope when using JSX
<Button title="Register Event" onPress={register} />

Check warning on line 31 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

'React' must be in scope when using JSX
<Button title="Identify" onPress={identify} />

Check warning on line 32 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

'React' must be in scope when using JSX
<Button title="Reset" onPress={reset} />

Check warning on line 33 in expo-example/App.js

View workflow job for this annotation

GitHub Actions / lint

'React' must be in scope when using JSX
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
15 changes: 15 additions & 0 deletions expo-example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# OSX
#
.DS_Store

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# Bundle artifacts
*.jsbundle
Loading

0 comments on commit e19bd4f

Please sign in to comment.