Conversation
02feae0 to
6bcec66
Compare
android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java
Outdated
Show resolved
Hide resolved
6bcec66 to
f07e0b2
Compare
These just creates singletons and its a similar approach to what we did for react-native. hot-restarts (which is what the issue is about) doesnt trigger onDetachedFromEngine. |
|
The changes won't just apply to hot reload, but Did you test clicking from cold start? nit: Add a comment explaining why this pattern is needed (for future maintainers who might question it) |
| } | ||
|
|
||
| private void registerClickListener() { | ||
| OneSignal.getNotifications().removeClickListener(this); |
There was a problem hiding this comment.
not exactly related to this PR, but should the click listener also go in lifecycle init? may be related to the click cold start issues
There was a problem hiding this comment.
I guess the click listener is opt in so probably best not to mess with this behavior.
f07e0b2 to
c636009
Compare
One Line Summary
Closes #763
Details
Hot Restart Bug for iOS:
flutter-main-ios-bug.mov
Hot Restart Bug for Android:
flutter-main-android-bug.mov
Hot Restart Fix for iOS:
flutter-hotrestart-fix-ios.mov
Hot Restart Fix for Android:
flutter-hotrestart-fix-android.mov
Motivation
Manual testing
Flutter: Launch Emulator)example/lib/main.dartfile then start debugging (you may need flutter extension)Affected code checklist
Checklist
Overview
Testing
Final pass
This change is