Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Mobile Notifications - Not repeating on Android (repeatInterval)

Discussion in 'Android' started by peachpieproductions, Aug 19, 2019.

  1. peachpieproductions

    peachpieproductions

    Joined:
    Sep 2, 2017
    Posts:
    17
    Hey there!

    I am using the Unity package for Mobile Notifications with 2019.1.12f1 and cannot seem to get repeating scheduled notifications firing. The first one fires, then never fires again, even though im using repeatInterval set to 2 min. Whether the app stays open or closed, still never more than 1 notification fires.

    Here is my code:
    Code (CSharp):
    1. private void Start() {
    2.         channel = new AndroidNotificationChannel() {
    3.             Id = "channel_id",
    4.             Name = "Default Channel",
    5.             Importance = Importance.High,
    6.             Description = "Generic notifications",
    7.         };
    8.         AndroidNotificationCenter.RegisterNotificationChannel(channel);
    9.  
    10.         var notification = new AndroidNotification("Notification", "This is a test.", System.DateTime.Now.AddSeconds(10), new System.TimeSpan(0,2,0));
    11.  
    12.         AndroidNotificationCenter.SendNotification(notification, "channel_id");
    13.     }
     

    Attached Files:

    • code.PNG
      code.PNG
      File size:
      21.9 KB
      Views:
      629
  2. AurimasA

    AurimasA

    Unity Technologies

    Joined:
    Apr 24, 2017
    Posts:
    24
    bigpixy likes this.
  3. peachpieproductions

    peachpieproductions

    Joined:
    Sep 2, 2017
    Posts:
    17
    @AurimasA Hey there! The device im testing on is Google Pixel XL 2, so that shouldnt be the issue.

    I can submit a bug report, but first I'd like to ask, does my code look correct? Is that the proper way to call a repeating notification?
     
  4. AurimasA

    AurimasA

    Unity Technologies

    Joined:
    Apr 24, 2017
    Posts:
    24
    @peachpieproductions This does look correct and it should be working. Could you try using a bigger interval e.g. 5 minutes? If it still doesn't work, please report the bug and reply the ID here.
     
  5. peachpieproductions

    peachpieproductions

    Joined:
    Sep 2, 2017
    Posts:
    17
    @AurimasA Hey there! Thanks for the quick response. I tried it at 5 minutes, which unfortunately didnt work either.

    I submitted a bug report and the case # is
    Case 1178665
     
  6. AurimasA

    AurimasA

    Unity Technologies

    Joined:
    Apr 24, 2017
    Posts:
    24
  7. peachpieproductions

    peachpieproductions

    Joined:
    Sep 2, 2017
    Posts:
    17
    @AurimasA Hey there! I have downgraded to 1.0.2 and am now getting 16 errors that wont clear

    PostprocessorTests.cs(4,7): error CS0246: The type or namespace name 'NUnit' could not be found
    PostprocessorTests.cs(6,19): error CS0234: The type or namespace name 'TestTools' does not exist in the namespace
    PostprocessorTests.cs(14,10): error CS0246: The type or namespace name 'TestAttribute' could not be found
    PostprocessorTests.cs(14,10): error CS0246: The type or namespace name 'Test' could not be found
     
  8. aashir9

    aashir9

    Joined:
    Feb 2, 2019
    Posts:
    1
    Facing exactly the same issue. It is a major bug. Please fix the issue soon
     
  9. peachpieproductions

    peachpieproductions

    Joined:
    Sep 2, 2017
    Posts:
    17
    @AurimasA Hey there! I appreciate the help so far. Is there a work around for the current state of things, or should I just wait for the next patch to fix the repeating notifications?
     
    Last edited: Aug 28, 2019
  10. AurimasA

    AurimasA

    Unity Technologies

    Joined:
    Apr 24, 2017
    Posts:
    24
    @peachpieproductions I would suggest waiting for a new patch, or try remaking/fixing errors with 1.0.2 as from the issue tracker description it shouldn't be reproducing in that version
     
  11. vuthang

    vuthang

    Joined:
    Mar 7, 2017
    Posts:
    39
    I get same problem in version 1.0.4-preview.3. I test on xiaomi redmi note 4 and samsung j5 2016
     
  12. darkguy2008

    darkguy2008

    Joined:
    Mar 26, 2020
    Posts:
    8
    Experiencing the same issue, using 1.1.0-preview (25 March). I have a Xiaomi Mi 8 Lite. What do you mean by whitelisting? I take it this is okay? (default settings I receive after installing the app):

    upload_2020-3-30_2-30-41.png
     
  13. georgikgeo25

    georgikgeo25

    Joined:
    Mar 24, 2020
    Posts:
    5
    [QUOTE = "AurimasA, post: 4879682, membru: 1361146"] Bună ziua,

    Dacă utilizați un Xiaomi (Redmi Note 7) știm deja despre problema lui.
    https://issuetracker.unity3d.com/is...ime-spans-arent-delivered-on-specific-devices

    Nu suntem conștienți de nicio modalitate de a soluționa acest comportament, în afară de a încuraja să listăm în mod alb aplicația.

    Dacă este o problemă diferită, puteți raporta problema utilizând un proiect de reproducere minim și răspundeți aici cu ID-ul de eroare? [/ QUOTE]
    Nu merge, îl pui degeaba