This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* DEV-135 Moved models to a dedicated file * DEV-135 Version bump to 1.4.0, updated Glue dependency to 1.4.0 * DEV-135 Updating dependencies * DEV-135 Updated android dependencies * DEV-135 Updated native modules code to allow showing a native paywall * DEV-135 Added basic kotlin paywall listener * DEV-135 Splitted index.ts into glassfy.ts to simplify imports, added code requried to show paywalls. * DEV-135 Can now show paywalls on iOS * DEV-134 Added required context to show paywall, added required methods to plugin * DEV-135 Fixed import for PaywallListener * DEV-134 Moved to latest iOS Api * DEV-135 Can now use preload options when showing paywalls * DEV-135 Updated as of latest changes in android and ios sdk * DEV-92 Updated behaviour of onClose handler * DEV-135 fixed return type of restorePurchases * DEV-134 Updated as of latest changes in android sdk * Updated as of latest changes in android sdk * DEV-92 Updated as of latest changes in Android SDK --------- Co-authored-by: Federico Curzel <[email protected]>
- Loading branch information
Showing
19 changed files
with
4,976 additions
and
6,203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
GlassfyModule_kotlinVersion=1.6.10 | ||
GlassfyModule_minSdkVersion=21 | ||
GlassfyModule_kotlinVersion=1.8.10 | ||
GlassfyModule_minSdkVersion=24 | ||
GlassfyModule_compileSdkVersion=31 | ||
GlassfyModule_targetSdkVersion=28 | ||
android.useAndroidX=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
android/src/main/java/com/reactnativeglassfymodule/GlassfyPaywall.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.reactnativeglassfymodule | ||
|
||
import android.net.Uri | ||
import android.util.Log | ||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.bridge.Callback | ||
import com.facebook.react.bridge.WritableMap | ||
import io.glassfy.androidsdk.GlassfyError | ||
import io.glassfy.androidsdk.model.Sku | ||
import io.glassfy.androidsdk.model.Transaction | ||
import io.glassfy.paywall.PaywallFragment | ||
import io.glassfy.glue.encodedJson | ||
import org.json.JSONObject | ||
|
||
internal class ReactPaywallListener(private val handler: (String, JSONObject) -> Unit) { | ||
val onClose: (Transaction?, GlassfyError?) -> Unit = { transaction, error -> | ||
Log.d("ReactPaywallListener", "onClose") | ||
val payload = JSONObject().apply { | ||
put("transaction", transaction?.encodedJson()) | ||
put("error", error?.toString()) | ||
} | ||
handler("onClose", payload) | ||
} | ||
|
||
val onLink: (Uri) -> Unit = { url -> | ||
Log.d("ReactPaywallListener", "onLink $url") | ||
val payload = JSONObject().apply { | ||
put("url", url.toString()) | ||
} | ||
handler("onLink", payload) | ||
} | ||
|
||
val onRestore: () -> Unit = { | ||
Log.d("ReactPaywallListener", "onRestore") | ||
val payload = JSONObject().apply { | ||
// ... | ||
} | ||
handler("onRestore", payload) | ||
} | ||
|
||
val onPurchase: (Sku) -> Unit = { sku -> | ||
Log.d("ReactPaywallListener", "onPurchase") | ||
val payload = JSONObject().apply { | ||
put("sku", sku.encodedJson()) | ||
} | ||
handler("onPurchase", payload) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ buildscript { | |
} | ||
} | ||
repositories { | ||
mavenLocal() | ||
google() | ||
mavenCentral() | ||
} | ||
|
Oops, something went wrong.