universal-tools / UTNotificationsFeedback

7 stars 0 forks source link

notification profile first one work only #56

Closed ate864 closed 6 years ago

ate864 commented 7 years ago

Hello, i created 5 profiles (just with custom sound .wav file) but when i send a notification (i set up a php serveur notification sender, with profile parameter selectable ) only the sound of first profile in utnotification settings window work. i try to set each of them in top list and they all work if they are in top, but not in other position... what i'm missing? (also, no fall back on the defaut profile when they don't work) I only try on android for now... Thank you!

yuriy-universal-ivanov commented 7 years ago

Hi @ate864 ,

First of all, thank you for using UTNotifications!

I just checked the scenario you've described: everything works well, appropriate sounds are played regardless of the profiles order. If incorrect profile is specified, "default" profile is always chosen. It all works well with both local and push notifications, so I couldn't reproduce any of your issues.

Could you please post here or send us to universal.tools.contact@gmail.com the contents of Assets/UTNotifications/Resources/UTNotificationsSettings.asset and a list of files in Assets/Plugins/Android/UTNotificationsRes/res/raw?

Please also send the complete json payloads of FCM messages you're sending.

Best regards, Yuriy, Universal Tools team.

ate864 commented 7 years ago

hi ! Thank you for your help. For information i try on another device and all works as expected... so the problem is more a compatibility problem (android version?, tablet? phone?)

Problem on : samsung galaxy tab A - android 5.1.1 samsung galaxy tab 4 - android 4.4.4

ok with phone honor 5c - android 7.0

I will try on other devices...

yuriy-universal-ivanov commented 7 years ago

Hi @ate864 ,

Thank you for the details provided.

Could you please create a sample Unity project reproducing that issue, and send it us to universal.tools.contact@gmail.com, so we could research it? Please also send the exact FCM message payload you're sending.

Unfortunately we don't have any Galaxy Tab tablets available to test with, but we could do some more testing in order to figure out what's going on.

Best regards, Yuriy, Universal Tools team.

yuriy-universal-ivanov commented 7 years ago

Hi @ate864 , Is it still an issue or were you able to solve it?

ate864 commented 7 years ago

Hi ! I don't work on this now.... and we published our app with the problem :) we didn't have time to look at this... and this is not realy a big problem.

AlexRudenko50 commented 6 years ago

Hi, I am Alex, an user of the asset named "UTNotifications - Professional Local & Push Notification Plugin" When I closed my app, is it possible to know the received notification on my android device? I have tested it on my devices several times, but I couldn't know about received notification when my app closed. Looking forward to your reply Best Alex

yuriy-universal-ivanov commented 6 years ago

@AlexRudenko50 , Hi Alex, I replied you be email: No C# code can be called in Unity when the app is closed, so no, it's impossible. In the same time, UTNotifications gather all the received notifications while the app was not running and send them in a bunch to OnNotificationsReceived event when initializing UTNotifications.Manager next time your app starts (please note, that you'll have to subscribe to this event before calling Initialize to be able to handle these notifications).

Best regards, Yuriy, Universal Tools team.

AlexRudenko50 commented 6 years ago

Thanks for your reply. Your info is very helpful for my work. If I have to set the badge when app closed, what I have to do? I want to set badge to show the count of received notifications when app was closed. I saw the Manager.Instance.SetBadge function in the c# code that you provided and I tested it when app opened.

is it possible to set the badge when app was closed ?

I will thanks if you can teach me about it

Thanks

Regards

Alex

On Sat, Nov 18, 2017 at 11:55 AM, yuriy-universal-ivanov < notifications@github.com> wrote:

@AlexRudenko50 https://github.com/alexrudenko50 , Hi Alex, I replied you be email: No C# code can be called in Unity when the app is closed, so no, it's impossible. In the same time, UTNotifications gather all the received notifications while the app was not running and send them in a bunch to OnNotificationsReceived event when initializing UTNotifications.Manager next time your app starts (please note, that you'll have to subscribe to this event before calling Initialize to be able to handle these notifications).

Best regards, Yuriy, Universal Tools team.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/universal-tools/UTNotificationsFeedback/issues/56#issuecomment-345466951, or mute the thread https://github.com/notifications/unsubscribe-auth/AY74cbONf9wpij12x9h0JNmp3X_PZfb8ks5s3zYogaJpZM4NZIRE .

AlexRudenko50 commented 6 years ago

And you wrote me like followed

