Search Unity

[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
    Hi satoriGames,

    The feature you need can be done in Android, but not in iOS (and most likely not in Windows Phone). It's not supported by UTNotifications directly, but you can add it as we provide source code of the native plugins.

    Please also note, that DemoServer is not supposed to be used as a production server, it's just an example showing a way for posting push notifications to each of the push providers.

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

    codenameentertainment

    Joined:
    Apr 21, 2016
    Posts:
    3
    Hi Yuriy,

    Trying to build for Android and getting the following error converting classes into dex format.

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:\Program Files\Java\jdk1.7.0_60\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

    stderr[
    warning: Ignoring InnerClasses attribute for an anonymous inner class
    (org.apache.commons.httpclient.HttpMethodBase$1) that doesn't come with an
    associated EnclosingMethod attribute. This class was probably produced by a
    compiler that did not target the modern .class file format. The recommended
    solution is to recompile the class from source, using an up-to-date compiler
    and without specifying any "-target" type options. The consequence of ignoring
    this warning is that reflective operations on this class will incorrectly
    indicate that it is *not* an inner class.
    warning: Ignoring InnerClasses attribute for an anonymous inner class
    (org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1) that doesn't come with an
    associated EnclosingMethod attribute. This class was probably produced by a
    compiler that did not target the modern .class file format. The recommended
    solution is to recompile the class from source, using an up-to-date compiler
    and without specifying any "-target" type options. The consequence of ignoring
    this warning is that reflective operations on this class will incorrectly
    indicate that it is *not* an inner class.
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JacksonAnnotation;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JacksonAnnotationsInside;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JacksonInject;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JsonAnyGetter;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JsonAnySetter;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JsonAutoDetect$1;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JsonAutoDetect$Visibility;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JsonAutoDetect;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/fasterxml/jackson/annotation/JsonBackReference;

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at SDKMain.main(SDKMain.java:129)
    Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
    ... 9 more
    ]
    stdout[
    processing archive bin\classes.jar...
    processing com/unity3d/player/a$1.class...
    processing com/unity3d/player/a$2.class...
    processing com/unity3d/player/a$a.class...
    processing com/unity3d/player/a.class...
    processing com/unity3d/player/b$1.class...
    processing com/unity3d/player/b$2.class...
    processing com/unity3d/player/b.class...
    processing com/unity3d/player/c.class...
    processing com/unity3d/player/d$1.class...
    processing com/unity3d/player/d$2.class...
    processing com/unity3d/player/d.class...
    processing com/unity3d/player/e.class...
    processing com/unity3d/player/f.class...
    processing com/unity3d/player/g.class...
    processing com/unity3d/player/h.class...
    processing com/unity3d/player/i.class...
    processing com/unity3d/player/j.class...
    processing com/unity3d/player/k$1.class...
    processing com/unity3d/player/k$2$1$1.class...
    processing com/unity3d/player/k$2$1.class...
    processing com/unity3d/player/k$2.class...
    processing com/unity3d/player/k.class...
    processing com/unity3d/player/l$1.class...
    processing com/unity3d/player/l.class...
    processing com/unity3d/player/m.class...
    processing com/unity3d/player/n$1.class...
    processing com/unity3d/player/n.class...
    processing com/unity3d/player/o.class...
    processing com/unity3d/player/p$1.class...
    processing com/unity3d/player/p.class...
    processing com/unity3d/player/NativeLoader.class...
    processing com/unity3d/player/q.class...
    processing com/unity3d/player/ReflectionHelper$1.class...
    processing com/unity3d/player/ReflectionHelper$a.class...
    processing com/unity3d/player/ReflectionHelper.class...
    processing com/unity3d/player/r.class...
    processing com/unity3d/player/s$1.class...
    processing com/unity3d/player/s$2.class...
    processing com/unity3d/player/s$3.class...
    processing com/unity3d/player/s.class...
    processing com/unity3d/player/t.class...
    processing com/unity3d/player/u.class...
    processing com/unity3d/player/UnityPlayer$1.class...
    processing com/unity3d/player/UnityPlayer$2.class...
    processing com/unity3d/player/UnityPlayer$4.class...
    processing com/unity3d/player/UnityPlayer$5.class...
    processing com/unity3d/player/UnityPlayer$6.class...
    processing com/unity3d/player/UnityPlayer$7.class...
    processing com/unity3d/player/UnityPlayer$8.class...
    processing com/unity3d/player/UnityPlayer$9.class...
    processing com/unity3d/player/UnityPlayer$10.class...
    processing com/unity3d/player/UnityPlayer$11.class...
    processing com/unity3d/player/UnityPlayer$12.class...
    processing com/unity3d/player/UnityPlayer$13.class...
    processing com/unity3d/player/UnityPlayer$14.class...
    processing com/unity3d/player/UnityPlayer$3.class...
    processing com/unity3d/player/UnityPlayer$15$1.class...
    processing com/unity3d/player/UnityPlayer$15.class...
    processing com/unity3d/player/UnityPlayer$16.class...
    processing com/unity3d/player/UnityPlayer$17.class...
    processing com/unity3d/player/UnityPlayer$18.class...
    processing com/unity3d/player/UnityPlayer$19.class...
    processing com/unity3d/player/UnityPlayer$20.class...
    processing com/unity3d/player/UnityPlayer$a.class...
    processing com/unity3d/player/UnityPlayer$b.class...
    processing com/unity3d/player/UnityPlayer$c.class...
    processing com/unity3d/player/UnityPlayer.class...
    processing com/unity3d/player/UnityPlayerActivity.class...
    processing com/unity3d/player/UnityPlayerNativeActivity.class...
    processing com/unity3d/player/UnityPlayerProxyActivity.class...
    processing com/unity3d/player/v.class...
    processing com/unity3d/player/UnityWebRequest.class...
    processing com/unity3d/player/w$1.class...
    processing com/unity3d/player/w.class...
    processing com/unity3d/player/WWW.class...
    processing org/fmod/FMODAudioDevice.class...
    processing org/fmod/a.class...
    processing bitter/jnibridge/JNIBridge$a.class...
    processing bitter/jnibridge/JNIBridge.class...
    processing bin\classes\.\android\support\v4\Manifest$permission.class...
    processing bin\classes\.\android\support\v4\Manifest.class...
    processing bin\classes\.\android\support\v4\R$anim.class...
    processing bin\classes\.\android\support\v4\R$attr.class...
    processing bin\classes\.\android\support\v4\R$bool.class...
    processing bin\classes\.\android\support\v4\R$color.class...
    processing bin\classes\.\android\support\v4\R$dimen.class...
    processing bin\classes\.\android\support\v4\R$drawable.class...
    processing bin\classes\.\android\support\v4\R$id.class...
    processing bin\classes\.\android\support\v4\R$integer.class...
    processing bin\classes\.\android\support\v4\R$layout.class...
    processing bin\classes\.\android\support\v4\R$raw.class...
    processing bin\classes\.\android\support\v4\R$string.class...
    processing bin\classes\.\android\support\v4\R$style.class...
    processing bin\classes\.\android\support\v4\R$styleable.class...
    processing bin\classes\.\android\support\v4\R.class...
    processing bin\classes\.\android\support\v7\appcompat\Manifest$permission.class...
    processing bin\classes\.\android\support\v7\appcompat\Manifest.class...
    processing bin\classes\.\android\support\v7\appcompat\R$anim.class...
    processing bin\classes\.\android\support\v7\appcompat\R$attr.class...
    processing bin\classes\.\android\support\v7\appcompat\R$bool.class...
    processing bin\classes\.\android\support\v7\appcompat\R$color.class...
    processing bin\classes\.\android\support\v7\appcompat\R$dimen.class...
    processing bin\classes\.\android\support\v7\appcompat\R$drawable.class...
    processing bin\classes\.\android\support\v7\appcompat\R$id.class...
    processing bin\classes\.\android\support\v7\appcompat\R$integer.class...
    processing bin\classes\.\android\support\v7\appcompat\R$layout.class...
    processing bin\classes\.\android\support\v7\appcompat\R$raw.class...
    processing bin\classes\.\android\support\v7\appcompat\R$string.class...
    processing bin\classes\.\android\support\v7\appcompat\R$style.class...
    processing bin\classes\.\android\support\v7\appcompat\R$styleable.class...
    processing bin\classes\.\android\support\v7\appcompat\R.class...
    processing bin\classes\.\com\facebook\Manifest$permission.class...
    processing bin\classes\.\com\facebook\Manifest.class...
    processing bin\classes\.\com\facebook\R$anim.class...
    processing bin\classes\.\com\facebook\R$attr.class...
    processing bin\classes\.\com\facebook\R$bool.class...
    processing bin\classes\.\com\facebook\R$color.class...
    processing bin\classes\.\com\facebook\R$dimen.class...
    processing bin\classes\.\com\facebook\R$drawable.class...
    processing bin\classes\.\com\facebook\R$id.class...
    processing bin\classes\.\com\facebook\R$integer.class...
    processing bin\classes\.\com\facebook\R$layout.class...
    processing bin\classes\.\com\facebook\R$raw.class...
    processing bin\classes\.\com\facebook\R$string.class...
    processing bin\classes\.\com\facebook\R$style.class...
    processing bin\classes\.\com\facebook\R$styleable.class...
    processing bin\classes\.\com\facebook\R.class...
    processing bin\classes\.\com\google\android\gms\base\Manifest$permission.class...
    processing bin\classes\.\com\google\android\gms\base\Manifest.class...
    processing bin\classes\.\com\google\android\gms\base\R$anim.class...
    processing bin\classes\.\com\google\android\gms\base\R$attr.class...
    processing bin\classes\.\com\google\android\gms\base\R$bool.class...
    processing bin\classes\.\com\google\android\gms\base\R$color.class...
    processing bin\classes\.\com\google\android\gms\base\R$dimen.class...
    processing bin\classes\.\com\google\android\gms\base\R$drawable.class...
    processing bin\classes\.\com\google\android\gms\base\R$id.class...
    processing bin\classes\.\com\google\android\gms\base\R$integer.class...
    processing bin\classes\.\com\google\android\gms\base\R$layout.class...
    processing bin\classes\.\com\google\android\gms\base\R$raw.class...
    processing bin\classes\.\com\google\android\gms\base\R$string.class...
    processing bin\classes\.\com\google\android\gms\base\R$style.class...
    processing bin\classes\.\com\google\android\gms\base\R$styleable.class...
    processing bin\classes\.\com\google\android\gms\base\R.class...
    processing bin\classes\.\com\google\android\gms\drive\Manifest$permission.class...
    processing bin\classes\.\com\google\android\gms\drive\Manifest.class...
    processing bin\classes\.\com\google\android\gms\drive\R$anim.class...
    processing bin\classes\.\com\google\android\gms\drive\R$attr.class...
    processing bin\classes\.\com\google\android\gms\drive\R$bool.class...
    processing bin\classes\.\com\google\android\gms\drive\R$color.class...
    processing bin\classes\.\com\google\android\gms\drive\R$dimen.class...
    processing bin\classes\.\com\google\android\gms\drive\R$drawable.class...
    processing bin\classes\.\com\google\android\gms\drive\R$id.class...
    processing bin\classes\.\com\google\android\gms\drive\R$integer.class...
    processing bin\classes\.\com\google\android\gms\drive\R$layout.class...
    processing bin\classes\.\com\google\android\gms\drive\R$raw.class...
    processing bin\classes\.\com\google\android\gms\drive\R$string.class...
    processing bin\classes\.\com\google\android\gms\drive\R$style.class...
    processing bin\classes\.\com\google\android\gms\drive\R$styleable.class...
    processing bin\classes\.\com\google\android\gms\drive\R.class...
    processing bin\classes\.\com\google\android\gms\games\Manifest$permission.class...
    processing bin\classes\.\com\google\android\gms\games\Manifest.class...
    processing bin\classes\.\com\google\android\gms\games\R$anim.class...
    processing bin\classes\.\com\google\android\gms\games\R$attr.class...
    processing bin\classes\.\com\google\android\gms\games\R$bool.class...
    processing bin\classes\.\com\google\android\gms\games\R$color.class...
    processing bin\classes\.\com\google\android\gms\games\R$dimen.class...
    processing bin\classes\.\com\google\android\gms\games\R$drawable.class...
    processing bin\classes\.\com\google\android\gms\games\R$id.class...
    processing bin\classes\.\com\google\android\gms\games\R$integer.class...
    processing bin\classes\.\com\google\android\gms\games\R$layout.class...
    processing bin\classes\.\com\google\android\gms\games\R$raw.class...
    processing bin\classes\.\com\google\android\gms\games\R$string.class...
    processing bin\classes\.\com\google\android\gms\games\R$style.class...
    processing bin\classes\.\com\google\android\gms\games\R$styleable.class...
    processing bin\classes\.\com\google\android\gms\games\R.class...
    processing bin\classes\.\com\google\android\gms\Manifest$permission.class...
    processing bin\classes\.\com\google\android\gms\Manifest.class...
    processing bin\classes\.\com\google\android\gms\nearby\Manifest$permission.class...
    processing bin\classes\.\com\google\android\gms\nearby\Manifest.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$anim.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$attr.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$bool.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$color.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$dimen.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$drawable.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$id.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$integer.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$layout.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$raw.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$string.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$style.class...
    processing bin\classes\.\com\google\android\gms\nearby\R$styleable.class...
    processing bin\classes\.\com\google\android\gms\nearby\R.class...
    processing bin\classes\.\com\google\android\gms\plus\Manifest$permission.class...
    processing bin\classes\.\com\google\android\gms\plus\Manifest.class...
    processing bin\classes\.\com\google\android\gms\plus\R$anim.class...
    processing bin\classes\.\com\google\android\gms\plus\R$attr.class...
    processing bin\classes\.\com\google\android\gms\plus\R$bool.class...
    processing bin\classes\.\com\google\android\gms\plus\R$color.class...
    processing bin\classes\.\com\google\android\gms\plus\R$dimen.class...
    processing bin\classes\.\com\google\android\gms\plus\R$drawable.class...
    processing bin\classes\.\com\google\android\gms\plus\R$id.class...
    processing bin\classes\.\com\google\android\gms\plus\R$integer.class...
    processing bin\classes\.\com\google\android\gms\plus\R$layout.class...
    processing bin\classes\.\com\google\android\gms\plus\R$raw.class...
    processing bin\classes\.\com\google\android\gms\plus\R$string.class...
    processing bin\classes\.\com\google\android\gms\plus\R$style.class...
    processing bin\classes\.\com\google\android\gms\plus\R$styleable.class...
    processing bin\classes\.\com\google\android\gms\plus\R.class...
    processing bin\classes\.\com\google\an<message truncated>

    I removed Assets/Plugins/Android/UTNotifications/libs/android-support-v4.jar as suggested in a previous post but it had no effect.

    Any help would be appreciated.

    -David
     
  3. Yuriy-Ivanov

    Yuriy-Ivanov

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

    From your console output, it looks like a conflict in the Google Play Services library (UTNotifications' copy is in Assets/Plugins/google-play-services_lib). Try deleting this folder completely. If it doesn't help, please tell me what other 3rd party assets you use except of UTNotifications, and please show a list of all the files and folders in Assets/Plugins/ directory, so I'll find the exact cause of a native Android libraries conflict.

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

    codenameentertainment

    Joined:
    Apr 21, 2016
    Posts:
    3
    Hi Yuriy,

    Is there an email address I can send that too, it is rather long listing 2600 files and content wise I'm not sure its best posted on a public forum.

    -David
     
  5. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
  6. Nielsww

    Nielsww

    Joined:
    Jun 25, 2013
    Posts:
    10
    Hi Yuriy,

    We where not handling received notifications in this instance. The next issue we encountered was on iOS where we did not receive a deviceToken / registrationId through the UTNotifications plugin. When replacing the line where UTNotifications OnSendRegistrationId is called with the Unity built in NotificationServices.RegisterForNotifications instead we did receive a deviceToken which suggest that this might also be an issue in the UTNotifications code. We have since stopped trying to implement this plugin and have moved on to another one that fortunately worked right away on iOS and Android.
     
  7. Yuriy-Ivanov

    Yuriy-Ivanov

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

    1. I checked HideAllNotifications() in a different configurations and environments, with handling received notifications both disabled and enabled: in my case it just works, always. It seems that your OnNotificationClicked is not called (f.e. your object which handles notification clicks is destroyed with switching a scene or something else). If you could send me an example reproducing the issue to universal.tools.contact@gmail.com, I'd be able to help you very fast (you can leave all the push related configs away - I'll use my own credentials).

    2. The same regarding APNS initialization at iOS - it just works fine. I suppose UTNotifications' APNS is disabled in the asset options. Please check that toggle at Edit -> Project Settings -> UTNotifications -> iOS Settings -> Push Notifications is enabled. If it's not your case, again, a sample reproducing the problem would help a lot.

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Apr 26, 2016
  8. fdfdsgfdgdsg

    fdfdsgfdgdsg

    Joined:
    Feb 8, 2015
    Posts:
    5
    Hi

    This is just to ask on the client side. I have created a python server and used a library for apns. I have successfully sent the notification to the apns server but I did not receive any notification on the device. Is there anything that may have caused it on the client side? I have already added all three listeners but only the OnSendRegistrationId have triggered.

    Some information
    - The certificate used is the same that worked on the demo
    - The pem cert and key used for the server came from the same .p12 certificate
    - The push notification setting for UTNotification IOS is on
    - The push notification setting for XCode capability is on
    - The registration id that came from the OnSendRegistrationId was the one sent as the token hex for the apns
    - I have already Initialized the class - UTNotifications.Manager.Initialize();

    Thank you very much for your time.
     
  9. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Do I understand you correctly: everything worked well when you used DemoServer, and it doesn't work with your python server?
    If yes, then a problem is on your server side, and without seeing the code, I can't tell you what exactly is wrong (you can send it to universal.tools.contact@gmail.com).
    If not, please, at first, make it work with DemoServer, following the manual section "Configuring the Apple Push Notification Service (APNS)" very carefully, step by step. In most cases issues with APNS are caused by a misconfiguration, as this is quite a complicated process.

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

    fdfdsgfdgdsg

    Joined:
    Feb 8, 2015
    Posts:
    5
    Hi thanks for the reply.

    I got it working...

    Everything was correct in the setup except for a needed certificate that was not mentioned in the apple documentation.

    If anyone had the same problem such as mine just download the entrust certificate at

    curl -O https://www.entrust.net/downloads/binary/entrust_2048_ca.cer

    Thank you for the assistance btw.
     
  11. Vallcrist

    Vallcrist

    Joined:
    Aug 24, 2012
    Posts:
    8
    Hello there!

    Recently bought the plugin and everything seems to work perfectly, nice work!

    A question though, how do I setup the android notifications to have multiple lines enabled? Looking on the internet it seems like it's something on the android side, not on the server, so not sure how should I proceed there.
     
  12. Yuriy-Ivanov

    Yuriy-Ivanov

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

    First of all, thank you for using UTNotifications and sorry for a late response.
    Multiline Android notifications will be enabled by default starting from the version 1.6 (which is still in progress). But I've just sent you a patch enabling them with a version 1.5.4 - please find it in the personal messages.

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

    pawwarster

    Joined:
    May 11, 2016
    Posts:
    1
    Hi,

    We have recently bought this plugin.
    We had several issues on how to launch our game after importing the plugin. We are also using official Facebook SDK plugin, we had confilict in Assets/Plugins/google-play-services_lib, and on support-lib in Assets/Plugins/Android. So we had to delete them. Probably it was because Facebook SDK was already referencing them.
    And now our problem:

    the lines of code:

    UTNotifications.Manager notificationsManager = UTNotifications.Manager.Instance;

    notificationsManager.OnSendRegistrationId += NotificationsManager_OnSendRegistrationId;
    notificationsManager.OnNotificationClicked += NotificationsManager_OnNotificationClicked;
    notificationsManager.OnNotificationsReceived += NotificationsManager_OnNotificationsReceived;

    bool result = notificationsManager.Initialize(true, 0, false);

    the initialization of the manager instance always result in false.. so we can't even do the local notifications.
    We have the server for sending pushes, but even when the check's in the options of UTNotifications are unchecked, so
    it shouldn't try to register to any platform PNS, the initialization still fails.
    Do you know any solution to this problem?

    We are using the newest Unity 5.3.4 and the newest version of your plugin.

    Best regards,
    pawwarster
     
  14. Prophet6989

    Prophet6989

    Joined:
    Jul 8, 2012
    Posts:
    37
    Hello

    We have conflict (I gess) with previous plugins. We already use UnityPurchasing and Crashlytics.
    After importing UTNotifications we have error:

    UnityException: Build failure
    Unable to convert classes into dex format. See the Console for details.
    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message)
    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuildPointToConsole (System.String title, System.String message)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, SystemString productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
    UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:176)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    with no additional informative messages in console.
    Googling did not help.

    Did anyone have this error?
     
  15. Yuriy-Ivanov

    Yuriy-Ivanov

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

    If the only plugin except of UTNotifications you use is Facebook SDK, then you didn't have to delete google-play-services_lib, only android support libraries is duplicated. Please try restoring the google play services library. If it doesn't build then, please send us by email a list of all files and folders under Assets/Plugins/Android/ and a file Assets/Plugins/Android/AndroidManifest.xml.

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

    Yuriy-Ivanov

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

    I've already replied you by email, please check your inbox.

    Best regards,
    Yuriy, Universal Tools team.
     
  17. ajaybhojani

    ajaybhojani

    Joined:
    Dec 3, 2013
    Posts:
    7
    hi
    in UT notificaiton confusing in demo server setup.
    Here are the steps , can you please elaborote 3,4 and 5th step.
    Main thing is "Build and run the Demo Server (Fn + F5 in Eclipse in OS X by default). "
    Should i have eclipse installed ?
    Please specify some more detail for android and ios setup


    Apply Credentials and Test

    What is left is to configure the Demo Server. You can use any Java IDE you like. F.e. in Eclipse you can create a new Java project in the A ssets/UTNotifications/DemoServer folder. All the source files and libraries will be imported into it by default.

    1. Open the file

      Assets/UTNotifications/DemoServer/src/DemoServer/PushNotificator.java

    2. Find these lines in it:

      private static final String APN_CERT_PATH = null;

      private static final String APN_CERT_PASSWORD = null;

    3. Replace these nulls by the full path and password of . p12 you created in C onverting

      the aps_development.cer File. The path may also be relative to the Assets/UTNotifications/DemoServer folder. For example:

      private static final String APN_CERT_PATH = "apn_cert.p12";

      private static final String APN_CERT_PASSWORD = "test321";

    4. Build and run the Demo Server (Fn + F5 in Eclipse in OS X by default).

    5. Now let’s save the running server address in the m _webServerAddress variable in file

      Assets/UTNotifications/Sample/SampleUI.cs, like:protected string m_webServerAddress = "http://address:port";I connected an iPad to the same WiFi network as the Demo Server so I used the internal network address of the server here:

    Thank you
     
  18. ajaybhojani

    ajaybhojani

    Joined:
    Dec 3, 2013
    Posts:
    7
    How to setup vps server for UTNotifications for Push notificaiton ?
     
  19. Yuriy-Ivanov

    Yuriy-Ivanov

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

    First of all, thank you for purchasing UTNotifications!

    There are millions of options here. In most cases, push notifications server should be written in the same language as your main game server because push notifications are invoked by a server. If you don't have a game server, it may mean that you also don't have to use push notifications (as notifications are most often produced by a client itself). Then scheduled notifications will work for you.
    Otherwise, please tell me the server language or technology: I'll suggest you some 3rd party libraries for that specific case.

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: May 24, 2016
  20. mlamplmair

    mlamplmair

    Joined:
    Dec 15, 2014
    Posts:
    14
    Hi guys,

    i just started over with this but i have a question: will it also work with google firebase. GCM is soon a part of firebase or?
     
  21. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Yes, we're going to add FCM (Firebase Cloud Messaging) support in a version 1.7 (version 1.6 is currently in production).

    Best regards,
    Yuriy, Universal Tools team.
     
  22. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    can i create windows 10 notifications on runtime?
    can i achieve similar effect for older versions 8/7
    im making unity app, not a game so it will not be fullscreen, and must notify user of events when minimized.
     
  23. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Windows 8.1 and newer (including Windows 10) are supported (Windows Store build).

    Yes, you can do it with UTNotifications.

    Best regards,
    Yuriy, Universal Tools team.
     
  24. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Hello,

    I'm using OneSignal and I need to build a push notification feed list in my app.
    Your plugin support OneSignal about this scenario? How?
    Thanks
     
  25. Yuriy-Ivanov

    Yuriy-Ivanov

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

    UTNotifications implement a common cross-platform API for registering and handling push notifications, but internally we use standard OS specific APIs: APNS on iOS, GCM & ADM on Android, WNS on Windows/Windows Phone. OneSignal allows you sending push notifications of each of these types:
    https://documentation.onesignal.com/docs/using-onesignal-in-your-ios-app
    https://documentation.onesignal.com/docs/using-onesignal-in-your-android-app
    https://documentation.onesignal.com/docs/amazon-native-sdk-overview
    https://documentation.onesignal.com/docs/windows-phone-native-sdk-overview

    Our asset includes the configuration manual and a DemoServer, which shows you how to send notifications of each of this type. After you finish setting up push notifications using the manual and DemoServer, you may use an OneSignal API to register client devices and then send push notifications to them (see https://documentation.onesignal.com/v2.0/docs/server-api-overview) - so OneSignal services will replace our DemoServer as a production server solution.

    Please note, that we don't provide any integration with each of the 3rd party push services such as OneSignal (as there are too many of them to support), so you'll have to integrate it on your own. But in case of any difficulties, feel free to contact us by email and we'll be glad to help you.

    Best regards,
    Yuriy, Universal Tools team.
     
  26. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220


    Thanks for reply.
    But with UTNotification I can handle any notification when it arrive on device from my app and before the user tap on it? In this way I could take it and save in a custom way I want.
    Thanks
     
  27. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Yes, you can handle a list of received (and not only clicked) push notifications using UTNotifications.Manager.Instance.OnNotificationsReceived event. But there are some limitations with it:
    1. This event is called only when your app is running.
    2. When an app is started and there are some notifications received while it hadn't been running, on Windows & Android you'll receive a list of these notifications, but not on iOS. On iOS it will contain only a list of notifications received while an app was already running.

    Best regards,
    Yuriy, Universal Tools team.
     
  28. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    This is a UTNotification plugin limitation or a iOS limitation?
     
  29. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    iOS limitation. Though it should possible to handle any received RAW APNS notifications, we use normal push notifications with APNS, and it's impossible to handle normal APNS push notifications received while the app is not running.
     
  30. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Ok, then can I use UINotification on top of OneSignal plugin with Unity, correct?
     
    Last edited: Jun 7, 2016
  31. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    No, you can use UTNotifications instead of OneSignal Unity plugin (so it will be responsible for entire client side of notifications).

    By the way, what functionality are you missing in OneSignal Unity SDK? Because in most cases it's more convenient and easy to use an official SDK of a service, when you intend to use a service anyway, and the service provides an official Unity SDK. Of course, if you need only push, but not local notifications.

    Best regards,
    Yuriy, Universal Tools team.
     
  32. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    Oh sorry, it's true!

    I need to handle the Onesignal notifications addition data (ie: url link, etc) and I need to handle notification who arrive when the app is open or not.
     
  33. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Then consider using HandleNotification delegate of the OneSignal Unity SDK, it's probably what you need (but, also, probably not - I'm unfortunately not an expert in OneSignal API).

    Best regards,
    Yuriy, Universal Tools team.
     
  34. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    I know it, I'm using HandleNotification by OneSignal but it trigger when the user tap on notification only, OneSignal APIs not have any HandleNotificationReceive when the notification arrive on device if the app is closed too (except for the iOS limitation).
     
  35. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220
    I'm sorry Yuriy but I don't understand a base concept... using UTNotifications instead OneSignal plugin in Unity can I use the OneSignal server console to create and to send notifications to UTNotifications or I'm obliged to create my server console?

    In UTnotifications settings I can't see where I can put the OneSignal project id created for my app on OneSignal? Can how do UTNotifications to handle the push notifications sent from OneSignal to my app only?

    Because if I can't use OneSIgnal console server with UTnotifications then I made a wrong purchase...

    Thanks
     
    Last edited: Jun 8, 2016
  36. Yuriy-Ivanov

    Yuriy-Ivanov

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

    You, of course, can use One Signal server console. But as I already explained:
    you will have to integrate UTNotifications with OneSignal on your own. I recommend you following steps for that:
    1. Follow UTNotifications manual exactly, step-by-step, in order to configure each of push notifications providers. It involves using the sample scene and DemoServer to test sending push notifications. This is important to do, as push providers configuration is quite a complicated process, and it's better to configure everything with already validated environment.
    2. Start integrating UTNotifications with OneSignal server. You'll have to use OneSignal's REST API to register devices. With UTNotifications, you receive devices' unique registration ids by subscribing to an event UTNotifications.Manager.Instance.OnSendRegistrationId. For more details, please read the manual and a sample class: Assets/UTNotifications/Sample/SampleUI.cs.

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

    agurskis

    Joined:
    Jun 10, 2016
    Posts:
    4
    Hello,

    I bought your plugin. Very easy to use compared to what I was doing in native code.

    The problem is, that if I schedule my Android notifications with:

    Manager.Instance.ScheduleNotification(seconds,localizedTitle,"",notificationId);

    Where notificationId is unique every time, my notifications get stacked for some reason.

    Example:
    I scheduled 5 notifications, every one of them should fire after 90seconds. So 90, 180, 270, 360, 450. The first one fires alright at 90 seconds, but then the following ones are firing stacked. So I do not get notification after 180seconds, but I get two after 270seconds. Nevertheless, the stacked ones are the ones I scheduled, but the timing is wrong.

    Do you know what could be set up wrong? Or is it a limitation of Android? Or the plugin?

    Thanks,
    Arnold.
     
  38. Tairos

    Tairos

    Joined:
    Mar 24, 2013
    Posts:
    5
    Hello Yuriy,

    We are using your plugin, it's very nice plugin thank you for building it.

    Nevertheless, we have a problem: we expected the delegate OnNotificationClicked to be called just once, but it's calling in loop, i found solution removing the attached functions but i would like your thoughts on this.

    Thank you
     
  39. Yuriy-Ivanov

    Yuriy-Ivanov

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

    It is Android. We even added an appropriate comment to the Android native plugin's Manager.scheduleNotificationCommon method:
    Code (CSharp):
    1. // http://developer.android.com/reference/android/app/AlarmManager.html#setInexactRepeating(int, long, long, android.app.PendingIntent)
    2. // As of API 19, all repeating alarms are inexact. Because this method has been available since API 3, your application can safely call
    3. // it and be assured that it will get similar behavior on both current and older versions of Android.
    So, as you can see Android doesn't guarantee an exact time of a scheduled event, and stacking of several notifications to be fired in the same time is the most common case:
    Best regards,
    Yuriy, Universal Tools team.
     
  40. Yuriy-Ivanov

    Yuriy-Ivanov

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

    If the issue happens on iOS only - it's a known bug, it is already fixed and will be available in a next update. Otherwise, please describe it in more details: affected platforms, Unity version and steps to reproduce - then we'll be able to research and fix it.

    As a workaround, you can also hide (or cancel) the clicked notification in a OnNotificationClicked handler.

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

    agurskis

    Joined:
    Jun 10, 2016
    Posts:
    4
    Thanks for the reply. The thing is I do not use RepeatNotification. I use standard ScheduleNotification. I schedule 6 notifications. They should fire at 20, 30, 60, 70, 100, 150 seconds. But only a first few fire at the right time and the others stack together, sometimes two into one, sometimes three into one, and fire at the last notifications time. So I get 2 notifications, but at 70 seconds, instead of one at 60 and the other at 70 seconds.

    Example:
    First fires at 20seconds
    Second fires at 30seconds
    Third fires at 70seconds (instead of at 60)
    Fourth fires at 70seconds
    Fifth fires at 150 seconds (instead of at 100)
    Sixth fires at 150 seconds

    There were two intervals missed and the user gets notified twice at the same time at 70seconds and at 150seconds.

    Code (CSharp):
    1. //That's the code I used
    2. for(int i = 0; i < 6; ++i)
    3. {
    4. Manager.Instance.ScheduleNotification(20 * (i + 1), "Localization title", "", uniqueId);
    5. }
    Java function is (and my parameter "repeated" = "false"), cuz I call ScheduleNotification, not ScheduleRepeatedNotification.
    However, it is still being stacked. Did I miss anything?

    Java function below:

    Code (CSharp):
    1. if (repeated) {
    2.  
    3.         // http://developer.android.com/reference/android/app/AlarmManager.html#setInexactRepeating(int, long, long, android.app.PendingIntent)
    4.  
    5.     // As of API 19, all repeating alarms are inexact. Because this method has been available since API 3, your application can safely call
    6.  
    7.     // it and be assured that it will get similar behavior on both current and older versions of Android.
    8.  
    9. alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, elapsedRealtime + (long)triggerInSeconds*1000L, (long)intervalSeconds*1000L, pendingIntent);
    10.  
    11. } else {
    12.  
    13. alarmManager.set(AlarmManager.ELAPSED_REALTIME, elapsedRealtime + (long)triggerInSeconds*1000L, pendingIntent);
    14.  
    15. }
     
    Last edited: Jun 10, 2016
  42. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    It makes no difference: https://developer.android.com/refer...tml#set(int, long, android.app.PendingIntent):
    Note, that there is a way to enforce exact times: https://developer.android.com/refer...etExact(int, long, android.app.PendingIntent), but it requires API 19 or newer, while UTNotifications support API 10 and newer. If it's OK for you to support Android versions only starting with 4.4, you may replace alarmManager.set with alarmManager.setExact in the native plugin source (and don't forget to rebuild a plugin of course).

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Jun 10, 2016
  43. agurskis

    agurskis

    Joined:
    Jun 10, 2016
    Posts:
    4
    Thank you for your answer. It helped a lot.
     
  44. Tairos

    Tairos

    Joined:
    Mar 24, 2013
    Posts:
    5
    Well it was happening on iOS then i workaround to leave the handle empty on the first loop, so I guess is what you described.

    By the way, this bug is related with Unity or the plugin? I mean should i wait for unity update or plugin update.

    Thank you for your reply.
     
  45. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    It is UTNotifications related. You can download a patch to fix the issue here (just replace a file Assets/Plugins/iOS/UTNotificationsTools.mm).

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Jun 12, 2016
  46. Tairos

    Tairos

    Joined:
    Mar 24, 2013
    Posts:
    5
    That worked, thank you!
     
  47. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220

    Hi Yuriy,

    I followed your tips and I made all, I integrated UTNotifications instead OneSignal Unity plugin and I receive push notifications from Apple and Google using the OneSignal console to send it! Now, I can go forward on my job.

    I prepared the handling for the OnNotificationClicked and OnNotificationsReceived put inside two simple message box to know what event is handle.
    But I have these questions for you:

    1) iOS/Android: with the app opened in foreground or in background I receive the push handled from OnNotificationsReceived; I think that is right, not?
    2) iOS/Android: with the app closed (not in background) I receive the push and when I open the app it not handle OnNotificationsReceived. I know the iOS limit for app closed but for Android??
    3) iOS/Android: with the app opened in foreground or in background, if I receive the notification and I click on it the app handle the OnNotificationsReceived instead of the OnNotificationClicked. I registered the Clicked event before to inizialize the UT manager. Why?
    4) Android: in the notify bar when the notification arrive there is: Malformed notification. But I send it from OneSignal console, why the notification on iOS is ok and Android not?

    Many thanks for the support!
     
    Last edited: Jun 13, 2016
  48. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Yes, of course. The only important note here is that OnNotificationsReceived event for notifications received while an app was in background will be called when an app gets foreground, no C# code will be called while an app is in background.

    On Android you'll get a list of all push notifications even received while an app wasn't running at all.

    If a notification was received and then clicked, you'll get both OnNotificationsReceived and OnNotificationClicked events, and OnNotificationClicked will always be called first. If it doesn't work in your case, please show how you subscribe to each of OnNotificationClicked and OnNotificationsReceived events, how you initialize UTNotifications.Manager and the contents of your handlers of OnNotificationClicked and OnNotificationsReceived - something should be wrong.

    The problem here is that APNS has it's standard common notification format, and GCM doesn't. UTNotifications by default expect the following format (see PushNotificator.java of the DemoServer):
    Code (CSharp):
    1.         //Request data json should look like:
    2.         /*
    3.         {
    4.             "registration_ids":["<id1>", ...], <or "to":"id1",>
    5.             "data":
    6.             {
    7.                 "title":"<Title>",
    8.                 "text":"<Text>",
    9.                 "<User data key 1>":"<User data value 1>",
    10.                 ...
    11.             }
    12.         }
    13.         */
    14.  
    So if OneSignal allows you specifying the message contents (it most certainly does - you may provide "title" & "text" the same way as any other custom user data) - you'll need to provide this two required fields "title" & "text" (note, that their values should be URL-encoded in order to support non-English unicode characters). Otherwise, you can modify UTNotifications' Android native plugin: see
    universal.tools.notifications.Manager.postPushNotification(Context context, Bundle extras) method of Assets/Plugins/Android/UTNotifications/src/universal/tools/notifications/Manager.java:
    Code (CSharp):
    1.     static void postPushNotification(Context context, Bundle extras) {
    2.         context = context.getApplicationContext();
    3.      
    4.         String title = extras.getString(TITLE);
    5.         if (title == null) {
    6.             title = "WRONG MESSAGE FORMAT! Push notification message must contain \"" + TITLE + "\". F.e. see Assets/UTNotifications/DemoServer/src/DemoServer/PushNotificator.java";
    7.         }
    8.         String text = extras.getString(TEXT);
    9.         if (text == null) {
    10.             text = "WRONG MESSAGE FORMAT! Push notification message must contain \"" + TEXT + "\". F.e. see Assets/UTNotifications/DemoServer/src/DemoServer/PushNotificator.java";
    11.         }
    12.         String notificationProfile = extras.containsKey(NOTIFICATION_PROFILE) ? extras.getString(NOTIFICATION_PROFILE) : null;
    13.      
    14.         extras.remove(TITLE);
    15.         extras.remove(TEXT);
    16.         extras.remove(NOTIFICATION_PROFILE);
    17.         extras.putString(KEY_TITLE, title);
    18.         extras.putString(KEY_TEXT, text);
    19.      
    20.         Manager.postNotification(context, title, text, Manager.getNextPushNotificationId(context), extras, notificationProfile, true);
    21.     }
    So you can change a way how title and text are read. Then you'll have to rebuild the native plugin.

    Feel free to ask for any further support.

    Best regards,
    Yuriy, Universal Tools team.
     
  49. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    220


    Hi,

    thank your for reply!

    About the Android malformed push I would to be more clear: I send the push message from OneSignal console then I'm not using the UTNotifications for prepare the post. So why the UTNotifications receive a malformed notification? That sample code you wrote is for prepare a push and send, correct? If yes it not useful for me because I use OneSignal console to prepare and send push. And in this case my issue is the same, why the push is received as malformed in app?

    About how subscribe to the events, below the code:

    Code (CSharp):
    1.  
    2. Manager notificationsManager = Manager.Instance;
    3.  
    4. notificationsManager.OnNotificationClicked += OnNotificationClicked;
    5.  
    6. bool result = notificationsManager.Initialize(true, 0, false);
    7.         Debug.Log("UTNotifications Initialize: " + result);
    8.  
    9. notificationsManager.OnSendRegistrationId += OnReceiveTokenIds;
    10. notificationsManager.OnNotificationsReceived += OnNotificationsReceived;
    11.  
    12. m_notificationsEnabled = notificationsManager.NotificationsEnabled();
    13.  
    14. ....
    15.  
    16. protected void OnNotificationClicked(ReceivedNotification notification)
    17.     {
    18.         m_clickedNotification = notification;
    19.  
    20.         ShowMessage("Notification received and clicked on it", 5.0f);
    21.  
    22.         if (m_clickedNotification.userData != null)
    23.         {  
    24.             if(m_clickedNotification.userData.ContainsKey("targetURL"))
    25.             {  
    26.                
    27.  
    28.                 string linkURL = (string) m_clickedNotification.userData ["targetURL"];
    29.  
    30.                 if (!string.IsNullOrEmpty(linkURL)) InAppBrowser.OpenURL(linkURL, displayOptions);
    31.             }
    32.  
    33.             else if (m_clickedNotification.userData.ContainsKey(""))
    34.             {  
    35.                 // DO SOMETHING ELSE
    36.             }  
    37.         }
    38.  
    39.     }
    40.  
    41.     /// <summary>
    42.     /// Handles the received notifications.
    43.     /// </summary>
    44.     protected void OnNotificationsReceived(IList<ReceivedNotification> receivedNotifications)
    45.     {
    46.         m_receivedNotifications.AddRange(receivedNotifications);
    47.  
    48.         ShowMessage("Received notification not still opened", 5.0f);
    49.  
    50.  
    51.  
    52.     }
    53.  
     
  50. Yuriy-Ivanov

    Yuriy-Ivanov

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

    No, this was a code that receives a push notification. As I already explained, Android works differently, not the same way as iOS: iOS automatically show notifications you send, on Android push notifications (both GCM & ADM) are just abstract pieces of data, received by a client application. And it's up to an application how to handle this "messages" - to show a system notification or to do anything else. UTNotifications include a native Android plugin, which handles these push "messages" and shows a system notification for you (as Android doesn't do it itself). The code showed above is a part of this native plugin, which handles received push messages, then reads some fields from them (including the most important "title" and "text" fields) and then creates a system notification using these values. So in your case OneSignals sends some push messages, containing some data in a format expected by OneSignal's native Android plugin. This format is not equal to one used by UTNotifications, this is a source of your issue. So I recommend you to provide "title" and "text" field from OneSignal side (it should support user data values, which are exactly what you need). Alternative solution is to modify UTNotifications Android native plugin method, which reads the notification data from the received GCM & ADM messages. It's a more difficult way, so I'd recommend you using a first approach.

    Later today we'll check your clicks handling related issues to find out what's wrong with it.

    Best regards,
    Yuriy, Universal Tools team.