Search Unity

[RELEASED] UTNotifications - Professional Cross Platform Push Notifications and More

Discussion in 'Assets and Asset Store' started by Yuriy-Ivanov, Jun 12, 2015.

  1. lucaslm

    lucaslm

    Joined:
    Aug 31, 2016
    Posts:
    5
    Hello yuriy-ivanov,

    Lately I've been trying to schedule local notifications on unity's OnApplicationPause (a MonoBehaviour method), so the messages don't get in the way of using the app, but are noticed nonetheless.
    I've used ScheduleNotification, and tested scheduling notifications with delays of 3, 10, 60 and 600 seconds, on samsumg devices with androids 4.3 and 5.0.1. Curiously, on android 4.3 only notifications with delays 10, 60 were shown, while on android 5.0.1 all the notifications, except for the 3 secs delayed, were shown.
    This leads to a very important question: Which is the minimum android version your plugin, on the latest version (1.6) claims to support? I've looked for this info both on the plugin's page and on the manual and did not find it.
    By the way, I'm using unity 5.4.1f1 Personal.

    Best Regards

    [Edit]: Now I also built my app for windows store and ran it on a Windows 10 tablet (through visual studios' remote debug tool), and none of the notifications showed up, even if I placed then on the Awake method. The weird part is that when I used Unity 5.4.0, notifications (scheduled or not) placed on the Awake method used to show up on windows. Now that I upgraded it to version 5.4.1, they don't seem to work at all.
     
    Last edited: Sep 22, 2016
  2. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi lucaslm,

    I tried scheduling notifications in OnApplicationPause - all notifications (for 3, 10, 60 and 600 seconds) are shown fine at both Android 5.1 (device) and Android 4.3 (emulator). Also, I tried building Windows 10 Universal Build with Unity 5.4.1f1, everything works fine with Windows 10 desktop (unfortunately we don't have any Windows 10 featured tablets to test with).

    Could you, please, at first tell if the issue with Windows 10 reproduced in your case on desktop Windows 10, or it is ARM version related issue?
    Also, please prepare and send to universal.tools.contact@gmail.com a sample project, reproducing the bug you have on Android, as I was unable to reproduce it.

    Best regards,
    Yuriy, Universal Tools team.
     
  3. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220

    Hi Yuriy,

    I updated to 1.6 but obtain this exception:

    ResolutionException: Cannot find candidate artifact for com.android.support:support-v4:24.2.0+
    Google.JarResolver.PlayServicesSupport.DependOn (System.String group, System.String artifact, System.String version)
    UTNotifications.UTNotificationsDependencies..cctor () (at Assets/UTNotifications/Editor/Android/UTNotificationsDependencies.cs:20)
    UnityEngine.Debug:LogException(Exception)
    UTNotifications.UTNotificationsDependencies:.cctor() (at Assets/UTNotifications/Editor/Android/UTNotificationsDependencies.cs:28)
    UnityEditor.EditorAssemblies:processInitializeOnLoadAttributes()


    I saw also that in Plugin/Android folder is missing the special version you sent in August that I was put inside. But now that "alert android" version is replaced with the 1.6 or not? Do you remember my Android problem?
    Thanks
     
    Last edited: Sep 23, 2016
  4. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Kafar,

    The error you get with version 1.6 states that you don't have latest version of Android Support Library installed in your Android SDK. Please open your Android SDK manager and install it.

    Don't worry that your special version of the UTNotifications native plugin is removed: UTNotifications 1.6 include the same feature out of box, you don't need that special build of the plugin anymore.

    Best regards,
    Yuriy, Universal Tools team.
     
    Kafar likes this.
  5. lucaslm

    lucaslm

    Joined:
    Aug 31, 2016
    Posts:
    5
    Hello yuriy-ivanov,

    I finally realized that the error lay in my code. For some Notifications (the ones not showing) I though I was calling the method ScheduleNotification, when instead I called ScheduleNotificationRepeating, but with a repeating interval of zero seconds. This might have caused some exception and prevented them to appear in some platforms, while others managed to just show it once. Either way, I am sorry for making you waste your time needlessly.
     
  6. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Many thanks, now I have another issue, I create a push from OneSignal including a url in Additional Content, when I receive a notification on iOS 10 (Android I don't tested yet) in background my app handle the notification but when I check the additional content it is null:

    if (m_notificationReceived.userData != null).....

    Why?

    Thanks
     
    Last edited: Sep 26, 2016
  7. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Kafar,

    Sorry for a late answer, it took us some time for research. OneSignal sends all the custom data arguments under its own "custom" node, and not just in the root node, as supposed by default with APNS. In order to support their format, you'll have to modify our code a little bit: in the file Assets/UTNotifications/Src/iOS/IOSManagerImpl.cs find method UserInfoToDictionaryOfStrings and modify it so it should look like:

    Code (CSharp):
    1.         private Dictionary<string, string> UserInfoToDictionaryOfStrings(IDictionary userInfo)
    2.         {
    3.             Dictionary<string, string> userData = new Dictionary<string, string>();
    4.             foreach (var key in userInfo.Keys)
    5.             {
    6.                 if (key is string)
    7.                 {
    8.                     object value = userInfo[key];
    9.                     if (value is string)
    10.                     {
    11.                         userData.Add((string)key, (string)value);
    12.                     }
    13.                 }
    14.  
    15.                 if (key == "custom" && userInfo[key] is Hashtable)
    16.                 {
    17.                     return UserInfoToDictionaryOfStrings(userInfo[key] as Hashtable);
    18.                 }
    19.             }
    20.  
    21.             return userData;
    22.         }
    That's it. I didn't try it with Android, but most likely OneSignal also stores custom data under "custom" node there. But with Android it's easier: you can configure Android/Windows Store messages format in the UTNotifications settings in Unity at Edit -> Project Settings -> UTNotifications -> Advanced -> Push Payload Format.

    Best regards,
    Yuriy, Universal Tools team.
     
  8. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Hi Yuriy,

    Thanks for your reply.
    I modified the method in your script but the result is the same, the userData property return null.
    This is my code in app:

    protected void OnNotificationClicked(ReceivedNotification notification)
    {
    if (notification.userData != null)
    {
    .. DO something
    }

    Another thing I don't understand is why with your previous version that code run correctly. What's changed?

    Many Thanks
     
  9. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Kafar,

    Try removing key =="custom" check from the code above. A bit better version of the same function:
    Code (CSharp):
    1.         private Dictionary<string, string> UserInfoToDictionaryOfStrings(IDictionary userInfo)
    2.         {
    3.             Dictionary<string, string> userData = new Dictionary<string, string>();
    4.             foreach (var key in userInfo.Keys)
    5.             {
    6.                 if (key is string)
    7.                 {
    8.                     object value = userInfo[key];
    9.                     if (value is string)
    10.                     {
    11.                         userData.Add((string)key, (string)value);
    12.                     }
    13.                     else if (userInfo[key] is IDictionary)
    14.                     {
    15.                         return UserInfoToDictionaryOfStrings(userInfo[key] as IDictionary);
    16.                     }
    17.                 }
    18.             }
    19.  
    20.             return userData;
    21.         }
    > Another thing I don't understand is why with your previous version that code run correctly. What's changed?
    We changed quite a lot in version 1.6, f.e. it could happen that userData you previously got was an empty dictionary, and now it's just null, and since you check it only for being null or not, it could make the difference.

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Sep 28, 2016
  10. traunay

    traunay

    Joined:
    Oct 24, 2013
    Posts:
    16
    Hi,
    Any idea when 1.7 going to be released? I'm trying to work on new project and google has pretty much told me to move to FCM instead GCM.

    I thought I'll wait until 1.7 is available rather than set things up all over again.

    Thank you
     
  11. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi traunay,

    Sorry, there is no estimation date yet.

    Best regards,
    Yuriy, Universal Tools team.
     
  12. traunay

    traunay

    Joined:
    Oct 24, 2013
    Posts:
    16
    Hi,
    I just purchased your tools and it's been great but I have one problem that I couldn't find how to fix from the manual

    As you can see from the attachment, there's a small icon overlaying my icon that only show up as a white rectangle. I was wondering how can I change that or at least hide it?

    Thank you
     
  13. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi traunay,

    I answered you by email, but just in case duplicating the same here:

    First, please check that you're using the latest version of UTNotifications: we removed Android 4.4 Compatibility Mode option from it as it's ignored by latest versions of Android. This option worked only on Android 5 devices and allowed using coloreful notification icons by setting targetSdkVersion to 20. Unfortunately, this option is incompatible with Facebook SDK and some others and doesn't work on Android 6+, so we got rid of it. You'll have to provide white+transparent only small notification icon for Android 5.0+. You can find more details in our manual (http://universal-tools.github.io/UTNotifications/Manual_1.6.pdf):

    There is a predefined profile “default”, which is used on Android when no notification profile is specified for a notification. It’s important to configure at least its Small Icon (Android 5.0+): Android, starting with a version 5.0, ignores any color information of small notification icons: the icons are considered to be completely white and only alpha channel of the icons is applied (so icons can be only white & transparent). So any nontransparent icons turn into just white squares when using as small notification icons.

    Small icon in the corner of notification is how notifications should look on Android 5+ when large and small notification icons differ (by Google's design). After you provide white+transparent icon, it will look better.

    Please let me know if you have any further questions, I'll be happy to help.

    Best regards,
    Yuriy, Universal Tools team.
     
  14. ParaLogic

    ParaLogic

    Joined:
    Aug 19, 2010
    Posts:
    177
    Hi Yuriy,

    I'm currently finalizing a project that uses UTNotifications to handle the push notifications. But I can't get them to work anymore since Google forced the use of Firebase to handle push notifications. Are you already working on Firebase support? Or does anyone have another way to get the notifications working?

    Thanks!
     
  15. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi ParaLogic,

    You still can use UTNotifications well, only thing that has to be changed is a way project is configured:
    1. Open Firebase Console: https://console.firebase.google.com/
    2. Create a new project.
    3. Press "Add Firebase to your Android app" button. Use the same bundle id you specified in Unity (no need to specify any Debug signing certificate SHA-1).
    4. Specify downloaded google-services.json in UTNotifications settings for GCM.
    5. Open the following page: https://console.firebase.google.com/project/_/settings/cloudmessaging.
    6. Choose a project you just created. Copy its Server key.
    7. Specify this key as a value for GOOGLE_PLAY_API_KEY constant in DemoServer (PushNotificator.java).

    That's it!

    We're currently preparing an update for a documentation and the asset's version of Play Services Resolver, which works well with latest versions of AndroidSDK, we're planning to submit it into Unity Asset Store on upcoming weekend.

    Best regards,
    Yuriy, Universal Tools team.
     
  16. ParaLogic

    ParaLogic

    Joined:
    Aug 19, 2010
    Posts:
    177
    Hi Yuriy,

    Thanks for your quick response!
    I've already tried it like you're suggesting (and just tried again), but initializing UTNotifications always returns false... Good to know though that it should be able to work, that gives me some hope that I'm just missing something here... Can't figure out what though.

    EDIT: just got this from the device log:
     
    Last edited: Oct 7, 2016
  17. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi ParaLogic,

    Thanks for a device log, it states that GCM library was not included in the project (which could happen because of Android SDK update related issue which we already fixed, but not yet released). Could you please send me a list of all files and folders in your Assets/Plugins/Android folder? I'll check what's missing and will tell you what to do with it.

    Thank you and best regards,
    Yuriy, Universal Tools team.
     
  18. ParaLogic

    ParaLogic

    Joined:
    Aug 19, 2010
    Posts:
    177
    Yeah that's what I thought... Didn't manage to get it included though, tried a lot of things, nothing worked so far.
    Here's a screenshot of my plugins folder. I believe those "play-services" files are from an older version of UTNotifications, tried building it with them on, off etc. I think I tried pretty much all possible combinations.

    I suspect it's because of the SDK update then. Would be great if you'd manage to submit the update that would fix it this weekend (I was planning to start beta-testing early next week).

    Thanks for your help!

     
  19. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi all,

    We've just submitted an update: version 1.6.1.

    Main changes:
    - Migration from Google Cloud Messaging (GCM) to Firebase Cloud Messaging (FCM)
    - Play Services Resolver has been updated to version 1.2.1.0 to support latest Android SDK

    Known issues:
    - May become incompatible with 3rd party plugins using outdated versions of Play Services Resolver - but it's required update, as older versions of the resolver are incompatible with latest Android SDKs.
    - Incompatible with Unity 5.0.x - 5.2.x. Works well with Unity 4.6.9-4.7.x and 5.3.0+.

    It's being reviewed by Unity, but if you'd like to have it now, please write us to universal.tools.contact@gmail.com, attaching your purchase receipt, we'll be glad to provide you an update in reply.

    P.S. You can find an updated manual here: http://universal-tools.github.io/UTNotifications/Manual_1.6.1.pdf.

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Oct 8, 2016
  20. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    I see several issues here: f.e. libraries versions mismatch may be an issue, google-play-services_lib should not be there. Please contact us by email universal.tools.contact@gmail.com to get UTNotifications 1.6.1, it could possibly resolve the issues automatically.

    Best regards,
    Yuriy, Universal Tools team.
     
  21. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220

    Ok Yuriy, the push are received now. But.... there is the next issue....

    I'm calling the https://onesignal.com/api/v1/notifications/ OneSignal REST API passing in the URL the notification ID I just received from OnNotificationClicked(ReceivedNotification notification) but the notification.id return 0 or 1 or 2 or 3 and so on... it not seems a real id notification but a progressive number.
    For this cause the API call return a huge exception because It not found the right URL.

    Can you help me?

    Thanks
     
  22. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Kafar,

    When UTNotifications are unable to find a notification id at a path, configured by you in the Advanced section of settings (data/id by default), it uses (again, by default) incrementing numbers as notification ids. So you'll need to specify a correct location of the notification id in the Advanced section of settings.

    Best regards,
    Yuriy, Universal Tools team.
     
  23. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Can how to know which is the OneSignal notifications path? I don't understand this...
    Thanks

    UPDATE: I contacted OneSignal but they not provided the payload format.
     
    Last edited: Oct 12, 2016
  24. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Kafar,

    I debugged the OneSignal messages format. Their notification ids are stored as data/google.message_id. But in their case it's a string, so you'll not be able to use it as UTNotifications ReceivedNotification.id (as we use int for notifications identification). But you can always read this google.message_id as a value in ReceivedNotification.userData dictionary, f.e.:
    Code (CSharp):
    1. protected void OnNotificationsReceived(IList<ReceivedNotification> receivedNotifications)
    2. {
    3.     string notificationId = receivedNotifications[0].userData["google.message_id"];
    4. }
    Best regards,
    Yuriy, Universal Tools team.
     
  25. Comtaler

    Comtaler

    Joined:
    Jul 8, 2015
    Posts:
    7
    From the Android log, UTNotification calls getClickedNotificationPacked every 0.5 sec non stop. Is it possible to stop it at some point when there is no need to check it?
     
  26. Comtaler

    Comtaler

    Joined:
    Jul 8, 2015
    Posts:
    7
    Another issue here. When I sent the following payload through FCM:
    Code (Javascript):
    1. { delay_while_idle: false,
    2.   data:
    3.    { id: 1,
    4.      title: 'My title message',
    5.      text: 'my text',
    6.      d: '{custom object}' },
    7.   registration_ids: [ 'my registraion id' ] }
    Android throws an exception:
    That is caused by the id in the data field. If I remove id from data, I don't see the exception.
     
  27. Comtaler

    Comtaler

    Joined:
    Jul 8, 2015
    Posts:
    7
    Yet another issue: If I send a push notification through Google Firebase console, I always receive two identical notifications on Android. On the adb log, there is no exception, but I don't receive the OnNotificationsReceived event. And when I click any one of them, I don't get the OnNotificationClicked event either.
     
  28. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Hello!

    I've been using UT Notifications for about a month, and I'm experiencing some issues.

    1. When Facebook Unity SDK (v7.8.0) is initialized and connected, I keep getting a lot of errors through ADB:

      getMethodID("universal.tools.notifications.Manager", "getClickedNotificationPacked", "()Ljava/lang/String;", static)
      10-19 19:09:10.412 18425 18456 D Unity : ! String Manager.getClickedNotificationPacked();
      10-19 19:09:10.412 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.412 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.412 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.412 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_FromReflectedMethod()
      10-19 19:09:10.412 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.413 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.413 18425 18456 D Unity : > AndroidJNI_CUSTOM_CallStaticStringMethod(00000652, aebdcfc8)
      10-19 19:09:10.413 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.413 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteGlobalRef()
      10-19 19:09:10.923 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewStringUTF()
      10-19 19:09:10.923 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.923 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewStringUTF()
      10-19 19:09:10.923 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.923 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_CallStaticObjectMethod(00200642, b06741d0
      10-19 19:09:10.923 18425 18456 D Unity : > , 0000063a
      10-19 19:09:10.923 18425 18456 D Unity : > , 00200005
      10-19 19:09:10.923 18425 18456 D Unity : > , 00100009
      10-19 19:09:10.923 18425 18456 D Unity : > , 00000001
      10-19 19:09:10.923 18425 18456 D Unity : > )
      10-19 19:09:10.923 18425 18456 D Unity : ? getMethodID("java.lang.Class", "forName", "(Ljava/lang/String;)Ljava/lang/Object;", static)
      10-19 19:09:10.923 18425 18456 D Unity : ! Class Class.forName(String);
      10-19 19:09:10.923 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_FromReflectedMethod()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewStringUTF()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.925 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_CallStaticObjectMethod(0000063a, 6fc22960
      10-19 19:09:10.925 18425 18456 D Unity : > , 00000005
      10-19 19:09:10.925 18425 18456 D Unity : > )
      10-19 19:09:10.926 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.926 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_GetObjectClass()
      10-19 19:09:10.926 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.926 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewGlobalRef()
      10-19 19:09:10.926 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewGlobalRef()
      10-19 19:09:10.926 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.926 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.928 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteLocalRef()
      10-19 19:09:10.928 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewGlobalRef()
      10-19 19:09:10.928 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteGlobalRef()
      10-19 19:09:10.928 18425 18456 D Unity : > AndroidJNI_CUSTOM_DeleteGlobalRef()
      10-19 19:09:10.928 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewStringUTF()
      10-19 19:09:10.928 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.928 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_NewStringUTF()
      10-19 19:09:10.929 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_ExceptionOccurred()
      10-19 19:09:10.929 18425 18456 D Unity : > AndroidJNI_CUSTOM_INTERNAL_CALL_CallStaticObjectMethod(00200642, b06741d0
      10-19 19:09:10.929 18425 18456 D Unity : > , 00200652
      10-19 19:09:10.929 18425 18456 D Unity : > , 00100005
      10-19 19:09:10.929 18425 18456 D Unity : > , 00200009
      10-19 19:09:10.929 18425 18456 D Unity : > , 00000001
      10-19 19:09:10.929 18425 18456 D Unity : > )

      I've red your previous post, but the workaround is not working for me: there's no AndroidFacebookGameObject.cs, nor files containing the suggested line (
      AndroidJNIHelper.debug = Debug.isDebugBuild;).

    2. Probably connected with the issue before, I got some strange behaviors, such as:
      - crashing system UI (OnePlusOne, default rom)
      - phone slowing down, no notifications received, occasionally background game crash and eventually phone reboot

      Those are happening both with Facebook SDK logged in or not.

    Please note that I'm using the latest version (1.6.11), but I had issues with previous as well.
    Thanks for your help, in case you need any further explanation just ask.
     
  29. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Comtaler,

    1. Could you please tell me, if you see the exception only in the logcat, or the application crashes? As we specially tested it with id converted to string, and everything worked fine, as we do:

    Code (JavaScript):
    1.             value = bundle.getInt(key, defaultValue);
    2.  
    3.             if (value == defaultValue) {
    4.                 try {
    5.                     String valueAsString = bundle.getString(key);
    6.                     value = Integer.parseInt(valueAsString);
    7.                 } catch (Throwable e) {}
    8.             }
    9.  
    2. FCM supports two types of messages: notification and data. notification messages are to restrictive in functionality to implement all of the features our asset supports, that's why only data notifications work properly. Unfortunately, Firebase Console currently allows you sending only notification messages, which are not supported. You'll have to use your own server for sending push notifications.

    Best regards,
    Yuriy, Universal Tools team.
     
  30. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Menion-Leah,

    1. This is not any sort of error or issue: Facebook SDK just turns on JNI debugging, which causes every call to a native plugin to be logged the way you showed above, when building with develpment option turned on. These messages can be safely ignored.

    2. This is not alright and not anything known to us. Could you please provide some more information? Is only single device affected, or does it happen with other Android devices as well? Are there any stacktraces available? What are the steps to reproduce it? Could you, please, send us to universal.tools.contact@gmail.com a sample Unity project, which reproduces the issue?

    Thank you in advance,
    Yuriy, Universal Tools team.
     
  31. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Thank you Yuriy for you quick response!

    1. Good to know. Is there any way to avoid it while mantaining Development Build checked?
    2. The device that is heavily affected (slowing down, crashing and phone reboot) is a Motorola MotoG, 2013 edition, Pacman Custom ROM. Unfortunately, it's not one of my test devices, and so right now I have no access to its logs. I'm gonna chase the owner to get them.
      Regarding the OnePlus One, I'll try to narrow down the issue but it occurs randomly: system stops showing any incoming notifications (system/other apps as well).. it just vibrate upon receiving, displaying nothing. After a while (minutes), UI crashes and restart, showing notifications again. I do not exclude it could be due to a recent system update, but it started acting that way just after I introduced UT Notifications.
     
  32. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi Menion-Leah,

    Yes, just find where FacebookSDK turns on AndroidJNIHelper.debug and comment/remove it.

    I'll be waiting for any additional details then, currently I don't know any way to reproduce it and even have no clue what could cause that sort of behaviour.

    Thank you in advance,
    Yuriy, Universal Tools team.
     
  33. game_hero

    game_hero

    Joined:
    Nov 6, 2015
    Posts:
    2
    Hi !

    Scheduled notifications are not working properly (disappear) if the app is closed from recent apps.

    Any solution for it?

    Thanks in advance.
     
  34. Fliker

    Fliker

    Joined:
    Apr 25, 2013
    Posts:
    2
  35. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @game_hero,

    Unfortunately, many Android device vendors force-stop the app when swiping it away in the list of recent apps to save power. As result, no app's code can run after that before you restart the app manually. See also: http://stackoverflow.com/a/20838611. Note, that after doing Application.Quit(), both scheduled and push notifications are delivered fine.

    Best regards,
    Yuriy, Universal Tools team.
     
  36. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @Fliker,

    Yes, it's a known issue with latest versions of Unity and XCode. We're currently researching it to find an automated solution. Now, you may have to do the following:
    1. Build a project in Unity for iOS on a local machine. Open it in XCode and enable Push Notifications in the project settings.
    2. Close the project and add it to your version control system (git, svn, mercurial, ...).
    3. Configure the Jenkins build script to build into the same folder, where XCode project is stored. I don't remember the Unity project building API, but there definitely is an option to update an existing XCode project instead of overwriting it. It will keep the Push Notifications option turned on.

    Sorry for that inconvenience, we're going to update the asset as soon as better (automated) solution is found and implemented.

    Best regards,
    Yuriy, Universal Tools team.
     
  37. nerddoc001

    nerddoc001

    Joined:
    Nov 11, 2016
    Posts:
    24
    Hi,

    I'm planning to use a push notification service to my Unity Android Chat APP
    I want to ask you, is UTNotifications able to solve conditional Notification?

    let's say my app will have 3 state:
    1. when app is on background
    2. when app is killed
    3. when app is active / foreground

    so basically it is a chat app, and I want to use UTNotifications to send the message real time, so user can do a real time chat.

    So when my app receive a message, i dont want to show the notification directly, but do check for the condition first

    1. when the app is on background, show the notification
    2. when the app is killed, show the notification
    3. when the app is in foreground, check 1st, if the current page is the chat room with the sender, don't show the notification, but add the message to a new chat bubble,
    BUT if the current page is NOT in the correct chat room, (let's say in home) then show the notification
    yes the above scenario is just like how Whatsapp handle the incoming message.

    Thanks!
     
  38. game_hero

    game_hero

    Joined:
    Nov 6, 2015
    Posts:
    2
    Hi, we are using UTNotification for our games, but we have a problem with local notifications in IOS.
    The Notifications are not shown.
    Is there any special configuration needed in xcode? or impor some framework?
    Thanks for reply.
     
  39. FatIgor

    FatIgor

    Joined:
    Sep 13, 2015
    Posts:
    29
    Hi.

    Is there a specific version of support-v4 that I should be using?
    When installed into a test project, with only UTNotifications in it, it tries using
    support-24.0.0-alpha2
    but then tells me this is no good and offers to replace it with support-24.0.0-alpha2

    I've tried putting in support-23.0.0 but it objects to that as well.
     
  40. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi nerddoc001,

    Sorry for a late response (fastest way to contact us is email universal.tools.contact@gmail.com).

    Regarding your questions:
    We provide an option to show notifications always or only when app is closed or running in background. Also, you can handle any incoming notifications as you like when an app is running, even when showing notification only when closed or in background is chosen (see UTNotifications.Manager.OnNotificationsReceived). Also, on Android and Windows Store platforms you can modify the native plugins, which source code is provided, to show system notification on any application specific condition. Unfortunately, it's currently not possible with iOS.

    Best regards,
    Yuriy, Universal Tools team.
     
  41. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi game_hero,

    In a currently released version of UTNotifications on iOS you have to manually enable Push Notifications option in the Xcode project settings, but it's required for push notifications only, everything should be fine with local notifications. Did you minimize an app when receiving a notification (as iOS never shows notifications when an app is running in foreground).

    Please tell more if it doesn't help: does it happen with SampleScene? With scheduled local notifications? With push notifications?

    Thanks and best regards,
    Yuriy, Universal Tools team.
     
  42. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi FatIgor,

    This warning message is known and can be safely ignored - the latest versions of Google's own Android Support library and Google Play Services are completely compatible, Google just hasn't yet updated appropriate version checks.

    Best regards,
    Yuriy, Universal Tools team.
     
  43. FatIgor

    FatIgor

    Joined:
    Sep 13, 2015
    Posts:
    29
    Hi.
    I'm getting some progress with this, but SendRegistrationId does not seem to be getting triggered.
    I have set up my application with firebase, and loaded up the json file ok, I have ticked in the UT options to receive push notifications, and the initialize call is returning true.
    Plus if I send a general broadcast message from the firebase console, I receive a notification, and when app is actually open I get the OnNotificationReceived, and if I click the notification, I get the OnNotificationClicked.
    If app is closed, clicking the notification opens the app, but does not trigger anything. Although I may have missed something, not actually been looking at that yet.

    Anyway, as I said SendRegistrationID does not seem to be getting called. As I read the docs, it should be getting called as part of the Instance.Initialize process.

    Here is my code.
    Code (CSharp):
    1.     // Use this for initialization
    2.     public void StartNotifications()
    3.     {
    4.         Debug.Log("StartNotifications");
    5.         Manager notificationsManager = Manager.Instance;
    6.  
    7.         notificationsManager.OnSendRegistrationId += SendRegistrationId;
    8.         notificationsManager.OnNotificationClicked += OnNotificationClicked;
    9.         notificationsManager.OnNotificationsReceived += OnNotificationsReceived;    //Let's handle incoming notifications (not only push ones)
    10.  
    11.         Initialize();
    12.     }
    13.  
    14.     void Initialize()
    15.     {
    16.         Debug.Log("Initialize");
    17.         Manager notificationsManager = Manager.Instance;
    18.         bool result = notificationsManager.Initialize(true, 0, false);
    19.         //bool result = notificationsManager.Initialize(false);
    20.         Debug.Log("UTNotifications Initialize: " + result);
    21.  
    22.         m_notificationsEnabled = notificationsManager.NotificationsEnabled();
    23.         notificationsManager.SetBadge(0);
    24.     }
    25.  
    26.     /// <summary>
    27.     /// A wrapper for the <c>SendRegistrationId(string userId, string providerName, string registrationId)</c> coroutine
    28.     /// </summary>
    29.     protected void SendRegistrationId(string providerName, string registrationId)
    30.     {
    31.         Debug.Log("SendRegistrationId");
    32.         string userId = GenerateDeviceUniqueIdentifier();
    33.         networkCode.SendRegistrationId(userId, providerName, registrationId);
    34.     }
    35.  
    PS
    This is Android I'm talking about, I'll worry about iOS when I get this going.
     
  44. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi FatIgor,

    The code you posted looks correct (please just note, that SendRegistrationId may invoked some time after calling Manager.Initialize - as it may require network operations, if an old registrationId is expired or has never been retrieved). Do you experience the same sort of issues with our UTNotificationsSample scene provided? Please try and inform me about results.

    Regarding the issues with Firebase Console - sent notifications handling, it's a known problem: in FCM there are 2 kinds of notifications: data notifications, or just notifications. When using FCM Console, you can only send just simple notifications, which are handled by Android itself instead of an app. They are too restrictive to implement any advanced notification features and so we don't support them - you'll have to send push notifications from your server instead of Firebase Console.

    Best regards,
    Yuriy, Universal Tools team.
     
  45. FatIgor

    FatIgor

    Joined:
    Sep 13, 2015
    Posts:
    29
    I really don't know what was happening with this.
    I had an object called UTNotificationManager in my project scene, and the same in my test project scene.
    I tried creating another test project, with just UTNotifications, and this did not add that object to the scene.
    Having deleted the UTNotificationManager object from the scene, SendRegistrationID is now getting triggered.

    The deleted object was an empty object, with the attached script ManagerImpl. I didn't create the object, so I'm not sure where it has come from.

    Anyway, now that I'm getting a device id with any luck I'll be able to get the people doing our server to send me a notification.
     
  46. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    can i send automatic message, througth UTNotifications, for Android and Ios?
     
  47. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi gringofxs,

    Could you please explain your question in some more details? What is the exact behavior you're seeking for?

    Thank you,
    Best regards,
    Yuriy, Universal Tools team.
     
  48. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    I need a geofence, that can be send message, then trigger automatic when the app enter the specific region. For IOS and Android
     
  49. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi gringofxs,

    Unfortunately geofence-based notifications are not supported.

    Best regards,
    Yuriy, Universal Tools team.
     
  50. Martin_k

    Martin_k

    Joined:
    Feb 19, 2015
    Posts:
    6
    Hi,
    1. Is it possible to set ticker to android sheduled local notification.
    There is only title and message.
    2. How can I make a bahaviour, that when I press notification, it cleans up ?