OpenKit / openkit-unity

OpenKit Unity Plugin project
18 stars 20 forks source link

Fix crash on startup when using push notifications for social challenges #6

Closed Claytonious closed 10 years ago

Claytonious commented 10 years ago

With push notifications setup for social challenges, Unity apps on iOS will crash on their first run after installation on a device. The cause was that registerForRemoteNotificationTypes was being inserted into the app controller's didFinishLaunching, but Unity has not yet had a chance to run the OKInitializer yet at this early moment!

This pull request fixes the issue by delaying the call to registerForRemoteNotificationTypes until the OKInitializer has had a chance to run from Unity. (Or whatever the dev is using to call Configure on OK).