BranchMetrics / sdk-release

TUNE iOS, Android, and Windows native SDKs
https://developers.tune.com/sdk/quick-starts/
GNU General Public License v3.0
56 stars 46 forks source link

SDK IOS 4.14.1 : Cannot convert value of type '[UIApplicationOpenURLOptionsKey : Any]' to expected argument type '[String : Any]!' #40

Closed charliefancelli closed 6 years ago

charliefancelli commented 6 years ago

Hi,

Your SDK seem to be outdated from Apple native function (app in SWIFT 3.2)

func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

   // When the app is opened due to a deep link, call the Tune deep link setter
    Tune.handleOpen(url, options: options)

return true
}

We have the issue : Cannot convert value of type '[UIApplicationOpenURLOptionsKey : Any]' to expected argument type '[String : Any]!'

Can you update it or give us the documentation for this issue.

Regards,

atroutt commented 6 years ago

Hi Charlie,

We are aware of this and have it in the queue of fixes for the iOS SDK. The best I can offer right now is a workaround:

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    // Tune the API is mismatched from the iOS API, to be fixed by them in a later release
    // TEMPORARY: Convert keys from UIApplicationOpenURLOptionsKey -> String as workaround
    var newOptions: [String: Any] = [:]
    for (key, value) in options {
        newOptions[String(describing:key)] = value
    }
    Tune.handleOpen(url, options:newOptions)
    return true
}

-Audrey

charliefancelli commented 6 years ago

Hi Audrey,

Thanks for the reply, we thought about the fix but i prefered asking to you.

We do that fix until you fix it directly in our SDK.

Regards,

kevmalek commented 6 years ago

Any word on a fix for this? We're implementing the workaround in the mean time. Thanks