Search Unity

Official Mobile Notification Package

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

  1. Mese

    Mese

    Joined:
    Dec 13, 2015
    Posts:
    41
    I see 1.5.0 is pushed as a commit on Unity's github
    Any ETA?
     
    cnst likes this.
  2. cnst

    cnst

    Joined:
    Oct 7, 2016
    Posts:
    1
    @Aurimas-Cernius Should we wait for the update in 2021?
     
  3. gurbrindersingh

    gurbrindersingh

    Joined:
    Feb 28, 2017
    Posts:
    32
  4. gurbrindersingh

    gurbrindersingh

    Joined:
    Feb 28, 2017
    Posts:
    32
    or is there any way I can repeat a notification on daily basis (without clicking buttons daily) using unity's builtin solution for Android? I can't find any example for it in docs @Aurimas-Cernius
     
  5. suraj_stellarplay

    suraj_stellarplay

    Joined:
    Oct 4, 2021
    Posts:
    2
    Any update on this issue ?

    I'm using unity 2020.3 and package 1.4.2. Still getting IOSNotificationCenter.GetLastRespondedNotification() always null
     
    Last edited: Jan 4, 2022
    konsnos likes this.
  6. NatsuD_123

    NatsuD_123

    Joined:
    Feb 19, 2019
    Posts:
    18
    okay so i want to report a bug in AndroidNotificationPostProcessor.cs
    you need to add
    notificationRestartOnBootReceiver.SetAttribute("exported", kAndroidNamespaceURI, "false");

    at line number 132 to add android:exported = "false" property in manifest
    otherwise i can not upload build to play console. It is now compulsory for all activity, activity alias, service or broadcast receiver with intent filter to have android:exported property set. Please fix it and update asap because if i edit AndroidNotificationPostProcessor.cs, it reverts back to original state. for now i have to remove notifications package sadly
     
    DeuS and Vladnee like this.
  7. Vladnee

    Vladnee

    Joined:
    Apr 28, 2017
    Posts:
    26
    This issue is also mentioned in https://forum.unity.com/threads/mobile-notifications-package-and-android-12-issue.1225353/)
     
  8. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Thx for this note! Searched for several days for this issue until I found your post. Fixed the problem. Now I'm wondering when 1.5.0 will become available in the package manager since it was available since last month:

    upload_2022-1-20_0-26-29.png
    Would like to have the fix to not apply the patch everytime the PM needs to update.
     
    DoVanLoc likes this.
  9. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,965
    Until they release a new update, you can try this to fix and it auto adds the required flag (android:exported flag)
     
    Last edited: Jan 25, 2022
  10. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Thanks, I moved the package to the local packages folder and adjusted the code there. Still annoying, as I now have to check now and then if the package has been released and I can move the folder back again.
     
  11. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    @Aurimas-Cernius It's unbelievable how Unity is responsible for a plugin, and just leaves their users hanging for more than half a year...
     
  12. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    Did you also change the AndroidManifest.xml under "project/androidnotifications/src/main/" in your workaround and when yes, could you please tell me how you did this?
     
  13. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    No. All I did was to move the package out of the /Library/PackagesCache/ folder to the /Packages/ folder and adjusted the iOS .mm script. On Android I hadn't had problems so far.
     
  14. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    For everyone who hasn't seen it already, version 2.0.0 is now available via the Package Manager.

    Anyone knows how to use the new "AndroidNotificationCenter.CreateNotificationBuilder"? The docs sadly don't mention it.
     
    Last edited: Feb 15, 2022
  15. levent81

    levent81

    Joined:
    Sep 6, 2018
    Posts:
    2
    Hello everyone,
    Anybody know why im i getting this message?
     

    Attached Files:

  16. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Can't tell exactly without translation to language I understand, but a comment in code below and layout suggests you wrote the code inside a class, not inside a method.
     
  17. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    After updating to 2.0.0 we're getting this exception on Android 4.4:

    Is there something that can be done about it?
    @Aurimas-Cernius
     
  18. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    Another one - Android 9 and 11:

     
  19. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    @imaginalis could you report both of them as bugs using Unity Editor with repro projects and information on devices, how to reproduce it?
     
  20. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    Sorry, I'm not able to do that, these are logs from players' devices that I've found in Cloud Diagnostics. We haven't reproduced this on our side. First one though looks like some obvious issue on every Android 4.x device.
     
  21. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    Hello, using unity 2020.3.20

    I get this error ....

    DirectoryNotFoundException: Could not find a part of the path ....\Library\PackageCache\com.unity.mobile.notifications@1.4.2\Runtime\Android\Plugins\com\unity\androidnotifications\UnityNotificationManagerOreo.java


    ???
     
  22. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Try reinstalling the package. This looks like mess-up the project.
     
  23. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    I did 3 times and try with just empty project, build worked , reinstalled into empty project build error again. the script is there, it shows in that directory, don't understand part of the path... no luck
     
  24. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Maybe the path is too long? On Windows you are limited to 259 chars.
     
  25. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    I didn't set the path I just installed the package, should I move that one level up? and if I do so what will that trigger in return?... or should I just use different means of mobile notifications?
     
  26. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Look where your Unity project is located. Starting from word Library the path is almost 150 chars, so if you Unity project is in a directory those path exceeds 100 characters, you are in danger of having problems with path.
     
  27. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    ok got it, I'll move, Thanks!
     
  28. TSC

    TSC

    Joined:
    Oct 15, 2012
    Posts:
    271
    That's crazy yes that was the problem, haha how the avg. person suppose to know that... this don't happen with other packages do it? well complex but simple, resolve, thank you.
     
  29. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    @Aurimas-Cernius Can you fix this issue I mentioned almost a month ago?
    It's a simple one, you just need to make additional Android version checks in AndroidNotificationCenter class to make sure you don't request EXTRA_BIG_TEXT on Android 4. This issue is making thousands of exceptions for our Android 4 players.
     
    paradizIsCool and denis_bogdanov like this.
  30. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Same issue, android 4.4 only
     
  31. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
  32. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    @Aurimas-Cernius What about this bug on Android 12? It made 3000 crashes on our game during last 30 days. Can you resolve it somehow?

     
  33. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    And these two on Android 7.0 (2700 crashes total during last 30 days):

     
  34. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    This is definitely bad news, and not really acceptable since the version was automatically upgraded when we jumped from 2020.3.30 to 32 and it seems we cannot force the old version.
     
  35. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    Older version has it's own issues so no point to go back to be honest. @Aurimas-Cernius Can you please take a look at messages I've sent recently and let us know if issues can be fixed or not?
     
  36. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    I'm getting this crash reported on iOS but I can't reproduce it locally. I'm not sure why it's happening only for some users. Has anyone else seen this?

    Unity v2021.2.13
    Mobile Notifications v2.0.0

    Screen Shot 2022-03-29 at 10.23.53 AM.png
     
  37. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Unity 2020.3 does not support android 4.4.
    The min version shouldn't have jumped to 32, only the target sdk.
     
  38. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Could it be iOS version specific?
    Any clue if this is for push notification or local?
    Maybe any info on what the actual exception is?
     
  39. Antony-Blackett

    Antony-Blackett

    Joined:
    Feb 15, 2011
    Posts:
    1,778
    Here's more info.

    No specific OS version.
    Screen Shot 2022-03-30 at 10.43.45 AM.png

    Here's the full stack trace when I open the crash report in my project.

    Screen Shot 2022-03-30 at 10.41.50 AM.png


    Seems it might not like me calling that method on app start? I'm calling the same function elsewhere in my app but this is the only place it crashes.
     
    Last edited: Mar 29, 2022
  40. dskillsaw

    dskillsaw

    Joined:
    Apr 26, 2012
    Posts:
    13
    Figured it might be useful to share this post here.

    I'm seeing a strange behavior with the DeliveryTime of my notification advancing 7 hours each time the applications loses and regains focus... very confused.
     
  41. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Unity 2020.3 does support android 4.4

    https://unity3d.com/fr/unity/whats-new/2020.3.32
    System Requirements
    • Android: OS 4.4 or later; ARMv7 CPU with NEON support; OpenGL ES 2.0 or later.

    Android 2021.1 does too, 2021.2 min support is android 5.1
     
  42. Chris_Webb

    Chris_Webb

    Joined:
    Mar 18, 2014
    Posts:
    128
    Hello,

    I am also seeing strange behavior with notification delivery times being off by several hours (-10 hours in my case. I am +10 GMT). This is happening on iOS for me.

    I recently updated from 1.4.2 to 2.0.0.

    Thanks
     
  43. VoxelMatt

    VoxelMatt

    Joined:
    Apr 22, 2015
    Posts:
    42
    Hi - Is there any indication of when Custom Notification SFX will be supported?

    I notice there's been a TODO in the iOS UnityNotificationManager.mm file since 2019
     
  44. dskillsaw

    dskillsaw

    Joined:
    Apr 26, 2012
    Posts:
    13
    If Unity has no feedback on this, I will roll back to 1.4.2.
     
  45. CU_Marko

    CU_Marko

    Joined:
    Jan 6, 2022
    Posts:
    7
    Hi.

    We are using Unity 2020.3.26, and about a month ago we have updated Mobile Notifications package from 1.4.2 to 2.0.0.
    After that we have seen some ActivityThread crashes on Android 12 and 7, just like imaginalis described in This post and This post.

    We decided to revert back to package version 1.4.2 and have rolled out a new app update yesterday, but now we are seeing new crashes on Android:

    We were not able to reproduce this on our devices, but it has so far affected about 8% of our users on Android (not limited to specific Android versions).

    It looks like local notifications that were shown (or scheduled?) from older app version (but newer package version 2.0.0) have somehow survived the app update procedure?
    As far as I know, when the app is updated, all notifications for that app are removed (as observed on our own devices), or is this not the case?

    Anyway, if I'm reading the crash log correctly, it seems that because of this, the newer app version (but older package version 1.4.2) has problems when deserializing data and the java code has no try-catch block to handle it.

    In case it matters, we added Firebase Cloud Messaging in this latest app update, and have changed the Activity in the AndroidManifest.xml from
    to
    but we did not see any problems on our test devices and both systems have been running ok, so we really didn't expect to see so many crashes.

    Please let me know if there is something we can do, or is our best bet to go back to updating the package version to 2.0.0 (where at least the crash rate was lower and limited to Android 7 and 12)?
     
    Last edited: Apr 6, 2022
  46. imaginalis

    imaginalis

    Joined:
    Feb 20, 2015
    Posts:
    29
    We decided to stay on 2.0.0 because overall it causes less crashes than 1.4.2 for us. But still these issues on Android 7 and especially 12 need to be fixed urgently in my opinion as Android 12 player base is increasing. I'm also concerned about the issue our players experience on Android 4.4 and it seems really easy to fix as I mentioned earlier. Why not to fix that as well? Especially when 2019.4 LTS is still supported by Unity. I'm really expecting Unity to fix it @Aurimas-Cernius
     
    azuma_unity likes this.
  47. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    We plan to release newer version of 1.4.x soon. 2.0.x too.
     
  48. azuma_unity

    azuma_unity

    Joined:
    Sep 7, 2017
    Posts:
    5
    If we set an elapsed Time of about 15 seconds, we will be notified after 25+ seconds. If we set an elapsed Time of about 25 seconds, we will be notified after 45+ seconds. When we returned to ver1.4.2, the delay disappeared. Will the newer version fix the delay? @Aurimas-Cernius
     
    Last edited: Apr 15, 2022
  49. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Please report a bug with a simple repro project.
     
  50. azuma_unity

    azuma_unity

    Joined:
    Sep 7, 2017
    Posts:
    5
    Submitted a bug report with a repro project. (Case 1421412)
     
    Last edited: Apr 20, 2022
    Aurimas-Cernius likes this.