Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization Race Condition Fix #512

Merged
merged 1 commit into from May 17, 2018
Merged

Initialization Race Condition Fix #512

merged 1 commit into from May 17, 2018

Conversation

Nightsd01
Copy link
Contributor

• Fixes an issue where the OneSignal iOS native SDK was being initialized too early in the iOS application lifecycle, causing a race condition.
• This race condition, in some cases, would cause an issue where users would not get subscribed to OneSignal, they'd have a null push token/userId, could not receive notifications, etc.
• Fixed by swizzling UIApplication.didFinishLaunchingWithOptions. This swizzled method gets called before the AppDelegate's own implementation of this method, and this lets the SDK ensure that the OneSignal iOS sdk is initialized. This is how Onesignal's Cordova SDK (as well as others) perform initialization.
• Removed some unnecessary header files

• Fixes an issue where the OneSignal iOS native SDK was being initialized too early in the iOS application lifecycle, causing a race condition.
• This race condition, in some cases, would cause an issue where users would not get subscribed to OneSignal, they'd have a null push token/userId, could not receive notifications, etc.
• Fixed by swizzling UIApplication.didFinishLaunchingWithOptions. This swizzled method gets called before the AppDelegate's own implementation of this method, and this lets the SDK ensure that the OneSignal iOS sdk is initialized. This is how Onesignal's Cordova SDK (as well as others) perform initialization.
• Removed some unnecessary header files
@Nightsd01 Nightsd01 merged commit 99fae65 into master May 17, 2018
@Nightsd01 Nightsd01 deleted the init_race_condition branch May 17, 2018 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants