Repository navigation
Leave the notification center alone until Flutwire has run - #11
Merged
Merged
Conversation
On iOS and macOS the plugin made itself the app's notification delegate as soon as the app launched, in every build, even when the app never started Flutwire. It now waits until Flutwire has run in that build, and remembers it did, by the version and build number of the app, so that a tap on the notification after the app was killed still finds the delegate in place. It also passes the call that opens the system's notification settings on to the delegate it replaced, as it already did for the other two.
…n test builds only
|
This pull request adds no capability the code did not already have. 4 files read · 2642 ms · against |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On iOS and macOS the plugin made itself the app's notification delegate as soon as the app launched, in every build, even when the app never started Flutwire. An app that keeps Flutwire in its production build with
initswitched off, which is the only option when just some flavors should record, had its notification handling routed through the plugin without asking for it.Now the plugin does nothing until Flutwire has run in that build.
initialize, which Dart calls only when Flutwire is recording, adopts the delegate and writes the version and build number of the app. At the next launch of the same build the plugin adopts the delegate at registration, so that a tap on the notification after the app was killed still finds it in place. A notification can only exist if Flutwire ran before, so nothing is lost. A build that never starts Flutwire never writes the mark and never touches the delegate.It also forwards
userNotificationCenter(_:openSettingsFor:)to the delegate it replaced. The plugin passed on the other two delegate calls and dropped this one.I checked it on the iOS simulator with the example app and a probe that logged
UNUserNotificationCenter.current().delegate:The example also builds for macOS. Android was already idle until Dart asks: it creates a channel and waits.
The package README gets a short section on recording in test builds only.
Targets
0.2.0.