Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Mobile Local Notification with support Emoji

Discussion in 'Assets and Asset Store' started by Lucasito, Oct 5, 2017.

  1. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi! Please, check notifications for this demo apk https://www.dropbox.com/s/i7i0nesa54aw8ns/MobileLocalNotifications.apk?dl=0
     
  2. OneLemon

    OneLemon

    Joined:
    Apr 27, 2013
    Posts:
    12
  3. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Ok. You can send device logs with crash link to gallery? And your demo build? What version of Unity?
     
  4. OneLemon

    OneLemon

    Joined:
    Apr 27, 2013
    Posts:
    12
    When I press the notification button, in the logs it says this:


    05-08 13:17:01.773 18876-18919/? E/Unity: AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='SendNotification' signature='(IJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZILjava/lang/String;Ljava/lang/String;)V' in class Ljava.lang.Object;
    java.lang.NoSuchMethodError: no static method with name='SendNotification' signature='(IJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZILjava/lang/String;Ljava/lang/String;)V' in class Ljava.lang.Object;
    at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:167)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    at android.os.MessageQueue.next(MessageQueue.java:395)
    at android.os.Looper.loop(Looper.java:181)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
    at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>


    Version of unity is 2018.3.10f1

    I will come back with more info when I have time.
     
  5. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    APK not include MobileLocalNotifications.jar
    You can send me this APK?
     
  6. parapluiestudio1

    parapluiestudio1

    Joined:
    Dec 14, 2018
    Posts:
    3
    Hi. I trying to build to android and I found this problem

     
  7. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi.
    You check recipe in FAQ?
    2. For Unity 2019.1.4f1 need ignore import file Assets/Plugins/Android/mainTemplate.gradle
     
  8. parapluiestudio1

    parapluiestudio1

    Joined:
    Dec 14, 2018
    Posts:
    3
    Thank you. I can build and test it but I got some error.

     
  9. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    I can see c# code? May be you send null instead string parameter?
     
  10. parapluiestudio1

    parapluiestudio1

    Joined:
    Dec 14, 2018
    Posts:
    3
    I resolved this. just remove this line

    LocalNotificationsManager.CancelLocalNotification(_noti_id);

    before use LocalNotificationsManager.SendNotification function
     
    Last edited: Jul 28, 2019
  11. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Thanks! I will fix it soon.
     
  12. liodico

    liodico

    Joined:
    Apr 1, 2014
    Posts:
    1
    hey man
    I just import your plugin and build. But unity can't build

    My log:
     
  13. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi!
    You use custom gradle file? If yes, please, show me this file
     
  14. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Try replacing compile to implementation into gradle file.
     
  15. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Fixed CancelNotification function
     
  16. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Howdy!

    First, thanks for making the plugin, it looks to be exactly what I need.

    I am getting DEX errors when I build with Internal and Gradle errors when I build with Gradle (I added the line into proguard-user).

    I'm hoping you can help! Can I send you my errors?

    Thanks in advance!
     
  17. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi!

    Yes of course. Send your Gradle errors, gradle file and Unity version
     
    breban1 likes this.
  18. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    I'm using Unity 2017.4.32f1, should I delete Assets/Plugins/Android/mainTemplate.gradle?
     
  19. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Here is the top part of the DEX errors from Internal: https://ibb.co/7ygD43g

    Any help would be appreciated! (I'd rather not use Gradle because I am converting an old project to 2017 and it used Internal before. Trying for Apples to Apples if you know what I mean).

    Using Unity 2017.4.32f1
     
  20. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    May be. Gradle file in asset is not always needed. Need test
     
  21. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Double library. Check it: remove Assets/Plugins/Android/support-v4-26.1.0.aar
     
  22. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Deleted the support v4 .aar file.

    Now getting:
    stderr[
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle$Delegate;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle$DelegateProvider;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle$SlideDrawable;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$1;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$OnRequestPermissionsResultCallback;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$SharedElementCallback21Impl;

    I believe those files got added with your plugin no?
     
  23. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    I deleted all of the "support" files and it built!

    Now I am seeing 2 new permissions at install:

    Privacy:
    modify or delete the contents of your USB storage
    read the contents of your USB storage

    Device access:
    Run at startup

    Are those required? Off to test!
     
  24. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Permission USB storage need for work with Gallery. If you no use this, you can remove <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> in Assets\Plugins\Android\MobileLocalNotifications\AndroidManifest.xml
     
  25. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Howdy!

    A couple other things:
    1) All notifications are working as expected other than if I reboot my Android device. Tried OS 4.4.2, 5.1.1, 8.0.0. If this isn't working, can I remove the intent and permission for RECEIVE_BOOT_COMPLETED without issue? DO I just delete the manifest, or individual lines?
    2) On a couple of my devices, there is a white square for the notification icon (sometimes it is a secondary small icon along with the standard game icon). Is there a place to change that tiny icon?

    Thanks again for your help!
     
  26. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi!
    Permission RECEIVE_BOOT_COMPLETED need for after reboot. If you remove this permission, after reboot will not work. Check in apk file this permission, and <action android:name="android.intent.action.BOOT_COMPLETED" /> in Assets\Plugins\Android\MobileLocalNotifications\AndroidManifest.xml. On my 4 devices recovery of notifications after reboot is good work
     
  27. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Yup, it's in my apk (although the manifest file has some garbage in it). The manifest in the root directory of apk right?

    All 3 of my devices it does not work. Here is the manifest file from plugin that is in my project:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="ru.LittleStories.LocalNotificationsLib"
    android:versionCode="1"
    android:versionName="1.0" >
    <application>
    <receiver android:name="ru.LittleStories.LocalNotifications.AndroidNativeNotifications" android:enabled="false">
    <intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>>
    </receiver>
    </application>
    <!-- permission required to automatically restart a repeating alarm if the user reboots the device -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <!-- permission required for GALLERY only! -->
    <!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
    </manifest>
     
  28. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    2 questiion. README.txt or forum thread contains instruction

     
    breban1 likes this.
  29. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hmm. Logs on devices without errors?
     
  30. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    Nothing in debug log that I can see after I set notification. It works without reboot. Is there a verbose bool in plugin?
     
  31. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    breban1 likes this.
  32. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
  33. breban1

    breban1

    Joined:
    Jun 7, 2016
    Posts:
    194
    I obv. skimmed the docs, but missed the init. Wasn't calling InitNotifications(), reboot works now sorry for the false alarm.

    Request: Maybe put this class in a singleton w/auto init? Or lazy init with schedule/cancel/etc. Or at least a debuglog warning when scheduling without initting. I'm going to do that to make it less error prone.

    Thanks again for a great asset! Review time!
     
  34. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi!
    InitNotifications need for iOS only. If you call SendNotification without Init, Initnotification automatically started, but on iOS you see window with permission. Programmist select at what point and for whom to call this window.
     
  35. Senthil_Cmgt

    Senthil_Cmgt

    Joined:
    Sep 19, 2019
    Posts:
    9
    Hi !
    Local notification works properly when app is open or app is in Background, But when app is closed in Android 9, its not working and we are getting following error.

    ~ Channel is unrecoverably broken and will be disposed!
     
  36. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi.
    Happy New Year!
    Please, check this demo version on your device https://www.dropbox.com/s/i7i0nesa54aw8ns/MobileLocalNotifications.apk?dl=0

    P.S. What is your device?
     
  37. Senthil_Cmgt

    Senthil_Cmgt

    Joined:
    Sep 19, 2019
    Posts:
    9
  38. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi! You check new demo version?
     
  39. BenWilles

    BenWilles

    Joined:
    Mar 9, 2018
    Posts:
    41
    Hi, is this up to date and working with all iOS emojis?
     
  40. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hello
    Sorry, but I don't know. The plugin has no limits, only the font and the operating system are limited