-
Notifications
You must be signed in to change notification settings - Fork 317
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
openAppOnClick: true makes Apps restart on Taping the Notification #204
Comments
@AwsmOli True, that's weird and maybe a Cordova applications issue. However, |
I am seeing the same issue on Android 4.2.2, will test in iOS soon.
i did some fairly random trial-and-error with flags on both intents, but no luck yet. any hints where to look first? |
Guys I'm trying on Android 6.x and got it working by ensuring to initialize() the plugin as soon as the ionicPlatform is ready, so I basically added the initialization here: app.js
(......) however I couldn't make it restore the previous angularJS' state, but at least is firing the onNotificationClicked event, and from there I can manage to address the user where I prefer. |
good news: @Tempus35 seems to have found a solution to this and already made a pull request : #116. the magic happens in GeoNotificationNotifier.java The pull request addresses a lot of other things, and is discussed, so it is still open. |
Any update on this? We have the same problem. |
Suspicious Behaviour
When i get a Notification created using this plugin with
openAppOnClick: true
and the App is in background Cordova seems to destroy the App and start Bootstrapping again.Side effects
As a result of this the
onNotificationClicked
Eventhandler will never be executed.Seen on:
Nexus 5X running Android 7.1.1
Not tested on iOS yet!
Steps to reproduce:
openAppOnClick: true
flag to the Fixures so that{ id: "5", latitude: 40.7257093, longitude: -74.0032786, radius: 4000, transitionType: 3, notification: { text: "New York - SOHO"} },
becommes:
{ id: "5", latitude: 40.7257093, longitude: -74.0032786, radius: 4000, transitionType: 3, notification: { text: "New York - SOHO", openAppOnClick: true } },
ionic run android --device
Further investigation:
Using Logcat i can see that there is some Intent to open the Main Activity, followed by an attempt to play a sound for the Notification. and after that you can see a
Cordova.onDestroy()
and later again aCordova.onCreate()
To me it looks like the App itself is not restarted, and the Cordova activity as brought into foreground again, but for some reason Cordova just bootstraps the whole app again. Also while Cordova is bootstrapping you wont see the splash screen, but just a white screen until the app is loaded.
Logcat output when i tab the notification:
Can anyone confirm this?
Can anyone try that on iOS?
I really have no idea right now how to look into this further, if anyone has some ideas, ill look into it and try to fix it.
The text was updated successfully, but these errors were encountered: