universal-tools / UTNotificationsFeedback

7 stars 0 forks source link

push notificatio not working when application closed (there is no service running) unity-android #20

Closed mirsabayuSompret closed 8 years ago

mirsabayuSompret commented 8 years ago

please help.

ASAP

yuriy-universal-ivanov commented 8 years ago

Hi mirsabayuSompret,

There are two ways of application being closed in Android:

  1. No activity is shown.
  2. Application is forced stopped or has never been run.

When you just close application with Application.Quit, or just swipe an app from the list of recents (on most Android firmwares) it is not being forced stopped and push notifications can be received.

But when a user stopped an app in the Android system settings, or used one of app cleaning programs for Android, which are designed to stopping applications forcefully, push notifications can not be received and you can't do anything with it: it is a designed by Google behaviour. For more details see: http://stackoverflow.com/questions/20838415/gcm-push-notification-works-after-app-force-stop.

Best regards, Yuriy, Universal Tools team.

yuriy-universal-ivanov commented 8 years ago

@mirsabayuSompret May I mark an issue as closed?

mirsabayuSompret commented 8 years ago

yup. thx for the quick response yuriy. really appreciated it :).

but as i know that unity app doesn't have a run in background functionality when we run it in android. (because it was running as an activity - need to have it's own service) my reference for the problem : http://forum.unity3d.com/threads/android-application-run-in-background-always.266999/

so because of that behavior, am i have to write a service like they suggested above?? or it is already handled by UTNotification??

if it's possible can i have an example project for this kind of issue as i experienced that the out of box example is not working with run-in-background app (when i close the app or when i first start the phone)

yuriy-universal-ivanov commented 8 years ago

Hi mirsabayuSompret,

I've just checked it: neither Application.Quit nor swiping an app from recents prevents notifications to be shown on my device: both local and push notifications are successfully delivered (even the device reboot doesn't prevent it). It's Android 5. I tried it previously with Android 4.4, everything worked well too when an app was closed.

Could you please tell me:

  1. Are notifications successfully delivered when an app is just minimized (by pressing a home button)?
  2. On which devices have you tested it? Please tell me the devices models and Android versions installed.
mirsabayuSompret commented 8 years ago

halo yuriy,

thx for the checking, yup,

for point :

  1. yes, it worked in both device (the app still shown on the recent app page) 2 before i try that on asus zenfone. http://www.gsmarena.com/asus_zenfone_2_ze551ml-6917.php ( with lolipop 5.0)

and it's not working. but after i try that on samsung galaxy mega : http://www.gsmarena.com/samsung_galaxy_mega_2-6482.php ( android version 4.4.4).

it's works well. so it thinks maybe it's because of the os or the device. (maybe some device just force close the application when we appeared to close that in the recent app tab)

yuriy-universal-ivanov commented 8 years ago

Hi mirsabayuSompret,

It seems to be ASUS zenfone related issue and it happens with all other applications as well: http://www.asus.com/zentalk/forum.php?mod=viewthread&tid=11905&extra=&page=1