I'm integrating AppsFlyer into my iOS Swift 4 app w/ XCode 10.0.
CocoPods has installed AppsFlyer 4.8.9 SDK.
import AppsFlyerLib
works.
In didFinishLaunchingWithOptions
, I can access AppsFlyerTracker.shared()
and set the dev key & app id.
However, the 3rd line of code required for integration fails to compile.
AppsFlyerTracker.shared().delegate = self
Error message:
Cannot assign value of type 'AppDelegate' to type 'AppsFlyerTrackerDelegate?'
XCode's Suggestion:
Insert ' as! AppsFlyerTrackerDelegate'
This suggestion does not work. The app crashes with the following error:
AppsFlyer SDK version 4.8.9 started build (728) Could not cast value of type 'MyApp.AppDelegate' (0x1057d0830) to >'AppsFlyerTrackerDelegate' (0x1056dcff8). 2018-10-27 18:17:49.448100-0700 Modacity[69104:7269920] Could not cast >value of type 'MyApp.AppDelegate' (0x1057d0830) to >'AppsFlyerTrackerDelegate' (0x1056dcff8).
Help? How do I set the delegate?
Thanks!