Skip to content

Commit

Permalink
adapt to android 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
namidan committed Jul 27, 2023
1 parent bd16594 commit 96162c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 ?: "")
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/nami/reactlibrary/NamiUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 96162c1

Please sign in to comment.