After integrating Urban Airship, when I call
let appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate
I always get nil. When I tried to get class of UIApplication.sharedApplication().delegate, it tells me, that it is UAAppDelegateProxy now.
But
let appDelegate = UIApplication.sharedApplication().delegate as? UAAppDelegateProxy
also returns nil.
How can I get my appDelegate?
Edit
I figured up, that this happens only when UAConfig
parameter automaticSetupEnabled
is set to true. When automaticSetupEnabled
is false, I get appDelegate as usual, but I'm losing advantages of urban airship automatic configuration.
This is a bug in the Urban Airship SDK that they have promised to fix in the next SDK release.
From their support:
We are aware of this issue and are looking to have it resolved in our next SDK release. In the meantime, as a workaround, manually setting up our SDK will allow you to work with the AppDelegate successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With