From 96162c1e0317d76e96dd06ed367b1a9054969662 Mon Sep 17 00:00:00 2001 From: dannami Date: Thu, 27 Jul 2023 09:37:54 -0600 Subject: [PATCH] adapt to android 3.1.0 --- android/build.gradle | 2 +- .../com/nami/reactlibrary/NamiCampaignManagerBridge.kt | 7 ++++--- android/src/main/java/com/nami/reactlibrary/NamiUtil.kt | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 56e2a615..b402a786 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -84,7 +84,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation 'com.github.jeziellago:compose-markdown:0.3.0' - implementation "com.namiml:sdk-android:3.0.24" + implementation "com.namiml:sdk-android:3.1.0" implementation 'com.facebook.react:react-native:+' // From node_modules coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5" diff --git a/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt b/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt index fc1b7543..c6fa3826 100644 --- a/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt +++ b/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt @@ -11,6 +11,7 @@ import com.namiml.campaign.LaunchCampaignResult import com.namiml.campaign.NamiCampaign import com.namiml.campaign.NamiCampaignManager import com.namiml.paywall.model.PaywallLaunchContext +import com.namiml.paywall.model.NamiPaywallEvent class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext), ActivityEventListener { @@ -135,16 +136,16 @@ class NamiCampaignManagerBridgeModule(reactContext: ReactApplicationContext) : val actionString = paywallEvent.action.toString() val skuString = paywallEvent.sku?.skuId ?: "" - val purchasesArray = createPurchaseArray(purchases) + val purchasesArray = createPurchaseArray(paywallEvent.purchases) val resultMap = Arguments.createMap().apply { putString(CAMPAIGN_ID, paywallEvent.campaignId) putString(CAMPAIGN_LABEL, paywallEvent.campaignLabel ?: "") putString(PAYWALL_ID, paywallEvent.paywallId) - putString(ACTION, paywallEvent.actionString) + putString(ACTION, actionString) putString(SKU_ID, skuString) putString(PURCHASE_ERROR, paywallEvent.purchaseError ?: "") - putArray(PURCHASES, paywallEvent.purchasesArray) + putArray(PURCHASES, purchasesArray) putString(CAMPAIGN_NAME, paywallEvent.campaignName ?: "") putString(CAMPAIGN_TYPE, paywallEvent.campaignType ?: "") putString(CAMPAIGN_URL, paywallEvent.campaignUrl ?: "") diff --git a/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt b/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt index cbe2ec31..22469aa0 100644 --- a/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt +++ b/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt @@ -79,7 +79,7 @@ fun NamiSKU.toSkuDict(): WritableMap { productDict.putString("skuId", this.skuId) productDict.putString("id", this.id) productDict.putString("type", this.type.toString()) - productDict.putString("promoId", "") + productDict.putString("promoId", this.promoId) return productDict }