Search Unity

Official Mobile Notification Package

Discussion in 'Android' started by _Paulius, Jan 28, 2019.

  1. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    165
    1.1.0 doesn't work with the latest Jar Resolver ("ExternalDependencyManager"). I get class duplicate errors.
    Simply switching to 1.0.3 gets rid of the error.
     
  2. luvjungle

    luvjungle

    Joined:
    Dec 18, 2017
    Posts:
    59
    Please tell me how to do it.
    Is it supposed to be unity bug report? Or package bug report?
     
  3. cg-adam

    cg-adam

    Joined:
    Jul 30, 2019
    Posts:
    44
    We are having issues building the latest 1.1.0 version when the gradle build system is enabled on Android and we also have the PlayServicesResolver system in place. It cannot build the plugin, previous versions work fine before the plugin refactor. Cannot send up a copy of the project to a bug report right now
     
  4. cg-adam

    cg-adam

    Joined:
    Jul 30, 2019
    Posts:
    44
    Is there a way to get the notifications to auto dismiss? I have checked through the code and it is available inside the Android implementation, but not exposed up into the IGameNotification interface so we can never assign it as true.
     
  5. Deleted User

    Deleted User

    Guest

    Could you please report a bug then we can have a look? Thanks.
     
  6. Deleted User

    Deleted User

    Guest

    Unity bug report please.
     
  7. rehanazhar87

    rehanazhar87

    Joined:
    May 31, 2017
    Posts:
    4
    Hi, i'm using below class for local notification handling. Its working fine on Android but on iOS when i open App through local notification then notification click mehtod not firing. It doesn't give the notification object on which i click. here is my code which i'm using. Can you please tell what i'm doing wrong for iOS
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using AssemblyCSharp;
    5. using GTP;
    6. using System;
    7. #if UNITY_ANDROID
    8. using Unity.Notifications.Android;
    9. #elif UNITY_IOS
    10. using Unity.Notifications.iOS;
    11. using UnityEngine.iOS;
    12. #endif
    13. using Facebook.MiniJSON;
    14.  
    15.  
    16. public class NotificationHandler : MonoBehaviour
    17. {
    18. #region LifeCycle Methods
    19.  
    20.     public static DateTime? _today = null;
    21.  
    22.     private static string channelId = "GTP";
    23.  
    24.  
    25.     private void Awake()
    26.     {
    27. #if UNITY_IOS
    28.         StartCoroutine(RequestAuthorization());
    29. #endif
    30.         RegisterNotifications();
    31.     }
    32.  
    33.     void Start()
    34.     {
    35.         _today = TimeController.instace.currTime;
    36. #if UNITY_ANDROID
    37.         AndroidNotificationCenter.OnNotificationReceived += handleNotificationClick;
    38.         var notificationIntentData = AndroidNotificationCenter.GetLastNotificationIntent();
    39.         if (notificationIntentData != null)
    40.         {
    41.             handleNotificationClick(notificationIntentData);
    42.         }
    43. #elif UNITY_IOS
    44.         iOSNotificationCenter.OnNotificationReceived += handleNotificationClick;
    45.         var notif = iOSNotificationCenter.GetLastRespondedNotification();
    46.         if ( notif != null) {
    47.             handleNotificationClick(notif);
    48.         }
    49. #endif
    50.         CancelPreviousNotifications();
    51.     }
    52.  
    53.     // Update is called once per frame
    54.     void Update()
    55.     {
    56.  
    57.     }
    58.  
    59.     void OnApplicationPause(bool isPause)
    60.     {
    61.         if (isPause) // App going to background
    62.         {
    63.             CancelPreviousNotifications();
    64.             NotificationHandler.scheduleNotifications();
    65.         }
    66.     }
    67.  
    68.  
    69.     #endregion
    70.  
    71.     #region Other Methods
    72.  
    73.     IEnumerator RequestAuthorization()
    74.     {
    75.         using (var req = new AuthorizationRequest(AuthorizationOption.Alert | AuthorizationOption.Badge, true))
    76.         {
    77.             while (!req.IsFinished)
    78.             {
    79.                 yield return null;
    80.             };
    81.  
    82.             string res = "\n RequestAuthorization: \n";
    83.             res += "\n finished: " + req.IsFinished;
    84.             res += "\n granted :  " + req.Granted;
    85.             res += "\n error:  " + req.Error;
    86.             res += "\n deviceToken:  " + req.DeviceToken;
    87.             Debug.Log(res);
    88.         }
    89.     }
    90. #if UNITY_ANDROID
    91.     private void handleNotificationClick( AndroidNotificationIntentData intentData) {
    92.         var id = intentData.Id.ToString();
    93.         var title = intentData.Notification.Title;
    94.         //var dic = notificationIntentData.data;
    95.        var channel = intentData.Channel;
    96.         var notification = intentData.Notification.IntentData;
    97.         Dictionary<string, object> dic = (Dictionary<string, object>)Json.Deserialize(notification);
    98.         handleNotification(dic);
    99.     }
    100. #elif UNITY_IOS
    101.         private void handleNotificationClick(iOSNotification notif)
    102.     {
    103.         GTPAlert.showAlertWith("", "handleNotifType-" + notif.Identifier, "ok", "", null, null);
    104.         handleNotifType(notif.Data);
    105.     }
    106.  
    107. #endif
    108.  
    109.     private void handleNotifType( string notifType ) {
    110.         GTPAlert.showAlertWith("", "handleNotifType-" + notifType, "ok", "", null, null);
    111.         if (notifType != "")
    112.         {
    113.             AppMacros.NotifType type = (AppMacros.NotifType)Convert.ToInt32(notifType);
    114.             if (type == AppMacros.NotifType.ComeBack)
    115.             {
    116.                 GameStateManager.Instance.addCoins(AppMacros.FREE_STRUCK_COINS);
    117.             }
    118.             else if (type == AppMacros.NotifType.CoinWallet)
    119.             {
    120.                 GameStateManager.Instance.freeAdCount = AppMacros.FREE_COIN_WALLET;
    121.                 Invoke("showCoinWalletWithDelay", 1.0f);
    122.             }
    123.             AnalyticsManager.instance.LogOpenFromNotification(notifType);
    124.         }
    125.     }
    126.     private void handleNotification( Dictionary<string, object> dic) {
    127.         if (dic.ContainsKey("data"))
    128.         {
    129.             var notifType = dic["data"].ToString();
    130.             handleNotifType(notifType);
    131.         }
    132.     }
    133.  
    134.     private void showCoinWalletWithDelay() {
    135.         GameScene.instance.teasureBoxButtonClicked();
    136.     }
    137.  
    138. #endregion
    139.  
    140. #region schedule Notification Methods
    141.  
    142.     public static void scheduleNotifications() {
    143.    
    144.         if (_today != null)
    145.         {
    146.             var today = _today.Value;
    147.             TimeSpan time = today - DateTime.Now;
    148.             if (time.TotalSeconds > 0)
    149.             {
    150.                 var notifTime = today.AddSeconds(time.TotalSeconds);
    151.                 notifTime = new DateTime(notifTime.Year, notifTime.Month, notifTime.Day, 13, 0, 0);
    152.                 ScheduleNotification(notifTime, AppMacros.TXT_CONGRACTS, AppMacros.LOCAL_NOTIF_DAILY_RWD_TEXT, AppMacros.NotifType.DailyRwd, TimeSpan.Zero);
    153.  
    154.                 var laterDate = notifTime.AddDays(1);
    155.                 laterDate = new DateTime(laterDate.Year, laterDate.Month, laterDate.Day, 9, 0, 0);
    156.                 ScheduleNotification(laterDate, AppMacros.LOCAL_TXT_STRUCK_TITLE, AppMacros.LOCAL_COMEBACK_NOTIF_TEXT, AppMacros.NotifType.ComeBack, TimeSpan.FromHours(24));
    157.                 //    ScheduleNotification(expiryDateTime,"", AppMacros.LOCAL_RWD_EXP_NOTIF_TEXT, AppMacros.NotifType.RwdExpire, TimeSpan.Zero);
    158.             }
    159.             var notifTme = DateTime.Now.AddHours(3);
    160.             var timeSpan = TimeSpan.FromHours(24);
    161.             ScheduleNotification(notifTme, AppMacros.LOCAL_COIN_WALLET_FULL_TITLE, AppMacros.LOCAL_COIN_WALLET_FULL_MSG, AppMacros.NotifType.CoinWallet, timeSpan);
    162.         }
    163.     }
    164.  
    165.     public void RegisterNotifications() {
    166. #if UNITY_IOS
    167.         UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Badge | UnityEngine.iOS.NotificationType.Sound);
    168. #elif UNITY_ANDROID
    169.         var c = new AndroidNotificationChannel()
    170.         {
    171.             Id = channelId,
    172.             Name = "Guess The Pictures",
    173.             Importance = Importance.High,
    174.             Description = "Generic notifications",
    175.         };
    176.         AndroidNotificationCenter.RegisterNotificationChannel(c);
    177. #endif
    178.     }
    179.  
    180.  
    181.     private static void ScheduleNotification(System.DateTime date, string Title, string message, AppMacros.NotifType notifType, TimeSpan repeatInterval)
    182.     {
    183. #if UNITY_IOS
    184.  
    185.         var timerInterval = date - DateTime.Now;
    186.         iOSNotification notf = new iOSNotification();
    187.         notf.Data = "{\"title\": \"Notification\", \"data\": \"" + ((int)notifType).ToString() + "\"}";
    188.         notf.Title = Title;
    189.         notf.Body = message;
    190.         bool repeat = false;
    191.         if (repeatInterval != TimeSpan.Zero) {
    192.             repeat = true;
    193.         }
    194.         notf.Trigger = new iOSNotificationTimeIntervalTrigger()
    195.         {
    196.             Repeats = repeat,
    197.             TimeInterval = timerInterval,
    198.         };
    199.         notf.Identifier = channelId;
    200.         iOSNotificationCenter.ScheduleNotification(notf);
    201.  
    202. #elif UNITY_ANDROID
    203.         var notification = new AndroidNotification();
    204.         notification.Title = Title;
    205.         notification.Text = message;
    206.         notification.IntentData = "{\"title\": \"Notification\", \"data\": \"" + ((int)notifType).ToString() +"\"}";
    207.         notification.FireTime = date;
    208.         notification.ShouldAutoCancel = true;
    209.         notification.SmallIcon = "icon_0";
    210.         notification.LargeIcon = "icon_1";
    211.         if (repeatInterval != TimeSpan.Zero) {
    212.             notification.RepeatInterval = repeatInterval;
    213.         }
    214.         AndroidNotificationCenter.SendNotification(notification, channelId);
    215. #endif
    216.     }
    217.  
    218.     private static void CancelPreviousNotifications() {
    219. #if UNITY_IOS
    220.         UnityEngine.iOS.NotificationServices.ClearLocalNotifications();
    221.         UnityEngine.iOS.NotificationServices.CancelAllLocalNotifications();
    222.         UnityEngine.iOS.NotificationServices.ClearRemoteNotifications();
    223. #elif UNITY_ANDROID
    224.         AndroidNotificationCenter.CancelAllNotifications();
    225.         AndroidNotificationCenter.CancelAllDisplayedNotifications();
    226.         AndroidNotificationCenter.CancelAllScheduledNotifications();
    227. #endif
    228.     }
    229.  
    230. #endregion
    231. }
    232.  
     
  8. rehanazhar87

    rehanazhar87

    Joined:
    May 31, 2017
    Posts:
    4
    @Vincent-Zhang can you please look it ?
     
  9. TheFellhuhn

    TheFellhuhn

    Joined:
    Feb 3, 2017
    Posts:
    42
    Question: If I get a push notification while the app is not running it gets shown in the system tray is it should. Is there any way in Unity to get those once the app is running? Currently I only get notifications that are received while the app is in hte foreground. I can also clear all notifications but so far I have found no way to access them.
     
  10. eagleTiger

    eagleTiger

    Joined:
    Apr 20, 2017
    Posts:
    14
    I reported the bug in March, any update on it?
     

    Attached Files:

    Last edited: Apr 17, 2020
  11. DavidBu

    DavidBu

    Joined:
    Jun 26, 2013
    Posts:
    1
    I think am seeing the same problem as @cg-adam :

    For me specifically, version 1.1.0 fails to compile during the "Building Gradle project phase and I get a dialog saying, "Compilation failed; see the compiler error output for details. See the console for details."

    This is the error in the console :

    C:\Projects\UnityNotif\Temp\gradleOut\unityLibrary\src\main\java\com\unity\androidnotifications\NotificationCallback.java:4: error: package android.support.annotation does not exist

    What maybe relevant information is that we use the Play Services Resolver and use plugins that require androidx libraries. At the moment we are using "preview.9 - 1.0.4" without problem.

    Now reported a bug for this : case 1239769.
     
    Last edited: Apr 20, 2020
    Deleted User likes this.
  12. Deleted User

    Deleted User

    Guest

    Could you please post the bug id here? Seems I didn't see it coming into the queue. Thanks.
     
  13. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Hi, I have some feedback:

    I'd love two functions:
    On Android and iOS I'd like to be able to query if notifications are enabled so i can display that in my ui. I believe android implements a function for this now.

    On both iOS and Android it would be nice to have a function to call that opens notification settings, this is easy enough on iOS with a uri, but Android is more involved and version dependant.

    For anyone wanting the later, here's my current solution:
    Code (csharp):
    1.  
    2. public static void OpenAppNotificationSettings()
    3.     {
    4.         if( Application.isEditor )
    5.         {
    6.             Debug.Log( "On device application settings would open here." );
    7.             return;
    8.         }
    9.  
    10. #if UNITY_IOS
    11.         Application.OpenURL( "App-Prefs:root=NOTIFICATIONS_ID&path=id" + Constants.AppConstants.IOSAppId );
    12. #elif UNITY_ANDROID
    13.         try
    14.         {
    15.             using( var unityClass = new AndroidJavaClass( "com.unity3d.player.UnityPlayer" ) )
    16.             using( AndroidJavaObject currentActivityObject = unityClass.GetStatic<AndroidJavaObject>( "currentActivity" ) )
    17.             {
    18.                 string packageName = currentActivityObject.Call<string>( "getPackageName" );
    19.  
    20.                 using( var intentObject = new AndroidJavaObject( "android.content.Intent" ) )
    21.                 {
    22.                     intentObject.Call<AndroidJavaObject>( "setAction", "android.settings.APP_NOTIFICATION_SETTINGS" );
    23.  
    24.                     intentObject.Call<AndroidJavaObject>( "addCategory", "android.intent.category.DEFAULT" );
    25.                     intentObject.Call<AndroidJavaObject>( "setFlags", 0x10000000 );
    26.  
    27.                     //for Android 5-7
    28.                     intentObject.Call<AndroidJavaObject>( "putExtra", "app_package", packageName );
    29.                     intentObject.Call<AndroidJavaObject>( "putExtra", "app_uid", SystemInfo.deviceUniqueIdentifier );
    30.  
    31.                     // for Android 8 and above
    32.                     intentObject.Call<AndroidJavaObject>( "putExtra", "android.provider.extra.APP_PACKAGE", packageName );
    33.  
    34.                     currentActivityObject.Call( "startActivity", intentObject );
    35.                 }
    36.             }
    37.         }
    38.         catch( System.Exception ex )
    39.         {
    40.             Debug.LogException( ex );
    41.         }
    42. #endif
    43.     }
    44.  
    sources:
    https://forum.unity.com/threads/redirect-to-app-settings.461140/#post-2994362
    https://stackoverflow.com/a/32368604
     
    Last edited: Apr 22, 2020
  14. eagleTiger

    eagleTiger

    Joined:
    Apr 20, 2017
    Posts:
    14
    Here is the link to the bug.

    i didn't get the ID, but here is the ticket number 1231508_5u5odhs98sujnma0
     
  15. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
  16. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Have you tried iOSNotificationCenter.GetNotificationSettings() on iOS? It should tell you all you need to know.
     
    Antony-Blackett likes this.
  17. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    @Vincent-Zhang I tried to have my iOS app register for silent push by performing an authorization request without Alert, Badge, and Sound options enabled.The request failed.

    Some Attribution services require the device push token to track app uninstalls. It's my understanding that I should able to get this token without asking the user to allow notifications, i.e. by authorizing silent push notifications. How can I do this?
     
  18. tarmo-jussila

    tarmo-jussila

    Joined:
    Jun 4, 2015
    Posts:
    42
    @Vincent-Zhang Unity Cloud build still does not seem to work together with Mobile Notifications. Manual local builds work and Cloud builds do not work even though the build succeeds.

    Tested with these versions (none of these work for Cloud builds):

    - Mobile Notifications 1.0.3 (stable) <-- Unity Cloud build succeeds, notifications don't work
    - Mobile Notifications 1.0.4 (preview.9) <-- Unity Cloud build succeeds, notifications don't work
    - Mobile Notifications 1.1.0 (preview) <-- Unity Cloud build fails (error below)
    - Mobile Notifications 1.2.0 (preview) <-- Unity Cloud build fails (error below)


    [Unity] ERROR: Note: /BUILD_PATH/org.game.android-master-apk/Temp/gradleOut/src/main/java/com/unity/androidnotifications/UnityNotificationManager.java uses or overrides a deprecated API.


    Used Unity version 2019.2.5f1 (local builds) and Unity 2019.2.21f (Cloud builds).

    Any solution for this?
     
    Last edited: Apr 29, 2020
  19. tarmo-jussila

    tarmo-jussila

    Joined:
    Jun 4, 2015
    Posts:
    42
    @_Paulius did your investigation on this issue result in solution for this issue? Still an issue with Mobile Notifications (any version) + Unity Cloud Build with Unity 2019.2.21.
     
  20. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778

    Any word on a fix for this? It's kinda important.
     
  21. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    It turned out I wasn't checking the Enable Push Notifications option in the Mobile Notification Settings.
     
    Deleted User likes this.
  22. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Ok, I'll have a look tomorrow. thanks for the info.
     
  23. Deleted User

    Deleted User

    Guest

    It should been fixed by the new 1.2.1-preview patch release, please check it to see if it works for you.
     
  24. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I see why I turned this off now. The help text says that it enables the push notification capability in the xcode project. I do that myself in my build script so i left it off... This may need better documentation.
     
  25. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    This is what Unity said to me about it

     
  26. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I'll have to test it. because i already manually add those things to my capabilities and plist because i was using push before using this package.

    Edit:
    It does work with that checked... so if that's all they are doing then.... who knows.?
     
  27. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    In the old system you have to do this to get the device token before sending it to a server.

    token = System.Convert.ToBase64String( UnityEngine.iOS.NotificationServices.deviceToken );

    What do you do with the AuthorizationRequest.deviceToken? When I try use it I get an 'invalid token' error.

    I'm on version 1.0.4 preview 9 which is after the invalid token fix in preview 3.
     
  28. Deleted User

    Deleted User

    Guest

    I replied to @andymads in the bug at the first place, but I didn't put all the details there...
    While building we store the settings values and use them in the player. For "Enable Push Notifications", we check its value to call `registerForRemoteNotifications` https://developer.apple.com/documen...-registerforremotenotifications?language=objc, which will ask app to call the `didRegisterForRemoteNotificationsWithDeviceToken` to return the device token.
     
  29. Deleted User

    Deleted User

    Guest

    Which iOS version are you on? Could you please report a bug via bug reporter?
     
  30. Deleted User

    Deleted User

    Guest

    We will have a fix for it in the next release.
     
    Last edited by a moderator: May 6, 2020
  31. sebi3110

    sebi3110

    Joined:
    Oct 11, 2012
    Posts:
    17
    Hi,

    is it possible to integrate a condition based notification delivery on Android?

    I want to deliver a push notification only if a certain condition is met.

    So e.g. every day at 10am a notification should be delivered if the condition is met. If the condition is not met, no notification should be published at that time.
    So if some kind of callback from the schedule event (before the actual notification is delivered) could be used, that would be awesome.
    Maybe such a functionality is already available?

    Beste regards!
     
    Last edited: May 11, 2020
  32. Shadowbiz

    Shadowbiz

    Joined:
    Oct 11, 2018
    Posts:
    1
    Hey guys. Having
    AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='checkIfPendingNotificationIsRegistered' signature='(I)Z' in class Ljava.lang.Object;
    exception from users after adding notification package to my app.
    The code I am using is almost identical to the example page. On my test devices it was working fine, but got a lot of exceptions from users after publishing update on Play Store.
    Code (CSharp):
    1.  
    2. var channel = new AndroidNotificationChannel()
    3.             {
    4.                 Id = ChannelIdentifier,
    5.                 Name = "Main Channel",
    6.                 Importance = Importance.Default,
    7.                 Description = "Generic notifications",
    8.             };
    9.             AndroidNotificationCenter.RegisterNotificationChannel(channel);
    10.    
    11.             var newNotification = new AndroidNotification
    12.             {
    13.                 Title = "NotificationTitle",
    14.                 Text = "NotificationText",
    15.                 FireTime = System.DateTime.Now.AddHours(24),
    16.                 LargeIcon = "icon_id"
    17.             };
    18.  
    19.             var identifierId = AndroidNotificationCenter.SendNotification(newNotification, ChannelIdentifier);
    20.             var notificationStatus = AndroidNotificationCenter.CheckScheduledNotificationStatus(identifierId);
    21.  
    22.             if (notificationStatus == NotificationStatus.Scheduled)
    23.             {
    24.                 Debug.Log("Notification rescheduled");
    25.                 AndroidNotificationCenter.UpdateScheduledNotification(identifierId, newNotification, ChannelIdentifier);
    26.             }
    27.             else
    28.             {
    29.                 Debug.Log("Notification added");
    30.                 AndroidNotificationCenter.SendNotification(newNotification, ChannelIdentifier);
    31.             }
     
  33. dandanthepizzaman666

    dandanthepizzaman666

    Joined:
    Jul 15, 2019
    Posts:
    6
    Hi Folks - First time using this package ( or implementing notifications at all ) so trying to understand the terminology and behaviour. I want to achieve 2 things:

    1) when the user has tapped the notification, can the notification delete itself? At the moment it sits in the Android notification stack until the user swipes to delete it manually.
    2) If the app is foregrounded / active when the notification is delivered, I want it to be rescheduled to arrive at a customizable time in the future.

    Thanks in advance!
     
  34. twice7713

    twice7713

    Joined:
    Apr 24, 2018
    Posts:
    24
    Mobile Notifications 1.2.1
    Send Notification sometime are not correct time appear.

    If anyone has the same question, can you respond to me.
    Thank you very much.
     
    Last edited: May 18, 2020
  35. Deleted User

    Deleted User

    Guest

    Sorry for the trouble, will fix it in the next release.
     
  36. Deleted User

    Deleted User

    Guest

    For #1: You can set AndroidNotification.ShouldAutoCancel to true.
    For #2: I assumed you're talking about adding action to the notification? No, it's not something supported for now...
     
  37. Deleted User

    Deleted User

    Guest

    It's not something supported for now, but theoretically it's doable on Android.
     
  38. Deleted User

    Deleted User

    Guest

    Do you mean the IGameNotification in the notification sample? If it is, we will put it in the list.
     
    cg-adam likes this.
  39. cg-adam

    cg-adam

    Joined:
    Jul 30, 2019
    Posts:
    44
    Yes, thanks.
     
  40. Haukien

    Haukien

    Joined:
    Aug 20, 2014
    Posts:
    12
    We got a new issue when upgrading to 1.2.1. We upgraded from 1.0.4-preview.5

    Code (CSharp):
    1. 2020-05-21 13:12:50.411 2667-2911/com.dirtybit.fra E/Unity: AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='getNotificationManagerImpl' signature='(Landroidx.multidex.MultiDexApplication;Lcom.unity3d.player.UnityPlayerActivity;)Ljava/lang/Object;' in class Ljava.lang.Object;
    2.     java.lang.NoSuchMethodError: no static method with name='getNotificationManagerImpl' signature='(Landroidx.multidex.MultiDexApplication;Lcom.unity3d.player.UnityPlayerActivity;)Ljava/lang/Object;' in class Ljava.lang.Object;
    3.         at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:231)
    4.         at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    5.         at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    6.         at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    7.         at android.os.MessageQueue.next(MessageQueue.java:405)
    8.         at android.os.Looper.loop(Looper.java:197)
    9.         at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
    10.       at UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boole
     
  41. Deleted User

    Deleted User

    Guest

    Didn't see this before. Could you please open a bug report for it?
     
  42. Ganuzaz

    Ganuzaz

    Joined:
    Oct 4, 2016
    Posts:
    3
    iOSNotificationCenter.GetLastRespondedNotification still doesn't work with firebase in it for iOS. Had to remove iOS firebase plugins and pods for it to work.
     
    Last edited: May 26, 2020
  43. Its4u

    Its4u

    Joined:
    Oct 11, 2013
    Posts:
    14
    I integrated version 1.2.1, it worked very well except changing notification color feature. I checked code and realized the color alway return 0. You guys can check in
    AndroidNotificationExtensions.cs


    Code (CSharp):
    1.  
    2. public static int ToInt(this Color? color)
    3. {
    4.     if (color.HasValue) // You can see, color will return 0 almost of time
    5.         return 0;
    6.  
    7.     var color32 = (Color32) color.Value;
    8.     return (color32.a & 0xff) << 24 | (color32.r & 0xff) << 16 | (color32.g & 0xff) << 8 | (color32.b & 0xff);
    9. }
    10.  
     
  44. Deleted User

    Deleted User

    Guest

    Stupid mistake, will fix soon.
     
    Last edited by a moderator: May 26, 2020
  45. oskari-sgg

    oskari-sgg

    Joined:
    Sep 24, 2017
    Posts:
    1
    This was already reported 9 months ago on this thread, any word on it? The icon is impossible to see in the list because it's white on white.
    mnicon1.jpg
     
  46. Deleted User

    Deleted User

    Guest

    Sorry for missing that. Is there already a bug report? If not, could yoou please report one? Thanks.
     
  47. Deleted User

    Deleted User

    Guest

    Could you please make a bug report? Thanks.
     
  48. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Bug: Scheduling a notification on iOS with empty Data will crash the app with Unhandled Exception
     
  49. Deleted User

    Deleted User

    Guest

    Which package version are you on? Could you please make a bug report? Then we can have it fixed with QA to verify.
     
    Last edited by a moderator: May 29, 2020
  50. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Mobile Notifications Version 1.0.3
    I'm uploading the bug report right now, the project is quite big, so it'll take some time, but the repro is quite simple, when scheduling a notification on iOS, set Data to null and the app will crash with an unhandled exception.