Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ internal class RNUsercentricsModule(
}

@ReactMethod
override fun setCMPId(id: Int) {
usercentricsProxy.instance.setCMPId(id)
override fun setCMPId(id: Double) {
usercentricsProxy.instance.setCMPId(id.toInt())
}

@ReactMethod
Expand Down Expand Up @@ -131,80 +131,80 @@ internal class RNUsercentricsModule(
}

@ReactMethod
override fun acceptAllForTCF(fromLayer: Int, consentType: Int, promise: Promise) {
override fun acceptAllForTCF(fromLayer: Double, consentType: Double, promise: Promise) {
promise.resolve(
usercentricsProxy.instance.acceptAllForTCF(
TCFDecisionUILayer.values()[fromLayer], UsercentricsConsentType.values()[consentType]
TCFDecisionUILayer.values()[fromLayer.toInt()], UsercentricsConsentType.values()[consentType.toInt()]
).toWritableArray()
)
}

@ReactMethod
override fun acceptAll(consentType: Int, promise: Promise) {
override fun acceptAll(consentType: Double, promise: Promise) {
promise.resolve(
usercentricsProxy.instance.acceptAll(
UsercentricsConsentType.values()[consentType]
UsercentricsConsentType.values()[consentType.toInt()]
).toWritableArray()
)
}

@ReactMethod
override fun denyAllForTCF(fromLayer: Int, consentType: Int, unsavedPurposeLIDecisions: ReadableArray, promise: Promise) {
override fun denyAllForTCF(fromLayer: Double, consentType: Double, unsavedPurposeLIDecisions: ReadableArray, promise: Promise) {
promise.resolve(
usercentricsProxy.instance.denyAllForTCF(
TCFDecisionUILayer.values()[fromLayer], UsercentricsConsentType.values()[consentType], unsavedPurposeLIDecisions.deserializePurposeLIDecisionsMap()
TCFDecisionUILayer.values()[fromLayer.toInt()], UsercentricsConsentType.values()[consentType.toInt()], unsavedPurposeLIDecisions.deserializePurposeLIDecisionsMap()
).toWritableArray()
)
}

@ReactMethod
override fun denyAll(consentType: Int, promise: Promise) {
override fun denyAll(consentType: Double, promise: Promise) {
promise.resolve(
usercentricsProxy.instance.denyAll(
UsercentricsConsentType.values()[consentType]
UsercentricsConsentType.values()[consentType.toInt()]
).toWritableArray()
)
}

@ReactMethod
override fun saveDecisionsForTCF(
tcfDecisions: ReadableMap,
fromLayer: Int,
fromLayer: Double,
saveDecisions: ReadableArray,
consentType: Int,
consentType: Double,
promise: Promise
) {
promise.resolve(
usercentricsProxy.instance.saveDecisionsForTCF(
tcfDecisions.deserializeTCFUserDecisions(),
TCFDecisionUILayer.values()[fromLayer],
TCFDecisionUILayer.values()[fromLayer.toInt()],
saveDecisions.deserializeUserDecision(),
UsercentricsConsentType.values()[consentType]
UsercentricsConsentType.values()[consentType.toInt()]
).toWritableArray()
)
}

@ReactMethod
override fun saveDecisions(decisions: ReadableArray, consentType: Int, promise: Promise) {
override fun saveDecisions(decisions: ReadableArray, consentType: Double, promise: Promise) {
promise.resolve(
usercentricsProxy.instance.saveDecisions(
decisions.deserializeUserDecision(), UsercentricsConsentType.values()[consentType]
decisions.deserializeUserDecision(), UsercentricsConsentType.values()[consentType.toInt()]
).toWritableArray()
)
}

@ReactMethod
override fun saveOptOutForCCPA(isOptedOut: Boolean, consentType: Int, promise: Promise) {
override fun saveOptOutForCCPA(isOptedOut: Boolean, consentType: Double, promise: Promise) {
promise.resolve(
usercentricsProxy.instance.saveOptOutForCCPA(
isOptedOut, UsercentricsConsentType.values()[consentType]
isOptedOut, UsercentricsConsentType.values()[consentType.toInt()]
).toWritableArray()
)
}

@ReactMethod
override fun track(event: Int) {
usercentricsProxy.instance.track(UsercentricsAnalyticsEventType.values()[event])
override fun track(event: Double) {
usercentricsProxy.instance.track(UsercentricsAnalyticsEventType.values()[event.toInt()])
}

@ReactMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ abstract class RNUsercentricsModuleSpec internal constructor(context: ReactAppli
abstract fun getABTestingVariant(promise: Promise)

@ReactMethod
abstract fun setCMPId(id: Int)
abstract fun setCMPId(id: Double)

@ReactMethod
abstract fun setABTestingVariant(variant: String)
Expand All @@ -64,34 +64,34 @@ abstract class RNUsercentricsModuleSpec internal constructor(context: ReactAppli
abstract fun changeLanguage(language: String, promise: Promise)

@ReactMethod
abstract fun acceptAll(consentType: Int, promise: Promise)
abstract fun acceptAll(consentType: Double, promise: Promise)

@ReactMethod
abstract fun acceptAllForTCF(fromLayer: Int, consentType: Int, promise: Promise)
abstract fun acceptAllForTCF(fromLayer: Double, consentType: Double, promise: Promise)

@ReactMethod
abstract fun denyAll(consentType: Int, promise: Promise)
abstract fun denyAll(consentType: Double, promise: Promise)

@ReactMethod
abstract fun denyAllForTCF(fromLayer: Int, consentType: Int, unsavedPurposeLIDecisions: ReadableArray, promise: Promise)
abstract fun denyAllForTCF(fromLayer: Double, consentType: Double, unsavedPurposeLIDecisions: ReadableArray, promise: Promise)

@ReactMethod
abstract fun saveDecisions(decisions: ReadableArray, consentType: Int, promise: Promise)
abstract fun saveDecisions(decisions: ReadableArray, consentType: Double, promise: Promise)

@ReactMethod
abstract fun saveDecisionsForTCF(
tcfDecisions: ReadableMap,
fromLayer: Int,
fromLayer: Double,
saveDecisions: ReadableArray,
consentType: Int,
consentType: Double,
promise: Promise
)

@ReactMethod
abstract fun saveOptOutForCCPA(isOptedOut: Boolean, consentType: Int, promise: Promise)
abstract fun saveOptOutForCCPA(isOptedOut: Boolean, consentType: Double, promise: Promise)

@ReactMethod
abstract fun track(event: Int)
abstract fun track(event: Double)

companion object {
const val NAME = "RNUsercentricsModule"
Expand Down