OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

Postpone initialization of iOS callbacks #369

Closed brismithers closed 1 year ago

brismithers commented 1 year ago

Description

One Line Summary

Update iOS Initialization to register callbacks after instantiation of OneSignalImplementation, rather than during instantiation.

Details

Motivation

Fixes #368 This change keeps the same ordering of initialization. It simply moves the registration of the callbacks to be in OneSignalImplementation.Initialize rather than in the OneSignalImplementation constructor. By postponing registration slightly, the instance of OneSignalImplementation has been fully initialized, and _instance properly set.

Scope

iOS initialization. No functional changes expected.

Testing

Manual testing

Brought up the iOS sample app on a real device and ensure everything was initialized correctly. Drove permission changes to ensure the permission callback was still being called, assumption being if this one was called back then all others will still work as well.

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable