Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

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

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

  1. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    The sample is at Assets/UTNotifications/Sample (there is a sample scene and appropriate script). The demo server is at Assets/UTNotifications/Editor/DemoServer. The DemoServer configuration steps are described in the manual.

    Best regards,
    Yuriy, Universal Tools team.
     
  2. Laguna_Seca

    Laguna_Seca

    Joined:
    Mar 13, 2014
    Posts:
    156
    To be honest, I still do not understand why I need a server. Should FCM plugin be installed separately? If so, what's the point in the settings? Такие вот дела)
     
  3. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    DemoServer is only needed in case you'd like to send push notifications, local notifications don't require any (working with both is demonstrated in the sample scene mentioned).

    Besides, the complete API Reference can be found here: http://universal-tools.github.io/UTNotifications/html_1.7/class_u_t_notifications_1_1_manager.html

    Best regards,
    Yuriy, Universal Tools team.
     
  4. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    99
    Hi, I have 2 questions:
    Is there a way to get the notification time to display on android (not tested yet on iOS but I think the time is mandatory there) ?
    Is there a way to add a time to auto cancel the notification (Ex: I want to display a notification that auto-hide 10 minutes after) ?

    thanks anyway nice job on this plugin :)
     
  5. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Sorry, I somehow managed to miss your message.

    1. Is there a way to get the notification time to display on android
    Yes, but you'll have to modify the native plugin. See Assets/UTNotifications/Editor/Android/NativePluginSource/utnotifications/src/main/java/universal/tools/notifications/Manager.java,
    private static android.app.Notification buildNotification(final Context context, final UTNotification notification, final Bitmap bitmap)

    2. Is there a way to add a time to auto cancel the notification
    Possible in Android (again modifying the native plugin will be required) by creating a separate "alarm" with your own handler to hide a notification. I don't think it's possible in iOS though.

    Best regards,
    Yuriy, Universal Tools team.
     
  6. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    99
    Thanks for your answers
    I've modified Manager for the timestamps and it works now

    If anyone interested, I just added:

    builder.setWhen(System.currentTimeMillis());
    builder.setShowWhen(true);
    on line 740


    For the autohide I'll try to find a solution later.
     
    Yuriy-Ivanov likes this.
  7. Yuriy-Ivanov

    Yuriy-Ivanov

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

    UTNotifications 1.8 has been upgraded from its Beta and released and is now available in Unity Asset Store. A number of improvements has been introduced during the Beta period.
    The update's primary focus is switching to the "pure" FCM while keeping the core principle not to require overriding the main Android Activity (unlike Firebase SDK) and so it's still well compatible with other plugins and custom Android Activities.
    It supports the latest versions of Unity, Android, iOS, UWP with various configuraions and all the appropriate toolchains. It also adds a number of features.

    Changelog:
    - Unity 2019.2.5b5, Android Studio 3.4, Android SDK 29, Play Services Resolver 1.2.117, Google Play Services 49, Android Support Library 47.0.0, and other latest components to release date are supported
    - List of currently scheduled notifications can be retrieved
    - Push notifications initialization failures can be handled
    - DemoServer now supports TLS v1.2 to connect to push notifications providers servers
    - Android: No more AndroidManifest.xml patching
    - Android: FCM Topics support
    - Android: Automated notifications grouping on Android 7.0+
    - Android: Exact-time scheduled notifications support (see settings)
    - Android: Timer type is now configurable (see settings)
    - Large number of other fixes and improvements

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Jun 19, 2019
  8. jun_t_sf

    jun_t_sf

    Joined:
    Jun 14, 2017
    Posts:
    8
    Hello, Yuriy.

    I've a problem when trying to change Unity .NET Framework from 3.5 (deprecated) to 4.x

    I tried to added the references to solution but not worked. (Unity not let me do it)

    Visual Studio 2017 (15.9.13)
    UTNotifications 1.7.4
    Unity 2018.4.2f1

    I can temporary fix this by using "#if false" at those block of code. But I'm afraid that this can effect somethings when building an app.
    Does your asset 1.8 fix this? -> If, then I'll download the new one.
    Or what should I do?

    Thank you very much.
     
  9. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Yes, 1.8 fixes that (and a number of other things). Please update.

    Best regards,
    Yuriy, Universal Tools team.
     
  10. jun_t_sf

    jun_t_sf

    Joined:
    Jun 14, 2017
    Posts:
    8
    Thank you very much!
    I'll try it.
     
  11. jun_t_sf

    jun_t_sf

    Joined:
    Jun 14, 2017
    Posts:
    8
    Hello again, Yuriy.

    Is this a bug?
    It warn as error in Editor.

    Did you forgot to set Initialized to true in DummyManagerImpl? (1.7.4 does but 1.8 not)
     
  12. Yuriy-Ivanov

    Yuriy-Ivanov

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

    No, it is not a bug. In fact, the initialization logic and its validation has been updated internally, to make sure any functionality that requires initialization is only accessable in case if the initialization was performed successfully first.
    As Dummy implementation (f.e. in Desktop builds or in Unity Editor) is not functional, it's been made uniform with the rest platforms, so you can have a single logic of checking the returned value of Manager.Instance.Initialize or Manager.Instance.Initialized property before using any of UTNotifications functionality across all platforms, and validate it in unsupported platforms too.
    In the same time, UTNotifications guarantees that nothing bad would happen if you still try to access any of its API with the manager non-initialized: you'll only get this warning.

    Short answer: it's by design.

    Best regards,
    Yuriy, Universal Tools team.
     
  13. jun_t_sf

    jun_t_sf

    Joined:
    Jun 14, 2017
    Posts:
    8
    Oops, sorry for misunderstanding.
    Thank you for your answer.
     
  14. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    192
    Hello Yuriy
    I need to send notification in my app also if the app is not open. this sdk can help me?
     
  15. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
  16. essoperagma

    essoperagma

    Joined:
    Dec 1, 2016
    Posts:
    6
    Hi Yuriy,
    Everytime I hit "Build" button, plugin tells me that I need to resolve dependencies. But they are already resolved.

    I am using a mainTemplate.gradle file to enable multi-dex builds. But in "Android Resolver Settings", I don't have "Patch mainTemplate.gradle" checked. So my template file does not contain any library names. All the aar files are located in "Assets/Plugins/Android" folder.

    During build, plugin checks if mainTemplate.gradle exists. If yes, it looks inside for required dependencies. However, dependencies don't have to be listed there. So that warning pops up.

    I fixed my project by editing "AndroidBuildPreprocessor.cs", but it would be nice if this case was officially covered.
    Thanks.
     
  17. Laguna_Seca

    Laguna_Seca

    Joined:
    Mar 13, 2014
    Posts:
    156
    Hello! PostLocalNotification works well for me but scheduleNotification does not work.
    What could be the problem and what am I missing?

    Code (CSharp):
    1. public void InitializeUTNotification()
    2.         {
    3.  
    4.             bool initialized = Manager.Instance.Initialize(true, 0 , false);
    5.  
    6.             Debug.Log("UTNotifications Initialize: " + initialized);
    7.  
    8.             if (initialized)
    9.             {
    10.                 // Clears the application icon badge.
    11.                 Manager.Instance.SetBadge(0);
    12.             }
    13.  
    14.        
    15.         }
    16.  
    17.  
    18. void Start()
    19.         {
    20.             InitializeUTNotification();
    21.  
    22.             StartCoroutine(Tesc());
    23.  
    24.             DateTime date1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 55, 00);
    25.             DateTime date2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 56, 00);
    26.  
    27.         }
    28.  
    29.         IEnumerator Tesc()
    30.         {
    31.             yield return new WaitForSeconds(30);
    32.  
    33.             //CreateLocalNotification("gfgfg", "gfgfg");
    34.  
    35.             Manager.Instance.PostLocalNotification("gfgfg", "gfgfg", 1);
    36.             Manager.Instance.ScheduleNotificationRepeating(50,10, "sssssss", "ssssssssssss", 2);
    37.             Manager.Instance.ScheduleNotification(60, "zzzzzzzzzzzzzzzzzzzzz", "zzzzzzzzzzzzzzz", 3);
    38.         }
     
    Last edited: Jun 24, 2019
  18. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Thank you for these details, we indeed didn't check the case when there is mainTemplate.gradle file but "Patch mainTemplate.gradle" is disabled. We'll definitely fix it for your use case. Sorry for that inconvenience.

    Best regards,
    Yuriy, Universal Tools team.
     
    essoperagma likes this.
  19. Yuriy-Ivanov

    Yuriy-Ivanov

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

    I can only imagine it happen in Android when the app gets force-stopped: either you force-stop it (minimizing or normal quitting such as Application.Quit() is alright), or the system force-stops it - f.e. there is a number of cheap Android devices with limited battery capacity that force-stop any non-whitelisted application as soon as all its Activities get finished. May I find out your target device model and specific reproduction steps?

    Thank you.

    Best regards,
    Yuriy, Universal Tools team.
     
  20. Laguna_Seca

    Laguna_Seca

    Joined:
    Mar 13, 2014
    Posts:
    156
    I think the problem was in the libraries. Now I try to update everything manually. Thanks for the answer.
     
  21. Laguna_Seca

    Laguna_Seca

    Joined:
    Mar 13, 2014
    Posts:
    156
    2121.png
    Should it work with this? Now PostLocalNotification is not working))

    I just run and only local comes. I run on Xiaomi MI A1 This is not a very weak device.
     
    Last edited: Jun 24, 2019
  22. SamuelAmco

    SamuelAmco

    Joined:
    Jun 16, 2018
    Posts:
    4
    Hi,

    Can you help me, I've just bought your asset and followed the manual, but I can't seem to build to android due to the following gradle error:

    AAPT: No resource identifier found for attribute 'appComponentFactory' in package 'android'

    I googled the error and it seems like it's related to requiring android API level 28 however I want to support lower API levels. I also tried changing the Android support lib level in UTNotificationSettings but that didn't work either (all of the aar files still say 28.0.0 .. maybe this isn't working?).

    Thanks
     
  23. Yuriy-Ivanov

    Yuriy-Ivanov

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

    I've already replied you be email, but would like to clarify a couple if things.
    1. Unity 2017.1.5 (and newer) do support Android build tools 29-rc2
    2. Targeting Android API 28+ doesn't mean that you stop supporting older versions of Android. In fact, UTNotifications-1.8 - enabled Unity projects support Android API 16+ (Android 4.1 and newer), though indeed require targeting API 28 or newer. Please find a good explanation here: https://docs.microsoft.com/en-us/xa...amentals/android-api-levels?tabs=macos#target and here https://docs.microsoft.com/en-us/xa...mentals/android-api-levels?tabs=macos#minimum.
    3. The option in UTNotifications settings works, but it only allows increasing the version to something newer than 28.0.0. There is a separate file in the asset that requests 28.0.0+ version regardless of what you choose in the asset settings, as otherwise our native plugin wouldn't work (it requires at least 28.0.0). So it's by design.

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Jun 26, 2019
  24. Yuriy-Ivanov

    Yuriy-Ivanov

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

    I'd suggest you to upgrade to UTNotifications 1.8 as the first thing to try. Xiaomi Mi A1 itself is totally fine, in fact it's my primary dev/test Android device (though we have some other models too). I saw the details in the email you've sent, thank you for that, I'll take a good look at it and then reply with any ideas.

    Best regards,
    Yuriy, Universal Tools team.
     
  25. SamuelAmco

    SamuelAmco

    Joined:
    Jun 16, 2018
    Posts:
    4
    Hi Yuri,

    In the end I modified the ProjectSettings.asset file manually to update the android API target to 28 since it wasn't showing as an option in the UI. That seemed to fix the problem.

    Thanks for your help
     
  26. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Glad it helped!

    Best regards,
    Yuriy, Universal Tools team.
     
  27. Alex_Valahanovich

    Alex_Valahanovich

    Joined:
    Mar 10, 2017
    Posts:
    1
    Привет. У меня есть ошибки для сборки IOS. Unity 2019.1.8f1. version plugin 1.8.0
    [ATTACH = полный] 443879 [/ ATTACH]
     

    Attached Files:

  28. Laguna_Seca

    Laguna_Seca

    Joined:
    Mar 13, 2014
    Posts:
    156
    How to create a push that will be repeated every day allowing at 15.00? Provided that I can not run at 15.00 but at any other time.
     
    Last edited: Jul 1, 2019
  29. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Здравствуйте. Это бага (известная) в Unity, этот файл на самом деле находится в другом месте в ассете. Удалите Assets/UTNotifications/Src/iOS/IOSBuildPostprocessor.cs и перезапустите Unity. Затем импортируйте UTNotifications заново. Этот файл должен находится в Assets/UTNotifications/Src/iOS/Editor.

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

    Yuriy-Ivanov

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

    Easy, f.e.
    Code (CSharp):
    1. System.DateTime now = System.DateTime.Now;
    2. System.DateTime firstFireDateTime = new System.DateTime(now.Year, now.Month, now.Day, 15, 0, 0);
    3. if (firstFireDateTime < now)
    4. {
    5.     firstFireDateTime = firstFireDateTime.AddDays(1);
    6. }
    7. UTNotifications.Manager.Instance.ScheduleNotificationRepeating(firstFireDateTime, UTNotifications.TimeUtils.DaysToSeconds(1), "Title", "Text", id);
    Best regards,
    Yuriy, Universal Tools team.
     
  31. Garrettec

    Garrettec

    Joined:
    Nov 26, 2012
    Posts:
    80
    @Yuriy-Ivanov Hi! I have an issue with a package (version 1.8) and Unity 2019.1.8
    On android game crashing after the first launch and after the second one working fine (all notifications are working too).
    What can be the problem? By the way. Game is not crashing with package 1.7.4.
    Thanks!
    Here is the logcat :

    Code (CSharp):
    1.     --------- beginning of crash
    2. 2019-07-03 17:57:49.087 31747-31747/? E/AndroidRuntime: FATAL EXCEPTION: main
    3.     Process: com.drasticfun.splashrush_android, PID: 31747
    4.     java.lang.RuntimeException: Unable to instantiate service universal.tools.notifications.FCMService: java.lang.ClassNotFoundException: Didn't find class "universal.tools.notifications.FCMService" on path: DexPathList[[zip file "/data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/base.apk"],nativeLibraryDirectories=[/data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/lib/arm, /data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
    5.        at android.app.ActivityThread.handleCreateService(ActivityThread.java:3552)
    6.        at android.app.ActivityThread.access$1400(ActivityThread.java:200)
    7.        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689)
    8.        at android.os.Handler.dispatchMessage(Handler.java:106)
    9.        at android.os.Looper.loop(Looper.java:201)
    10.        at android.app.ActivityThread.main(ActivityThread.java:6806)
    11.        at java.lang.reflect.Method.invoke(Native Method)
    12.        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
    13.        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
    14.     Caused by: java.lang.ClassNotFoundException: Didn't find class "universal.tools.notifications.FCMService" on path: DexPathList[[zip file "/data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/base.apk"],nativeLibraryDirectories=[/data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/lib/arm, /data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
    15.         at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
    16.         at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    17.         at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    18.         at android.app.AppComponentFactory.instantiateService(AppComponentFactory.java:103)
    19.         at android.support.v4.app.CoreComponentFactory.instantiateService(CoreComponentFactory.java:68)
    20.         at android.app.ActivityThread.handleCreateService(ActivityThread.java:3547)
    21.         at android.app.ActivityThread.access$1400(ActivityThread.java:200)
    22.         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1689)
    23.         at android.os.Handler.dispatchMessage(Handler.java:106)
    24.         at android.os.Looper.loop(Looper.java:201)
    25.         at android.app.ActivityThread.main(ActivityThread.java:6806)
    26.         at java.lang.reflect.Method.invoke(Native Method)
    27.         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
    28.         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
    29.         Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/messaging/FirebaseMessagingService;
    30.         at java.lang.VMClassLoader.findLoadedClass(Native Method)
    31.         at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
    32.         at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
    33.                 ... 12 more
    34.      Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.messaging.FirebaseMessagingService" on path: DexPathList[[zip file "/data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/base.apk"],nativeLibraryDirectories=[/data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/lib/arm, /data/app/com.drasticfun.splashrush_android-NeePha9eXfwkYq0vz2Yumg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
    35.        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
    36.        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    37.        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    38.                ... 15 more
     
  32. Yuriy-Ivanov

    Yuriy-Ivanov

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

    It seams that the first time you was missing some of the required Android libraries (maybe Play Services Resolver didn't resolve them yet then). On the next build the libraries were there, so it worked fine.
    In the same time, I can't be 100% sure what happened the first time really: it just wasn't able to load class universal.tools.notifications.FCMService which is defined in Assets/Plugins/Android/utnotifications.aar, because class com.google.firebase.messaging.FirebaseMessagingService wasn't found (it's defined in one the dependencies), but why it wasn't found is not clear from the stack trace. Please let me know if it's ever reproduced again.

    Best regards,
    Yuriy, Universal Tools team.
     
  33. Garrettec

    Garrettec

    Joined:
    Nov 26, 2012
    Posts:
    80
    Yuriy, I believe it was a little misunderstanding, the crash occur only after first application launch. Second launch for this exact build is not crashing any more. But if we remove and install the app again - it will crash again during the first launch. If it is more convenient, we can provide you more info via Email or in private messages.
     
  34. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Oh wow, that's a big surprise indeed! I'd be glad if you could provide me with some more details please, here or in private messages or by email, whatever you prefer.
    I'll need to know:
    - Your version of Unity
    - What build system you're using (Gradle/Internal)
    - If you have any minification enabled, and if yes, whether it's Proguard or Gradle
    - Your target Android API
    - Android version your test device is running
    - List of all files and folders in your Assets/Plugins/Android
    - Specific call to UTNotifications API causing that exception
    - Any other details which can be important to reproduce the issue (as it has never been reproduced for us)

    Best regards,
    Yuriy, Universal Tools team.
     
    Garrettec likes this.
  35. AlexKhundar

    AlexKhundar

    Joined:
    Mar 14, 2017
    Posts:
    19
    Hi Yuriy and hi everyone,

    My issue seems to be about the Play Services Resolver. I recently updated UTNotifications to 1.8 from Asset Store. I can't build and run on Android : I have an error message. "Error: Android Native Libraries Missing. Required Android libraries are missing. Please make sure Play Services Resolver is successfully invoked [...]".
    I tried to resolve, or Force Resolve, didn't work. Activate or deactivate auto-resolution, didn't work. I updated to Unity 2018.4.3, didn't work...
    Maybe I lack knowledge about Play Services Resolver but right now I am quite lost.

    Thanks for your help !
     
  36. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    You may try resetting the Play Services Resolver settings to defaults and then force-resolving again. Please also see that message: https://forum.unity.com/threads/rel...ications-and-more.333045/page-17#post-4681661 (including the original post), is it not your case?

    If neither of it helps, please send me a list of all files and folders in your Assets/Plugins/Android and separately (if exists) the whole file Assets/Plugins/Android/mainTemplate.gradle, I'll check what's wrong.

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

    markalles21

    Joined:
    Apr 2, 2019
    Posts:
    5
    Hi.
    I get notifications while the app is running on IOS, but I don't want that. Is there some setting I can change or would I have to check manually through code?
    On Android it works as expected and I also saw "ShowNotifications" is default set to "WHEN_CLOSED_OR_IN_BACKGROUND" which should be good I guess.
     
  38. AlexKhundar

    AlexKhundar

    Joined:
    Mar 14, 2017
    Posts:
    19
    Resetting the settings to defaults and force-resolving didn't work. And I don't think I'm in the same case than the link you gave. "Patch mainTemplate.gradle" is checked (as it is by default) and I have .aar files in many directories. Even though I really don't know what differences it makes...

    I uploaded on this post the list of files and folders of the Assets/Plugins/Android folder (and the subfolders) and the mainTemplate.gradle file, which does exist. I just made it a txt to be able to upload it here.

    Thanks for your help.
     

    Attached Files:

  39. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Do you know a way to reproduce it? As actually, iOS should never show notifications while the app is running in foreground, it's even out of apps' control: it just never shows them and that's all. You're the second person to ever report about that issue, and we haven't found a way to reproduce that issue so far. So any help here would be really nice.

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Jul 8, 2019
  40. Yuriy-Ivanov

    Yuriy-Ivanov

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

    A few notes here:
    1. You seem to have a 3rd party asset in your project that causes that mess. As normally Play Services Resolver shouldn't add those plenty of .aars, .jars and so on in your project when mainTemplate.gradle is present, it should just automatically add appropriate dependencies in your mainTemplate.gradle, which is clearly missing any of the required entries. But try updating to 1.8.1 - we've loosened that check about the gradle template in it.
    2. You've got 2 copies of ShortcutBadger. Please delete ShortcutBadger-1.1.21.aar and ShortcutBadger-1.1.21.aar.meta.

    Best regards,
    Yuriy, Universal Tools team.
     
  41. AlexKhundar

    AlexKhundar

    Joined:
    Mar 14, 2017
    Posts:
    19
    Well, I did what you said and it worked. Thanks for all :)
    I'll keep in mind there's a 3rd party which causes a mess...

    Best luck for the future,
    Alex
     
  42. markalles21

    markalles21

    Joined:
    Apr 2, 2019
    Posts:
    5
    Acutally now I don't have it anymore. Will report if the I have it again with more details :)
    Another thing, I created a profile with a custom sound. For some reason the sound is disabled by default on Android. I have to manually enable the sound for this profile in the settings. Is there a way to change this somehow?
     
  43. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Not sure, correct sounds play well in my tests, enabled by default. I'm not sure, but it can somehow be related to system sound settings or something like that. Normally, clean installed application with custom sounds play these sounds well on receiving notifications (of course, if the phone is not in vibration-only mode).

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

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Glad it helped!

    Best regards,
    Yuriy, Universal Tools team.
     
  45. bmorgan-ksg

    bmorgan-ksg

    Joined:
    Dec 13, 2016
    Posts:
    8
    Hi Yuriy, I'm wondering if this was ever followed up on? I am experiencing the exact same issue after recently upgrading to the newest version of UTNotifications and adding Firebase Analytics to my project.
     
  46. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @bmorgan-ksg,

    Yes, the issue was identified and fixed and released in UTNotifications 1.8.1 - please update, it must help. If it doesn't for whatever reason, please contact me by email with more details (the same questions I asked in the original message you've mentioned), I'll help you find the solution.

    Best regards,
    Yuriy, Universal Tools team.
     
  47. DanBarkerSM

    DanBarkerSM

    Joined:
    Mar 7, 2017
    Posts:
    2
    Hi @Yuriy-Ivanov

    I've recently upgraded to Unity 2018.3.6f1 and am having some difficulty getting my Android build to work with UTNotifications 1.8.1 and the latest Firebase plugin - I've created a new project with just these plugins and have the same problem.

    I tried Resolve and Force Resolve (Play Services Resolver 1.2.122) but on building I keep getting the error
    "Error: Android Native Libraries Missing. Required Android libraries are missing. Please make sure Play Services Resolver is successfully invoked [...]".

    Also tried Play Services Resolver 1.2.117 and getting a different error:
    "The attribute application@appComponentFactory=androidx.core.app.CoreComponentFactory in :com.android.support.support-compat-28.0.0: collides with another value"

    I've attached a list of files in Assets/Plugins/Android. I don't have a Assets/Plugins/Android/mainTemplate.gradle file.

    Not sure how to proceed.

    Thanks for you help.
    Dan
     

    Attached Files:

  48. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Thank you, we were able to reproduce that issue with the latest Firebase Unity SDK in a project alongside UTNotifications, it's due to using androidx components in their latest SDK. This error is very simple to fix: in Assets/UTNotifications/Src/Android/Editor/AndroidBuildPreprocessor.cs replace
    Code (CSharp):
    1.                 !PluginExists("com.android.support.support-v4-*.aar"))
    with
    Code (CSharp):
    1.                 !PluginExists("com.android.support.support-v4-*.aar") &&
    2.                 !PluginExists("androidx.legacy.legacy-support-v4-*.aar"))
    In the same time it can be not enough, as we found out, at least some of the components of the latest Firebase SDK (such as Analytics) break our native Android class handling incoming FCM notifications (it crashes on receiving any FCM notification). We're working on a fix at the moment, so far there is no solution, I'm sorry.

    UPDATE: It's fixed in UTNotifications 1.8.2

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Aug 16, 2019
  49. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Last edited: Jul 23, 2019
  50. DanBarkerSM

    DanBarkerSM

    Joined:
    Mar 7, 2017
    Posts:
    2
    Hi @Yuriy-Ivanov

    Thank you very much for your help and the fast fix.

    Its all working now :)

    Best Regards
    Dan
     
    Yuriy-Ivanov likes this.
unityunity