rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
179 stars 161 forks source link

App Android stop when receives Push #99

Closed ejastre closed 7 years ago

ejastre commented 7 years ago

If the app is open the push works and opens, but if it has been terminated when a push arrives the app breaks. I installed via Nuget in Xamarin Forms version 1.2.4. I tested both in Debug and Release. Any solution?

JulianPasque commented 7 years ago

I am facing the same problem.

jgoelten commented 7 years ago

I can see the same behaviour in my app.

Update: After using the attached PushNotificationAppStarter class that was included when installing the nuget package, the intent service successfully handles notification when the app is terminated.

jorgenstorlie commented 7 years ago

me to, updated version does not compile with latest version of GooglePlayServices (version 32.961)

lucascc26 commented 7 years ago

@jgoelten can you provide a sample project that is working? It's been a nightmare, I've tried a lot of things but I still can't receive notifications if my app is closed.

Thanks.

ejastre commented 7 years ago

[SOLVED] To solved this issue, just follow the steps in this link: https://github.com/rdelrosario/xamarin-plugins/tree/master/PushNotification

Android

On the Android Application class, is better to use the OnCreate of the Android Application class so you can handle push notifications even when activities are closed or app not running by using our PushNotificationService to keep listening to push notifications.

But is that not a requirement you could do initialization on your MainActivity class