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

Version/5.0.0-alpha01 #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Purchasely is a solution to ease the integration and boost your In-App Purchase

```
dependencies:
purchasely_flutter: ^1.7.0
purchasely_flutter: ^5.0.0-alpha01
```

## Usage
Expand All @@ -18,20 +18,33 @@ import 'package:purchasely_flutter/purchasely_flutter.dart';

// ...

bool configured = await Purchasely.startWithApiKey(
'YOUR_API_KEY',
['Google'],
null, // your user id
PLYLogLevel.debug,
PLYRunningMode.full
);

var result = await Purchasely.presentProductWithIdentifier('YOU_PRODUCT_ID');
print('Result : $result');
if (result.result == PLYPurchaseResult.cancelled) {
print("User cancelled purchased");
} else {
print('User purchased: ${result.plan.name}');
bool configured = await Purchasely.start(
apiKey: '<YOUR_API_KEY>',
androidStores: ['Google, Huawei, Amazon'],
storeKit1: false,
logLevel: PLYLogLevel.error,
runningMode: PLYRunningMode.full,
userId: null,
);

var result = await Purchasely.presentPresentationForPlacement("<YOUR_PLACEMENT_ID>", isFullscreen: true);

switch (result.result) {
case PLYPurchaseResult.cancelled:
{
print("User cancelled purchased");
}
break;
case PLYPurchaseResult.purchased:
{
print("User purchased ${result.plan?.name}");
}
break;
case PLYPurchaseResult.restored:
{
print("User restored ${result.plan?.name}");
}
break;
}
```

Expand Down
3 changes: 2 additions & 1 deletion VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ This file provides the underlying native SDK versions that the React Native SDK
| 4.3.4 | 4.3.6 | 4.3.5 |
| 4.4.0 | 4.4.2 | 4.4.2 |
| 4.4.1 | 4.4.2 | 4.4.2 |
| 4.5.0 | 4.5.0 | 4.5.1 |
| 4.5.0 | 4.5.0 | 4.5.0 |
5.0.0-alpha01 | 5.0.0-alpha01 | 5.0.0-alpha01 |
File renamed without changes
2 changes: 2 additions & 0 deletions purchasely/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 5.0.0-alpha01
// TODO
## 4.5.0
- Markdown: Enhanced text formatting capabilities by supporting markdown syntax for bold, italic, strikethrough, and links. Reach out to the Customer Success Team to activate it for your account.
- Amount Tag Pricing: Improved price display on AMOUNT tag by hiding decimals when the price is a whole number.
Expand Down
39 changes: 0 additions & 39 deletions purchasely/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion purchasely/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ dependencies {

api 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'

api 'io.purchasely:core:4.5.1'
api 'io.purchasely:core:5.0.0-alpha01'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import android.view.View
import android.widget.FrameLayout
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.platform.PlatformView
import io.purchasely.ext.PLYPresentationViewProperties
import io.purchasely.ext.PLYPresentationProperties
import io.purchasely.ext.PLYProductViewResult
import io.purchasely.ext.Purchasely
import io.purchasely.models.PLYPresentationPlan
import io.purchasely.models.PLYPlan
import android.view.ViewGroup

internal class NativeView(
Expand Down Expand Up @@ -42,7 +44,7 @@ internal class NativeView(
// Build the presentation view
val presentationView = presentation.buildView(
context = context,
viewProperties = PLYPresentationViewProperties(
properties = PLYPresentationProperties(
onClose = { closeCallback() }
),
callback = { result, plan ->
Expand All @@ -60,7 +62,7 @@ internal class NativeView(
Log.e("Purchasely", "PLYPresentation not found: using presentationId=$presentationId and placementId=$placementId.")
val presentationView = Purchasely.presentationView(
context = context,
properties = PLYPresentationViewProperties(
properties = PLYPresentationProperties(
presentationId = presentationId,
placementId = placementId,
onClose = { closeCallback() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import android.widget.FrameLayout
import androidx.core.view.WindowCompat
import androidx.fragment.app.FragmentActivity
import io.purchasely.ext.PLYPresentation
import io.purchasely.ext.PLYPresentationViewProperties
import io.purchasely.ext.PLYPresentationProperties
import io.purchasely.ext.PLYProductViewResult
import io.purchasely.ext.Purchasely
import io.purchasely.models.PLYPlan
Expand Down Expand Up @@ -60,30 +60,30 @@ class PLYProductActivity : FragmentActivity() {
presentation = intent.extras?.getParcelable("presentation")

paywallView = if(presentation != null) {
presentation?.buildView(this, PLYPresentationViewProperties(
presentation?.buildView(this, PLYPresentationProperties(
onClose = {
supportFinishAfterTransition()
}
), callback)
} else {
Purchasely.presentationView(
this@PLYProductActivity,
PLYPresentationViewProperties(
context = this@PLYProductActivity,
properties = PLYPresentationProperties(
placementId = placementId,
contentId = contentId,
presentationId = presentationId,
planId = planId,
productId = productId,
onLoaded = { isLoaded ->
if(!isLoaded) return@PLYPresentationViewProperties
if(!isLoaded) return@PLYPresentationProperties

val backgroundPaywall = paywallView?.findViewById<FrameLayout>(io.purchasely.R.id.content)?.background
if(backgroundPaywall != null) {
findViewById<View>(R.id.container).background = backgroundPaywall
}
}
),
callback
callback = callback
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class PurchaselyFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware,
.userId(userId)
.build()

Purchasely.sdkBridgeVersion = "4.5.0"
Purchasely.sdkBridgeVersion = "5.0.0-alpha01"
Purchasely.appTechnology = PLYAppTechnology.FLUTTER

Purchasely.start { isConfigured, error ->
Expand All @@ -364,7 +364,7 @@ class PurchaselyFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityAware,
contentId: String?,
result: Result) {

val properties = PLYPresentationViewProperties(
val properties = PLYPresentationProperties(
placementId = placementId,
presentationId = presentationId,
contentId = contentId)
Expand Down
16 changes: 0 additions & 16 deletions purchasely/example/README.md

This file was deleted.

11 changes: 6 additions & 5 deletions purchasely/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
namespace "io.purchasely.sample"
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -44,8 +45,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.purchasely.demo"
minSdkVersion 21
targetSdkVersion 33
minSdkVersion 23
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -66,6 +67,6 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'io.purchasely:google-play:4.5.1'
implementation 'io.purchasely:player:4.5.1'
implementation 'io.purchasely:google-play:5.0.0-alpha01'
implementation 'io.purchasely:player:5.0.0-alpha01'
}
16 changes: 14 additions & 2 deletions purchasely/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.8.22'
ext.kotlin_version = '2.0.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.android.tools.build:gradle:8.6.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -17,6 +17,18 @@ allprojects {
mavenCentral()
mavenLocal()
}

subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
}

rootProject.buildDir = '../build'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
3 changes: 1 addition & 2 deletions purchasely/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ class _MyAppState extends State<MyApp> {
List<PLYProduct> products = await Purchasely.allProducts();
inspect(products);

PLYProduct product =
await Purchasely.productWithIdentifier("PURCHASELY_PLUS");
PLYProduct product = await Purchasely.productWithIdentifier("PURCHASELY_PLUS");
print('Product found');
inspect(product);

Expand Down
2 changes: 1 addition & 1 deletion purchasely/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: purchasely_flutter
description: Purchasely is a solution to ease the integration and boost your In-App Purchase & Subscriptions on the App Store, Google Play Store and Huawei App Gallery.
version: 4.5.0
version: 5.0.0-alpha01
homepage: https://www.purchasely.com/

environment:
Expand Down
2 changes: 2 additions & 0 deletions purchasely_android_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 5.0.0-alpha01
// TODO
## 4.5.0
- Markdown: Enhanced text formatting capabilities by supporting markdown syntax for bold, italic, strikethrough, and links. Reach out to the Customer Success Team to activate it for your account.
- Amount Tag Pricing: Improved price display on AMOUNT tag by hiding decimals when the price is a whole number.
Expand Down
15 changes: 0 additions & 15 deletions purchasely_android_player/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion purchasely_android_player/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

api 'io.purchasely:player:4.5.1'
api 'io.purchasely:player:5.0.0-alpha01'
}
Loading