UTNotifications gather all the received notifications while the app was not running and send them in a bunch to OnNotificationsReceived event when initializing UTNotifications.Manager next time your app starts (please note, that you'll have to subscribe to this event before calling Initialize to be able to handle these notifications).

It means that the code must be written like below

Manager notificationsManager = Manager.Instance;

        notificationsManager.OnSendRegistrationId += onTokenReceived;

        notificationsManager.OnNotificationClicked +=

OnNotificationClicked;

        notificationsManager.OnNotificationsReceived +=

OnNotificationsReceived; //Let's handle incoming notifications (not only push ones)

        Initialize();

Yes. I have wrote it as you mentioned.

But when my app launching, OnNotificationsReceived is not called and I can not get received notifications during app is not running.

I will thanks if you can inform me about it

Thanks

Alex

On Sun, Nov 19, 2017 at 2:46 AM, Alex Rudenko alexmobileapps50@gmail.com wrote:

Thanks for your reply. Your info is very helpful for my work. If I have to set the badge when app closed, what I have to do? I want to set badge to show the count of received notifications when app was closed. I saw the Manager.Instance.SetBadge function in the c# code that you provided and I tested it when app opened.

is it possible to set the badge when app was closed ?

I will thanks if you can teach me about it

Thanks

Regards

Alex

On Sat, Nov 18, 2017 at 11:55 AM, yuriy-universal-ivanov < notifications@github.com> wrote:

@AlexRudenko50 https://github.com/alexrudenko50 , Hi Alex, I replied you be email: No C# code can be called in Unity when the app is closed, so no, it's impossible. In the same time, UTNotifications gather all the received notifications while the app was not running and send them in a bunch to OnNotificationsReceived event when initializing UTNotifications.Manager next time your app starts (please note, that you'll have to subscribe to this event before calling Initialize to be able to handle these notifications).

Best regards, Yuriy, Universal Tools team.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/universal-tools/UTNotificationsFeedback/issues/56#issuecomment-345466951, or mute the thread https://github.com/notifications/unsubscribe-auth/AY74cbONf9wpij12x9h0JNmp3X_PZfb8ks5s3zYogaJpZM4NZIRE .

yuriy-universal-ivanov commented 6 years ago

Hi @AlexRudenko50,

First, about badges. You have 2 options basically:

  1. Choose a badge number in advance, when scheduling a local notification. Most likely, 1 will do as just an indication that there is something unread.
  2. Instead of using scheduled notifications, send push notifications from your server. Then the server is responsible for counting unread events, and every time you start an app, you'd inform your server to clear that list for this specific user. It's much more complicated way. It's very unfortunate that there is no simpler way to achieve what you'd like on iOS. See also https://stackoverflow.com/questions/31538995/will-ios-increment-a-push-notfication-badge-number for more details.

Now, regarding OnNotificationsReceived. Please note, that first of all, it's impossible on iOS, as mentioned in the documentation:

iOS doesn't provide a list of all notifications shown when an app wasn't running in foreground. This list will contain only a notification, which was clicked and all notifications shown when an app is running in foreground. On other platforms, you'll receive a list of all shown notifications.

Second, please don't forget to specify that you're going to listen for received notifications in the first argument of UTNotifications.Manager.Instance.Initialize.

Best regards, Yuriy, Universal Tools team.

AlexRudenko50 commented 6 years ago

Thanks for your reply. I have read all your info carefully and understood all things. but the strange things is just that I can not get all received notifications list on android. I didn't forget to add the UTNotifications.Manager.Instance.Initialize http://universal-tools.github.io/UTNotifications/html_1.6.1/class_u_t_notifications_1_1_manager.html#a28a9bf7ff17111ac92be35c2d34395a8 function and parameter.

public static void Initialize() { Manager notificationsManager = Manager.Instance; bool result = notificationsManager.Initialize(true, 0, true); Debug.Log("UTNotifications Initialize: " + result);

        m_notificationsEnabled =

notificationsManager.NotificationsEnabled(); notificationsManager.SetBadge(0); }

I have tested it on several android devices, but I can not get the received notification list when app is started.

Looking forward to your reply. Best Alex

On Sun, Nov 19, 2017 at 2:51 PM, yuriy-universal-ivanov < notifications@github.com> wrote:

Hi @AlexRudenko50 https://github.com/alexrudenko50,

First, about badges. You have 2 options basically:

  1. Choose a badge number in advance, when scheduling a local notification. Most likely, 1 will do as just an indication that there is something unread.
  2. Instead of using scheduled notifications, send push notifications from your server. Then the server is responsible for counting unread events, and every time you start an app, you'd inform your server to clear that list for this specific user. It's much more complicated way. It's very unfortunate that there is no simpler way to achieve what you'd like on iOS.

Now, regarding OnNotificationsReceived. Please note, that first of all, it's impossible on iOS, as mentioned in the documentation http://universal-tools.github.io/UTNotifications/html_1.6.1/class_u_t_notifications_1_1_manager.html#aff9bd679b8602eded21c9624469dd17a :

iOS doesn't provide a list of all notifications shown when an app wasn't running in foreground. This list will contain only a notification, which was clicked and all notifications shown when an app is running in foreground. On other platforms, you'll receive a list of all shown notifications.

Second, please don't forget to specify that you're going to listen for received notifications in the first argument of UTNotifications.Manager. Instance.Initialize http://universal-tools.github.io/UTNotifications/html_1.6.1/class_u_t_notifications_1_1_manager.html#a28a9bf7ff17111ac92be35c2d34395a8 .

Best regards, Yuriy, Universal Tools team.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/universal-tools/UTNotificationsFeedback/issues/56#issuecomment-345557020, or mute the thread https://github.com/notifications/unsubscribe-auth/AY74cYh3gWM1WOVd0zWKX_Suc-Yut-x-ks5s4LEEgaJpZM4NZIRE .

AlexRudenko50 commented 6 years ago

The problem is that the OnNotificationsReceived function is not called after initialize.

On Sun, Nov 19, 2017 at 9:41 PM, Alex Rudenko alexmobileapps50@gmail.com wrote:

Thanks for your reply. I have read all your info carefully and understood all things. but the strange things is just that I can not get all received notifications list on android. I didn't forget to add the UTNotifications.Manager.Instance.Initialize http://universal-tools.github.io/UTNotifications/html_1.6.1/class_u_t_notifications_1_1_manager.html#a28a9bf7ff17111ac92be35c2d34395a8 function and parameter.

public static void Initialize() { Manager notificationsManager = Manager.Instance; bool result = notificationsManager.Initialize(true, 0, true); Debug.Log("UTNotifications Initialize: " + result);

        m_notificationsEnabled = notificationsManager.

NotificationsEnabled(); notificationsManager.SetBadge(0); }

I have tested it on several android devices, but I can not get the received notification list when app is started.

Looking forward to your reply. Best Alex

On Sun, Nov 19, 2017 at 2:51 PM, yuriy-universal-ivanov < notifications@github.com> wrote:

Hi @AlexRudenko50 https://github.com/alexrudenko50,

First, about badges. You have 2 options basically:

  1. Choose a badge number in advance, when scheduling a local notification. Most likely, 1 will do as just an indication that there is something unread.
  2. Instead of using scheduled notifications, send push notifications from your server. Then the server is responsible for counting unread events, and every time you start an app, you'd inform your server to clear that list for this specific user. It's much more complicated way. It's very unfortunate that there is no simpler way to achieve what you'd like on iOS.

Now, regarding OnNotificationsReceived. Please note, that first of all, it's impossible on iOS, as mentioned in the documentation http://universal-tools.github.io/UTNotifications/html_1.6.1/class_u_t_notifications_1_1_manager.html#aff9bd679b8602eded21c9624469dd17a :

iOS doesn't provide a list of all notifications shown when an app wasn't running in foreground. This list will contain only a notification, which was clicked and all notifications shown when an app is running in foreground. On other platforms, you'll receive a list of all shown notifications.

Second, please don't forget to specify that you're going to listen for received notifications in the first argument of UTNotifications.Manager.Instance.Initialize http://universal-tools.github.io/UTNotifications/html_1.6.1/class_u_t_notifications_1_1_manager.html#a28a9bf7ff17111ac92be35c2d34395a8 .

Best regards, Yuriy, Universal Tools team.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/universal-tools/UTNotificationsFeedback/issues/56#issuecomment-345557020, or mute the thread https://github.com/notifications/unsubscribe-auth/AY74cYh3gWM1WOVd0zWKX_Suc-Yut-x-ks5s4LEEgaJpZM4NZIRE .

yuriy-universal-ivanov commented 6 years ago

@AlexRudenko50 ,

Just checked with UTNotifications 1.6.3: all received notifications while the app is closed are listed in OnNotificationsReceived on Android (f.e. 5.1). Could you please send us to universal.tools.contact@gmail.com a sample application reproducing the issue with exact steps to reproduce it?

Thanks.

Best regards, Yuriy, Universal Tools team.