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. bananalopa

    bananalopa

    Joined:
    Apr 6, 2013
    Posts:
    2
    Hi Yuriy

    Great plugin, thank you!
    I wonder, what should happen if user changed timezone after repeating notification was setup (by DateTime) ? Will it fire accordingly old or new timezone?
     
  2. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @bananalopa ,
    It's timezone unaware: it will keep using the old timezone. Having it configurable is one of the goals for the next major update of the asset.

    Best regards,
    Yuriy, Universal Tools team.
     
  3. bananalopa

    bananalopa

    Joined:
    Apr 6, 2013
    Posts:
    2
    Ok, it would be great have it in the future
     
  4. KingIsBack

    KingIsBack

    Joined:
    Apr 15, 2013
    Posts:
    3
    Hey Yuriy,

    We have integrated UTNotification plugin successfully for both, Android & iOS. And it works like a charm. Thanks for it.
    But now we are facing one issue for the userData. We are not getting userData sent from our server to iOS only. On android it works perfectly fine. What could be the cause?

    Note : Our server also sends push notification with userData to other our games which are not using UTNotification pluging works properly.
     
  5. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Can you please post here or send us to email the APNS message payload example? Please also tell me whether userData values are received with messages sent from DemoServer ("server_message")?

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

    KingIsBack

    Joined:
    Apr 15, 2013
    Posts:
    3
    Thanks for the quick reply, we havent checked with demoserver. I will mail you the APNS message payload json which is sent by our server.
     
  7. TermerAlexander

    TermerAlexander

    Joined:
    Jan 25, 2016
    Posts:
    10
    Hello, we use this plugin for pushes, and its work good, but can you tell me how we can show icon in push that we get from server? For example we have 2 users and when user1 attacked base of user2, we want post to user2 push with photo of user1 (we have link on photo in server and want add it to push for show as icon) - is it real?
     
  8. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Which platform are we talking about? It is possible and quite easy on Android, but you'll have to modify UTNotifications native plugin. On iOS it should be possible starting with iOS 10 with custom notification views, but it's difficult to achieve with UTNotificactions and Unity in general: you have to redefine their app controller, add new views in Xcode and much more. I don't know any way to do it in Windows Store/UWP builds.

    If Android-only options is OK for you, modify Assets/UTNotifications/Editor/Android/NativePluginSource/utnotifications/src/main/java/universal/tools/notifications/Manager.java, private static Notification prepareNotification(Context context, String title, String text, int id, String notificationProfile, Bundle userData, Bitmap bitmap)
    -
    replace the whole block with setting large icons:
    Code (CSharp):
    1.         // Android version prior 5 crop oversized icons instead of scaling them. Let's help it.
    2.         if (android.os.Build.VERSION.SDK_INT < 21 && android.os.Build.VERSION.SDK_INT >= 11) {
    3.             if (largeIcon == 0) {
    4.                 largeIcon = icon;
    5.             }
    6.             int targetWidth = res.getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
    7.             int targetHeight = res.getDimensionPixelSize(android.R.dimen.notification_large_icon_height);
    8.             builder.setLargeIcon(Bitmap.createScaledBitmap(BitmapFactory.decodeResource(res, largeIcon), targetWidth, targetHeight, false));
    9.         } else if (largeIcon != 0) {
    10.             builder.setLargeIcon(BitmapFactory.decodeResource(res, largeIcon));
    11.         }
    by setting a large icon from the Bitmap downloaded from your server, f.e. similar to what we do when building Image notifications (see static void postNotification(Context _context, final String title, final String text, final int id, final Bundle userData, final String notificationProfile, final int badgeNumber, final boolean repeatedOrNotScheduled) in the same file). After that, build and deploy the native plugin to its target location in Assets/Plugins/Android by performing gradle "deploy" task in Android Studio.

    Best regards,
    Yuriy, Universal Tools team.
     
    Last edited: Sep 14, 2017
  9. TermerAlexander

    TermerAlexander

    Joined:
    Jan 25, 2016
    Posts:
    10
    Thank you for reply, we need it for ios and android and I think now I know how we can do it on android. Thank you
     
  10. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Please let me know if you need any further help with that.
     
  11. TermerAlexander

    TermerAlexander

    Joined:
    Jan 25, 2016
    Posts:
    10
    I changed code in Manager.java script but I don't understand how I can build and deploy it for unity - can you tell me how I can do it? I try press Run->Run and created new Gradle with name "Pushes" and selected Grandle project: "NativePluginSource:utnotifications" but when I press "Run" I see: "Error running Pushes: No task to execute is specified"
     
    Last edited: Sep 18, 2017
  12. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    It's easy: just execute UTNotifications custom task called "deploy" by double-clicking on :utnotifications/Tasks/other/deploy item in "Gradle projects" panel in Android Studio:
    upload_2017-9-18_20-0-18.png

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

    TermerAlexander

    Joined:
    Jan 25, 2016
    Posts:
    10
    Yes, it's work very well, thank you
     
  14. cbharara

    cbharara

    Joined:
    Aug 29, 2017
    Posts:
    2
    Does the plugin work with Firebase?
     
  15. tencity

    tencity

    Joined:
    Sep 8, 2015
    Posts:
    14
    Hi - I just bought this plugin for local notifications, but I can't the most basic scheduled notification to work on one of my phones, and I think it might be an Android 8 issue?

    On Android 5 phone, all working correct. I see notifications in the bar at the top, and if the app is running then the notification handler is successfully called. This is using my app AND your sample scene.

    On Android 8 phone, I never see notifications in the bar at the top. But if the app is running then the notification handler is called, so I know it must be firing. Again, using my app and your sample scene.

    I've tried all combinations of UT's menu Android 'Show Notifications' drop down, and notifications on the phone are working from other apps (What's App etc).

    It's very frustrating. Any ideas?

    EDIT: if it's any help I tried a different (free) plugin and that doesn't work either. The developer said he had other reports of the same issue with Android 8.
     
    Last edited: Sep 27, 2017
  16. toddfiore

    toddfiore

    Joined:
    Dec 16, 2016
    Posts:
    12
    I am having the same problem as tencity, Android 8 has no notifications show up but they begin to parse when opening the app. Tried on Android 5.1 and the notifications work fine. Running Unity 2017.1.1f
     
  17. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @tencity, @LouieBloo and all,

    Indeed, there is a problem showing notifications on Android 8, when building on the latest Android SDK Build Tools (26) and targeting the latest API level (26). The reason is that starting with API 26, Google requires every notification to have a notification channel specified.
    A quick fix for it is just to target your app to API 25 (Android 7.1):
    upload_2017-9-27_20-29-35.png

    We're working on making every notification profile (including "default") register and use a notification channel on Android O, to work well when targeting API 26. It actually even works already, but relies on lots of other changes we've already made for update 1.7, and not all of them are yet ready to release.
    It's gonna be the largest update we've made yet, and we faced and solved lots of issues working on it already. Unfortunately there are still some very problematic features we decided to cut in 1.7 to publish the update as fast as possible (f.e. FCM won't be supported on iOS in 1.7). It may still take about a month (hopefully!) to complete, so please go with API 25 targeting workaround solution for now, and as soon as UTNotifications 1.7 is released, we'll let you know.

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

    Yuriy-Ivanov

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

    You can be speaking about one of 2 different things:
    1. Firebase Cloud Messaging (FCM). Then, yes, it does. Please see the manual for more details.
    2. Whether it is compatible with Firebase SDK. Then, again, yes (except of its Messaging package, which just does much of the same job as UTNotifications do, so they can conflict). But you'll have to specify compatible versions of Android Support v4 library (11.0.4) & Google Play Services libraries (25.2.0) in UTNotifications' configuration of Google Play Services Resolver (if it's your case, I can explain how to do it in all the details).

    Best regards,
    Yuriy, Universal Tools team.
     
  19. tencity

    tencity

    Joined:
    Sep 8, 2015
    Posts:
    14
    That worked, thank you!
     
  20. toddfiore

    toddfiore

    Joined:
    Dec 16, 2016
    Posts:
    12
    Switching to api 25 works and the notifications come through, however whenever I click on one the app crashes. See dump log:

    --------- beginning of crash
    09-27 13:38:31.549 6377-6562/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 6562 (UnityMain)
    09-27 13:38:31.559 923-993/? I/ActivityManager: Displayed com.sircles.sircles/me.devhelp.unityplugin.UnityPluginActivity: +160ms
    09-27 13:38:31.615 6566-6566/? I/crash_dump32: obtaining output fd from tombstoned
    09-27 13:38:31.616 745-745/? I//system/bin/tombstoned: received crash request for pid 6377
    09-27 13:38:31.621 6566-6566/? I/crash_dump32: performing dump of process 6377 (target tid = 6562)
    09-27 13:38:31.621 6566-6566/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    09-27 13:38:31.621 6566-6566/? A/DEBUG: Build fingerprint: 'google/sailfish/sailfish:8.0.0/OPR3.170623.007/4286350:user/release-keys'
    09-27 13:38:31.621 6566-6566/? A/DEBUG: Revision: '0'
    09-27 13:38:31.621 6566-6566/? A/DEBUG: ABI: 'arm'
    09-27 13:38:31.621 6566-6566/? A/DEBUG: pid: 6377, tid: 6562, name: UnityMain >>> com.sircles.sircles <<<
    09-27 13:38:31.621 6566-6566/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    09-27 13:38:31.621 6566-6566/? A/DEBUG: Cause: null pointer dereference
    09-27 13:38:31.621 6566-6566/? A/DEBUG: r0 00000000 r1 cb90eab8 r2 00000000 r3 00000002
    09-27 13:38:31.621 6566-6566/? A/DEBUG: r4 cbf0d008 r5 0016be3c r6 ce37d3dc r7 ce37d3c0
    09-27 13:38:31.621 6566-6566/? A/DEBUG: r8 0016be3c r9 00000001 sl cb90d958 fp cb90d8e4
    09-27 13:38:31.621 6566-6566/? A/DEBUG: ip ce2116cc sp cb90d810 lr cd272d04 pc cd457d90 cpsr 400e0010
    09-27 13:38:31.626 6566-6566/? A/DEBUG: backtrace:
    09-27 13:38:31.626 6566-6566/? A/DEBUG: #00 pc 00a54d90 /data/app/com.sircles.sircles-Oz91qkJve_b44f7oo4LusQ==/lib/arm/libunity.so (_ZN15AndroidGraphics14AcquireContextEv+216)
    09-27 13:38:31.626 6566-6566/? A/DEBUG: #01 pc 00a551a8 /data/app/com.sircles.sircles-Oz91qkJve_b44f7oo4LusQ==/lib/arm/libunity.so (_ZN15AndroidGraphics25ApplyPendingWindowChangesEv+536)
    09-27 13:38:31.626 6566-6566/? A/DEBUG: #02 pc 00a63134 /data/app/com.sircles.sircles-Oz91qkJve_b44f7oo4LusQ==/lib/arm/libunity.so (_Z18nativeFocusChangedP7_JNIEnvP8_jobjectb+324)
    09-27 13:38:31.626 6566-6566/? A/DEBUG: #03 pc 000116a7 /data/app/com.sircles.sircles-Oz91qkJve_b44f7oo4LusQ==/oat/arm/base.odex (offset 0x11000)


    Any advice?
     
  21. Yuriy-Ivanov

    Yuriy-Ivanov

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

    Based on the stack trace, it's a native (C++) crash on dereferencing null pointer in UnityMain. It seems to be a Unity bug and it's not reproduced for me - clicking on a notification successfully opens the app. Unity 2017.1.1 and earlier are known to have troubles on starting applications on Android 8 (just shows black screen). Unity 2017.2.0 beta doesn't have this problem, but being a beta version can have other bugs. So contacting Unity support may be your only option - this crash should have nothing to do with UTNotifications, but rather with starting/bringing to foreground Unity apps. You can also try switching to Mono Scripting Backend if IL2CPP is currently enabled in your Android build settings:
    upload_2017-9-28_12-40-46.png

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

    Theinsanekiller

    Joined:
    Jun 1, 2012
    Posts:
    27
    Hi Yuriy,
    To we purchased this plugins and tried running the sample scene on android and i am getting error on both push notifications and local notification. I am running demo server.
    Following are the errors i got:
    Local notification:
    10-09 19:08:23.244 26054-26077/? I/Unity: UTNotifications Initialize: False

    (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    10-09 19:08:32.324 26054-26077/? I/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/NotificationCompat$Builder;
    java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/app/NotificationCompat$Builder;
    at universal.tools.notifications.Manager.prepareNotification(Manager.java:508)
    at universal.tools.notifications.Manager.postNotification(Manager.java:254)
    at universal.tools.notifications.Manager.postNotification(Manager.java:92)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.a(Unknown Source)
    at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:158)
    at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.app.NotificationCompat$Builder" on path: DexPathList[[zip file "/data/app/com.Mayank.UT-1/base.apk"],nativeLibraryDirectories=[/dat


    Push

    Please make sure you initialised push notification using utnotfications.manager.instance.initialize()?

    Kindly help asap.
     
  23. Yuriy-Ivanov

    Yuriy-Ivanov

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

    It means that Google Play Services Resolver couldn't add Android Support Library to your project Assets/Plugins/Android folder - either automatic resolution is disabled or there was an issue pulling the library (or something broke in the Play Services Resolver itself).
    Try manual resolution: Unity menu -> Assets -> Play Services Resolver -> Android Resolver -> Resolve Client Jars.
    Please see the attached screenshot: you should have these libraries added in your Assets/Plugins/Android folder (versions may differ).

    Best regards,
    Yuriy, Universal Tools team.
     

    Attached Files:

    Last edited: Oct 9, 2017
  24. Theinsanekiller

    Theinsanekiller

    Joined:
    Jun 1, 2012
    Posts:
    27
    Hey @Yuriy-Ivanov
    Thanks for your quick reply, It is working for android.
     
  25. Theinsanekiller

    Theinsanekiller

    Joined:
    Jun 1, 2012
    Posts:
    27
    Hey @Yuriy-Ivanov
    The plugin is working great so far for android push and local notification and IOS local notifs but, i am getting following error while sending push notification to IOS device. If you can check it out and help me.
    I am very new to these notifications and all. Thanks.

    [Thread-2] INFO com.notnoop.apns.internal.ApnsConnectionImpl - Failed to send message Message(Id=1; Token=0DC8B3E9B9D47007EAEFCE959E4FE4C83254252606E84E5ADE74C0A31F55A9C3; Payload={"aps":{"badge":1,"alert":{"action-loc-key":"Hello!","body":"Hello!\nFrom samsung SM-G920I"},"sound":"Data/Raw/demo_notification_profile"},"id":"4","server_message":"2017-10-10 15:45:29"})... trying again after delay

    javax.net.ssl.SSLException: Received fatal alert: internal_error

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)

    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)

    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)

    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747)

    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)

    at java.io_OutputStream.write(OutputStream.java:75)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:328)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:312)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46)

    at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:113)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:1)

    at DemoServer.PushNotificator.notifyAPNS(PushNotificator.java:250)

    at DemoServer.PushNotificator.notifyItems(PushNotificator.java:68)

    at DemoServer.PushNotificator.notifyAll(PushNotificator.java:40)

    at DemoServer.HttpServer$SocketProcessor.process(HttpServer.java:176)

    at DemoServer.HttpServer$SocketProcessor.run(HttpServer.java:49)

    at java.lang.Thread.run(Thread.java:745)

    [Thread-2] ERROR com.notnoop.apns.internal.ApnsConnectionImpl - Couldn't send message after 3 retries.Message(Id=1; Token=0DC8B3E9B9D47007EAEFCE959E4FE4C83254252606E84E5ADE74C0A31F55A9C3; Payload={"aps":{"badge":1,"alert":{"action-loc-key":"Hello!","body":"Hello!\nFrom samsung SM-G920I"},"sound":"Data/Raw/demo_notification_profile"},"id":"4","server_message":"2017-10-10 15:45:29"})

    javax.net.ssl.SSLException: Received fatal alert: internal_error

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)

    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)

    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)

    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747)

    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)

    at java.io_OutputStream.write(OutputStream.java:75)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:328)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:312)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46)

    at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:113)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:1)

    at DemoServer.PushNotificator.notifyAPNS(PushNotificator.java:250)

    at DemoServer.PushNotificator.notifyItems(PushNotificator.java:68)

    at DemoServer.PushNotificator.notifyAll(PushNotificator.java:40)

    at DemoServer.HttpServer$SocketProcessor.process(HttpServer.java:176)

    at DemoServer.HttpServer$SocketProcessor.run(HttpServer.java:49)

    at java.lang.Thread.run(Thread.java:745)

    com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLException: Received fatal alert: internal_error

    at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:284)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:342)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:312)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46)

    at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:113)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:1)

    at DemoServer.PushNotificator.notifyAPNS(PushNotificator.java:250)

    at DemoServer.PushNotificator.notifyItems(PushNotificator.java:68)

    at DemoServer.PushNotificator.notifyAll(PushNotificator.java:40)

    at DemoServer.HttpServer$SocketProcessor.process(HttpServer.java:176)

    at DemoServer.HttpServer$SocketProcessor.run(HttpServer.java:49)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: javax.net.ssl.SSLException: Received fatal alert: internal_error

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)

    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)

    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)

    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747)

    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)

    at java.io_OutputStream.write(OutputStream.java:75)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:328)

    ... 10 more

    >> HTTP/1.1 500 ERROR

    >> Server: UTNotificationsDemoServer

    >> Content-Type: text/html

    >> Content-Length: 107

    >> Connection: close

    >>

    >> com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLException: Received fatal alert: internal_error
     
  26. traunay

    traunay

    Joined:
    Oct 24, 2013
    Posts:
    16
    Hi,
    Been using your plugin for Android and it works perfect and easy but I've been trying to make it work for my IOS game and only managed to make local notification works.
    The thing is, as I traced and debug my code : I never received OnSendRegistrationId event just like my android app.
    I'm using the same code as my Android port and wondering why this event never raised??

    Any idea?
    ps : Checklist -> already enable push notification in both cert, profile and entitlements
    Thanks
     
  27. ynedelin

    ynedelin

    Joined:
    Jul 3, 2012
    Posts:
    14
    Hi Yuriy,
    we are having an odd issue , maybe you have seen this.
    I have a simple scheduled local notification.
    specs : Android, pixel, unity563p4
    If app is not closed but in the background - notification works as expected, shows up and if I click on notification it opens the app.
    but
    if app is actually closed on the phone (by swiping it tot the side of the screen), at the time when notification should appear I get Android error pop up informing me that:

    (ApplicaitonName) has stopped.
    x Close app

    any ideas ?

    Thank you
    Yury
     
  28. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @ynedelin,
    Please provide the exception stack trace from LogCat.

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

    Yuriy-Ivanov

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

    Are APNS Push Notifications enabled in UTNotifications settings? Do you see any errors/warnings in the Xcode console when and after UTNotifications.Manager.Instance.Initialize? Is OnSendRegistrationId called in the UTNotifications sample scene?

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

    Yuriy-Ivanov

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

    It seems that APNS certificate you're using in DemoServer is incorrect. Please make sure it is APNS certificate (not the same you're using to sign the app) and it's converted to .p12 and the certificate password is configured correctly in DemoServer constants. Please also check that the certificate was created as Development certificate (if you install your app from Xcode). Otherwise (f.e. when building a production app) the SSL certificate should be Production one.

    Best regards,
    Yuriy, Universal Tools team.
     
  31. ynedelin

    ynedelin

    Joined:
    Jul 3, 2012
    Posts:
    14
    @Yuriy-Ivanov
    I was looking to filtered "UNITY" only adb logs before, after looking at the full log there was missing support-v26 library.
    So that's fixed, Thank you

    Another question, after getting updated support-v26 we got :
    Too many field references to fit in one dex file: 68984; max is 65536.

    looks like universal.tools.notifications building both
    2453 universal.tools.notifications
    2398 universal.tools.notifications.res

    do we need both of these ?

    Before I move to use Gradle, I thought I can remove things we might not need.

    Yury
     
  32. -Aymeric-

    -Aymeric-

    Joined:
    Oct 21, 2014
    Posts:
    110
    Hello @Yuriy-Ivanov, a quick question concerning the badge notification on iOS for local notification via the
    ScheduleNotification method:
    For having the badge icon with a number, the latest method argument should be > 0 right? How can it be accumulated automatically? I can be very hard to track the correct number if you many notifications scheduled and user lauching often the app.
    Thanks for the help.
     
  33. Theinsanekiller

    Theinsanekiller

    Joined:
    Jun 1, 2012
    Posts:
    27
    Hi @Yuriy-Ivanov ,
    I checked everything you asked and then tried to but still i am getting the same issue.

    hread-1] INFO com.notnoop.apns.internal.ApnsConnectionImpl - Failed to send message Message(Id=1; Token=06F212D4FD354B29BFBC2451FC30521B4407751D4F60DFCEEEB81F3A2E4A6F2A; Payload={"aps":{"badge":1,"alert":{"action-loc-key":"Hello!","body":"Hello!\nFrom iPhone6,2"},"sound":"Data/Raw/demo_notification_profile"},"id":"4","server_message":"2017-10-12 16:08:24"})... trying again after delay

    javax.net.ssl.SSLException: Received fatal alert: internal_error

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)

    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)

    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)

    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747)

    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)

    at java.io_OutputStream.write(OutputStream.java:75)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:328)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:312)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46)

    at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:113)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:1)

    at DemoServer.PushNotificator.notifyAPNS(PushNotificator.java:250)

    at DemoServer.PushNotificator.notifyItems(PushNotificator.java:68)

    at DemoServer.PushNotificator.notifyAll(PushNotificator.java:40)

    at DemoServer.HttpServer$SocketProcessor.process(HttpServer.java:176)

    at DemoServer.HttpServer$SocketProcessor.run(HttpServer.java:49)

    at java.lang.Thread.run(Thread.java:745)

    [Thread-1] ERROR com.notnoop.apns.internal.ApnsConnectionImpl - Couldn't send message after 3 retries.Message(Id=1; Token=06F212D4FD354B29BFBC2451FC30521B4407751D4F60DFCEEEB81F3A2E4A6F2A; Payload={"aps":{"badge":1,"alert":{"action-loc-key":"Hello!","body":"Hello!\nFrom iPhone6,2"},"sound":"Data/Raw/demo_notification_profile"},"id":"4","server_message":"2017-10-12 16:08:24"})

    >> HTTP/1.1 500 ERROR

    >> Server: UTNotificationsDemoServer

    >> Content-Type: text/html

    >> Content-Length: 107

    >> Connection: close

    >>

    >> com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLException: Received fatal alert: internal_error

    javax.net.ssl.SSLException: Received fatal alert: internal_error

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)

    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)

    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)

    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747)

    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)

    at java.io_OutputStream.write(OutputStream.java:75)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:328)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:312)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46)

    at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:113)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:1)

    at DemoServer.PushNotificator.notifyAPNS(PushNotificator.java:250)

    at DemoServer.PushNotificator.notifyItems(PushNotificator.java:68)

    at DemoServer.PushNotificator.notifyAll(PushNotificator.java:40)

    at DemoServer.HttpServer$SocketProcessor.process(HttpServer.java:176)

    at DemoServer.HttpServer$SocketProcessor.run(HttpServer.java:49)

    at java.lang.Thread.run(Thread.java:745)

    com.notnoop.exceptions.NetworkIOException: javax.net.ssl.SSLException: Received fatal alert: internal_error

    at com.notnoop.apns.internal.Utilities.wrapAndThrowAsRuntimeException(Utilities.java:284)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:342)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:312)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:46)

    at com.notnoop.apns.internal.AbstractApnsService.push(AbstractApnsService.java:113)

    at com.notnoop.apns.internal.ApnsServiceImpl.push(ApnsServiceImpl.java:1)

    at DemoServer.PushNotificator.notifyAPNS(PushNotificator.java:250)

    at DemoServer.PushNotificator.notifyItems(PushNotificator.java:68)

    at DemoServer.PushNotificator.notifyAll(PushNotificator.java:40)

    at DemoServer.HttpServer$SocketProcessor.process(HttpServer.java:176)

    at DemoServer.HttpServer$SocketProcessor.run(HttpServer.java:49)

    at java.lang.Thread.run(Thread.java:745)

    Caused by: javax.net.ssl.SSLException: Received fatal alert: internal_error

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)

    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)

    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)

    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)

    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747)

    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123)

    at java.io_OutputStream.write(OutputStream.java:75)

    at com.notnoop.apns.internal.ApnsConnectionImpl.sendMessage(ApnsConnectionImpl.java:328)

    ... 10 more
     
  34. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    It's actually weird: universal.tools.notifications.res doesn't have any code at all - it's purely resource project, which is automatically generated by UTNotifications to build notification icons as Android resources. It shouldn't produce any code. Well, some resource identifier constants are generated by Android SDK when building the project in Unity, but only one per icon. I've no idea where these 2398 field references are coming from, sorry. universal.tools.notifications extensively uses Google Play Services libs (FCM/GCM related) + some functionality of Android Support Library, so it can indeed introduce many field references, mostly indirectly.
     
  35. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Your p12 certificate is definitely incorrect. Please attach here or send us to email screenshots of every step you perform to get that .p12 key - as described in section "Configuring the Apple Push Notification Service (APNS)" of the manual. You can blur/paint over any private data/keys.
     
  36. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @-Aymeric- ,

    I understand your inconvenience very well, but unfortunately iOS doesn't allow automated badges accumulation, it's just impossible. It was a big surprise and frustration for us too. Many people just use 1 as a badge number for any local notification to show there is something new with the app. Alternatively you can calculate updates count per client on your server and use push notifications instead of local ones.

    See also https://stackoverflow.com/questions...pplication-badge-through-a-local-notification.
     
  37. -Aymeric-

    -Aymeric-

    Joined:
    Oct 21, 2014
    Posts:
    110
    @Yuriy-Ivanov thanks for the precision and resource link! Indeed it's a bit a frustration... ;)
     
  38. -Aymeric-

    -Aymeric-

    Joined:
    Oct 21, 2014
    Posts:
    110
    Hi @Yuriy-Ivanov , a quick question: a negative id for local notifications is an issue?
    I cancel it, before adding it again (always using the same id) and I'd several time the same notifications (mostly tested on iOS):
    Code (csharp):
    1. UTNotifications.Manager.Instance.CancelNotification(-1);
    2. UTNotifications.Manager.Instance.ScheduleNotification(tomorrowDay, daily_reward_notification_title, daily_reward_notification_desc, -1, null, null, 1);
     
  39. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Hi @-Aymeric-,

    It's a known issue on iOS which we still don't really know how to reproduce: https://github.com/universal-tools/UTNotificationsFeedback/issues/60. If you know how to reproduce it, we would be really glad to research and fix it. We have some ideas on preventing this bug to appear. One of these ideas should be implemented in the upcoming update, but as we don't know a way to reproduce the issue, it's not guaranteed to be fixed completely.

    Best regards,
    Yuriy, Universal Tools team.
     
  40. -Aymeric-

    -Aymeric-

    Joined:
    Oct 21, 2014
    Posts:
    110
    Thanks for the answer @Yuriy-Ivanov and the Github link. Don't know if it helps: I downloaded a previous game that I made with Unity using Prime31 local notification plugin (Etcetera) and I found that, now, I have also several time the same notifications on iOS. During the development process, I never had this issue... so wondering if it's not a problem with iOS 11 and Unity?
     
  41. Anatolii_Landyshev

    Anatolii_Landyshev

    Joined:
    Aug 10, 2012
    Posts:
    31
    Hi!
    I'm using UTNotifications plugin in Unity 5.6.4f1 and it's conflicting with Facebook plugin when building to Android.
    I get the following error:

    Attribute meta-data#android.support.VERSION@value value=(25.3.1) from AndroidManifest.xml:24:9-31
    is also present at AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest-main.xml:22:5-24:34 to override.

    Could you recommend me how to fix it please?
    Thanks.
     
  42. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    From what is known for sure - the issue is happening due to sometimes-non-working Unity's built-in UnityEngine.iOS.NotificationServices.CancelLocalNotification. There is a good chance that it is even an old bug of iOS itself (as I've seen many discussions about that not relating to Unity). Either way, despite of the fact that we, as you can imagine, are quite limited here (as it has nothing to do with UTNotifications' code itself), from what we could find out about that bug, there is a workaround to avoid it by detecting in runtime duplicated scheduled notifications and canceling them repeatedly, it seems to help other people on iOS (without Unity). This fix should be released in UTNotifications 1.7, hopefully it'll solve the problem.
     
  43. Yuriy-Ivanov

    Yuriy-Ivanov

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

    First of all, thank you for using our asset.
    It's quite simple to resolve the issue with Facebook SDK, please read this topic: https://github.com/universal-tools/UTNotificationsFeedback/issues/57.

    Best regards,
    Yuriy, Universal Tools team.
     
  44. Anatolii_Landyshev

    Anatolii_Landyshev

    Joined:
    Aug 10, 2012
    Posts:
    31
  45. Anatolii_Landyshev

    Anatolii_Landyshev

    Joined:
    Aug 10, 2012
    Posts:
    31
  46. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
  47. Theinsanekiller

    Theinsanekiller

    Joined:
    Jun 1, 2012
    Posts:
    27
    Hi Yuriy,
    Sorry for late reply, there was a vacation time here in India.
    So, I am sending a mail the pdf of steps taken to create the certificate.
    Best regards,
    Yuriy, Universal Tools team.[/QUOTE]
    Hi Yuriy,
    Sorry for late reply, there was a vacation time here in India.
    So, I am sending a mail with the attached pdf of steps taken to create the p12 file using mayank.manjul@playizzon.com
     
  48. TermerAlexander

    TermerAlexander

    Joined:
    Jan 25, 2016
    Posts:
    10
    Hello, Yuriy.
    I want know how much percent of pushes user opened, for it I plan sum pushes that user opened (For this I will use counter inside OnNotificationClicked(ReceivedNotification notification)), but how I can know how much pushes user getted or removed?

    Best regards
     
  49. Yuriy-Ivanov

    Yuriy-Ivanov

    Joined:
    Jun 12, 2015
    Posts:
    495
    Well, on Android and Windows Store you might use UTNotifications.Manager.Instance.OnNotificationsReceived event - it contains a list of all the notifications received since you checked it last time (don't forget to enabled listening for received notifications in the first argument of UTNotifications.Manager.Instance.Initialize). But on iOS it's unfortunately impossible: the OS doesn't inform applications on any notifications received while the app was not running, only the clicked one is known, if any.

    And it's impossible to find out which notifications were removed by a user on any platform.

    Best regards,
    Yuriy, Universal Tools team.
     
    TermerAlexander likes this.
  50. elfadotonto

    elfadotonto

    Joined:
    Dec 14, 2016
    Posts:
    3
    Is it possible to get a list of notifications scheduled locally? Can't find it in the documentation.