/// <summary>
/// Schedule a notification
/// </summary>
/// <param name="title">Title of the notification</param>
/// <param name="text">Content of the notification</param>
/// <param name="timeDelayFromNow">delay to display the notification, this delay will be added to current time</param>
/// <param name="smallIcon">name of the custom small icon from Mobile Notification Settings</param>
/// <param name="largeIcon">name of the custom large icon from Mobile Notification Settings</param>
/// <param name="customData">this data can be retrieved if the users opens app from notification</param>
GleyNotifications.SendNotification("Game Title", "Notification body", new System.TimeSpan(hours, minutes, seconds), "small_icon_name", "large_icon_name", "Optional message if app is opened from notification");
A step by step integration tutorial is available here:
Aside from what it seems as understanding of what was really needed as plugin I like the effort with details.
Will buy for sure.
Quick question tho; might be a good first question
So, just to be sure, when you say that Initialize() starts up notification channel and cancels all pending notifications, what is then the exact flow or setup that works best if I want to send 1 notification every 24h to the user (or by any similar repeating rule)?
Hello,
We have a complete implementation example in our test scene, but i will explain it to you for a better understanding.
If you schedule a notification in 24 hours, and your user enters in your app before, lets say 23:59 your user will be inside your app and you want to cancel all pending notifications because your user is already in your app, you do not want him to be notified that something happen in you app, a bonus is available, because he is inside your app and it will know.
And the implementation goes something like this:
private void OnApplicationFocus(bool focus)
{
if(focus == false)
{
//if user left your app schedule all your notifications
GleyNotifications.SendNotification("Game Title", "App was minimized", new System.TimeSpan(0, 1, 0), null, null, "Opened from Gley Minimized Notification");
}
else
{
//call initialize when user returns to your app to cancel all pending notifications
GleyNotifications.Initialize();
}
}
Hello,
Since our plugin is not a server side plugin you have to manually compute that time difference from DateTime.now and DateTime you want to send the notification and schedule the notification using that difference.
Hello,
I recently buy you plugin but it seems not working properly,
I downloaded your example app .apk it’s working with it but when I do in my project it’s not working (like there is something I should do but not mentionet anywhere)
I just open a new empty project and just added your plugin and build with your example scene = it’s not working
What am I missing ?
Here is Error code :
2020-03-04 17:06:01.890 ? E/Unity: AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='findResourceidInContextByName' signature='(Ljava/lang/Object;Landroid.app.Application;Lcom.unity3d.player.UnityPlayerActivity;)I' in class Lcom.unity.androidnotifications.UnityNotificationManagerOreo;
java.lang.NoSuchMethodError: no static method with name='findResourceidInContextByName' signature='(Ljava/lang/Object;Landroid.app.Application;Lcom.unity3d.player.UnityPlayerActivity;)I' in class Lcom.unity.androidnotifications.UnityNotificationManagerOreo;
at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:180)
at com.unity3d.player.UnityPlayer.nativeFocusChanged(Native Method)
at com.unity3d.player.UnityPlayer.a(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:177)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:201)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
at UnityEngine._AndroidJNIHelper.GetMethodID (System.
Bought your asset… question: on iOS, there is a setting for requesting authorization when the app starts… I don’t want that… how do I request authorization later?
Using BOLT I’ve noticed that when I set up a notification using a time from now unit (as opposed to the timespan unit) it only pushes the last one… is that by design or is that a bug?
I see that this is fixed in an update to the push asset in ver 1.1.2 by itself but I bought the Mobile Tools package… it says I have the latest version and this update is not there
Hello,
We will update mobile tools as well on Monday, and it should be live on asset store in a couple of days. If you need it sooner please write us at gley.assets@gmail.com send us your invoice number and we will send it to you sooner.
Thank you!
Thank you for updating Mobile Tools, that fixed the issue of only one push being scheduled, however, now all my notifications are doubled… two get pushed for every notification
Hello,
Please verify your code and make sure it doesn`t run twice.
If not, you can prepare a test project and send it to us at gley.asset@gmail.com to be able to reproduce your issue. Thank you!
Turns out on iOS if you have OnAppPause and OnAppQuit going to the same set of checks for what to push, it will come twice… I had to put an init/clear after quit and before the check to clear the pause push… works now… thank you for the update!