Discussions

Ask a Question
Back to All

Flutter SDK - addFutureTrackTag method on iOS does not work

Hi,

I am trying to call the addFutureTrackTag method using the Flutter SDK, like this:

await TrackingApi().addFutureTrackTag(tag: tag, source: source);

This works perfectly in Android, but throws an error in iOS which crashes the app:

telematics_sdk/SwiftTelematicsSDKPlugin.swift:210: Fatal error: Unexpectedly found nil while unwrapping an Optional value

I noticed in the SwiftTelematicsSDKPlugin.swif (https://github.com/Mobile-Telematics/telematicsSDK-demoapp-flutter-/blob/main/ios/Classes/SwiftTelematicsSDKPlugin.swift) handle function, "addFutureTrackTag" is mapped to the addTrackTags method. Is this intentional? To me, it seems incorrect.

lines 63 and 63:

        ....
        case "addFutureTrackTag":
            addTrackTags(call, result)
        ....

I think this needs to be:

        ....
        case "addFutureTrackTag":
            addFutureTrackTag(call, result)
        ....