Skip to content

PromotionActionType is not consistent between platformsΒ #215

@0x4A756E65

Description

@0x4A756E65

Attempting to use MParticle.CommerceEvent.createPromotionEvent() which takes an enum/int for the ActionType. Seeing different results on iOS vs Android. This makes the enum values MParticle.PromotionActionType.Click and MParticle.PromotionActionType.View not able to be used without a Platform check.

On Android, this maps to 0 for View and 1 for Click.

https://github.com/mParticle/react-native-mparticle/blob/main/android/src/main/java/com/mparticle/react/MParticleModule.java#L887

Image

On iOS, this maps to 1 for View and 0 for Click.

https://github.com/mParticle/mparticle-apple-sdk/blob/a8bc8a8df7d5b82359f5978e5e9462337a6a33b3/mParticle-Apple-SDK/Utils/MPConvertJS.swift#L148

Image

To fix - in the mParticle RN SDK, I guess do a platform check so consumers do not need to worry about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions