Skip to content

Commit

Permalink
3.1.24 (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
namidan authored Jan 10, 2024
1 parent 086d771 commit 3bc4f59
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.nami_sdk_version = '3.1.22'
ext.nami_sdk_version = '3.1.24'
ext.min_sdk = 25
ext.target_sdk = 33
ext.compile_sdk = 33
Expand Down
39 changes: 30 additions & 9 deletions samples/testnami/src/main/java/com/namiml/app/test/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.namiml.app.test

import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.pm.ActivityInfo
import android.content.pm.PackageManager
import android.net.Uri
Expand Down Expand Up @@ -42,6 +44,8 @@ import com.namiml.customer.NamiCustomerManager
import com.namiml.demo.basicpaywallmgmt.GooglePlayBillingHelper
import com.namiml.demo.basicpaywallmgmt.GooglePlayPurchaseListener
import com.namiml.paywall.NamiPaywallManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import java.util.*

const val LOG_TAG = "TestNami"
Expand Down Expand Up @@ -224,18 +228,35 @@ class MainActivity : ComponentActivity() {
campaigns = it
}

// NamiPaywallManager.registerDeepLinkHandler { paywall, url ->
// NamiPaywallManager.dismiss(paywall)
//
// try {
// startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
// } catch (e: ActivityNotFoundException) {
// Log.d(LOG_TAG, "Unable to open deeplink uri $url")
// }
// }
NamiPaywallManager.registerDeepLinkHandler { paywall, url ->
NamiPaywallManager.dismiss(paywall, completionHandler = {
try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
} catch (e: ActivityNotFoundException) {
Log.d(LOG_TAG, "Unable to open deeplink uri $url")
}
})

}

NamiPaywallManager.registerRestoreHandler { paywall ->
Log.d(LOG_TAG, "Restore on paywall called.")
GlobalScope.launch {
NamiPaywallManager.dismiss(paywall)
}
}

NamiPaywallManager.registerCloseHandler { paywall ->
Log.d(LOG_TAG, "Close handler on paywall called.")
NamiPaywallManager.dismiss(paywall)
}

NamiPaywallManager.registerSignInHandler { paywall ->
Log.d(LOG_TAG, "Sign in on paywall called.")
NamiPaywallManager.dismiss(paywall, completionHandler = {

})

}

NamiCustomerManager.setCustomerDataPlatformId("12345")
Expand Down

0 comments on commit 3bc4f59

Please sign in to comment.