urbanairship / airship-flutter

Flutter integration
Other
17 stars 17 forks source link

Airship.addEvent doesn't work if CustomEvent's value is null #162

Closed swiftymf closed 1 year ago

swiftymf commented 1 year ago

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^6.2.2

Report

What unexpected behavior are you seeing?

When using Airship.addEvent(event) iOS doesn't add the event if the CustomEvent value is null because of this line in SwiftAirshipPlugin.swift:

        guard let value = event[eventValueKey] as? Int else {
            result(nil)
            return
        }

What is the expected behavior?

On Android the event is still recorded. I would expect the same for iOS or for the value to not be optional or at least a warning in the code saying a non-null value needs to be passed in.

What are the steps to reproduce the unexpected behavior?

Set up a custom event like this: final event = CustomEvent('event name here', null); Airship.addEvent(event); The event will not be added or show up in the Airship console.

rlepinski commented 1 year ago

We will get an update out that will fix this. The default value for a custom even tis 1, so you can just set 1 for now if you dont want to be blocked.

rlepinski commented 1 year ago

Fixed in 7.0.0