Agasper / unity-android-notifications

Unity3D Plugin for Android local notifications with example project
Other
557 stars 184 forks source link

Notification not showing up #28

Closed cainaleaouk closed 7 years ago

cainaleaouk commented 8 years ago

Hi there,

I've been using your plugin without problems for the past 2 or 3 months. But I have to implement another plugin (AppsFlyer) which overrides Unity's main activity. After that the app would crash every time it would try to display a notification. After some research I found out that I have to change the variable in C# to match the MAIN activity in my manifest. After doing it, it won't crash anymore but nothing will happen as well. I am not sure what I am doing wrong at this point and if you could take a look at my manifest that would be awesome because Im running out of ideas here.

Unity Version : 5.3.1p2 (pro) Testing Phone : Android Galaxy S6 - Android version : 6.0.1

Manifest : http://pastie.org/private/3blkdbzl5pfnkzcqf1vdq (git was giving me grief when putting the manifest here, so I just created a pastie)

C# changed: `#if UNITY_ANDROID && !UNITY_EDITOR private static string fullClassName = "net.agasper.unitynotification.UnityNotificationManager"; private static string mainActivityClassName = "com.appsflyer.AppsFlyerOverrideActivity";

endif`

(nothing else was changed from your examples)

I think this info should be enough for you to have an idea of what is going on. Let me know if any more info is necessary and I'll send to you.

Cheers, Cai

cainaleaouk commented 8 years ago

Hey there update on the problem. I think the first time the fact nothing was happening was because the tester didn't actually wait for the notification to trigger. Is triggering again but it's crashing with this error : 06-03 17:28:24.551 19268-19268/? E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.endemoluk.ksibeastunleashed, PID: 19268 java.lang.Error: FATAL EXCEPTION [main] Unity version : 5.3.1p2 Device model : samsung SM-G920F Device fingerprint: samsung/zerofltexx/zeroflte:6.0.1/MMB29K/G920FXXS3DPD3:user/release-keys Caused by: java.lang.RuntimeException: Unable to start receiver net.agasper.unitynotification.UnityNotificationManager: java.lang.NullPointerException at android.app.ActivityThread.handleReceiver(ActivityThread.java:3641) at android.app.ActivityThread.access$2000(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1876) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.NullPointerException at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:324) at java.lang.Class.forName(Class.java:285) at net.agasper.unitynotification.UnityNotificationManager.onReceive(UnityNotificationManager.java:95) at android.app.ActivityThread.handleReceiver(ActivityThread.java:3634)             at android.app.ActivityThread.access$2000(ActivityThread.java:221)             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1876)             at android.os.Handler.dispatchMessage(Handler.java:102)             at android.os.Looper.loop(Looper.java:158)             at android.app.ActivityThread.main(ActivityThread.java:7224)             at java.lang.reflect.Method.invoke(Native Method)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)