Agasper / unity-android-notifications

Unity3D Plugin for Android local notifications with example project
Other
555 stars 184 forks source link

Not working for me!!! #116

Closed hassanayoub85 closed 5 years ago

hassanayoub85 commented 5 years ago

I downloaded the project and built to android. When it run whatever button I press, nothing is happening.

EyalBira commented 5 years ago

I had the same issue - I guess it is due to the unity auto upgrade. In any case, when you open the demo project, open the "NotificationTest" scene. Then, select the "Canvas" object. In my case, the bottom component was missing the script reference. If that is the case for you as well, simply drag the "NotificationTest" SCRIPT into the missing component - that should do it. Cheers.

hassanayoub85 commented 5 years ago

You are right, i added the script and it works. However I noticed few things: 1- after clicking the 10 seconds repeating button, it actually take more than 10 seconds to show the notification, and each time the time is different. 2- when i hid the app (pressing home and keep running in the background), notifications keeps appearing, however, when i close the software from background, after few seconds it show an error message with close pp, when clicked no more things happened. and when restart the phone same behavior. Are you experiencing same results? and if yes, shouldn't the app keep working when cleared from background or restarting the phone?

EyalBira commented 5 years ago

I am actually experimenting with it now :) So:

1) It has to do with notifications limits in Android - see for example this thread: https://stackoverflow.com/questions/34585381/setrepeating-of-alarmmanager-repeats-after-1-minute-no-matter-what-the-time-is/34911555

2) I don't - it works as expected for me maybe it has something to do with your android version. In any case, they are using the standard android AlarmManager.setRepeating method (within the android code) so you might want to have a look on that

hassanayoub85 commented 5 years ago

I am using Android 8, and you?

EyalBira commented 5 years ago

9... but you should get the crash in the logcat, then you might find what is the issue

hassanayoub85 commented 5 years ago

I downloaded latest commit and rebuilt the plugin and it works thanks