Well, I got stuck again and open to any advice. My problem is, when I built my game in release mode, there is a problem on sending notifications. I want to debug it, build a development version with script debugging, this time there is no problem and everything is working perfectly.
In the end, I can not debug the problem. Any advice? What exactly Unity is doing in release builds?
Testing Device: Samsung S10+ (Android 12)
Unity Editor:2021.2.12f1
Mobile Notifications:1.4.2
Edit: Removed lines of code to make the topic shorter, as itβs no longer related. See my second post in this topic for the solution I have found.
First of all thank you for the reply. By luck, I was able to detect exception message on unity cloud system. Iβm on mobile and will edit my post in detail when on desktop but as summary, I had to generate custom proguard settings, and add a line to it. I found the solution to my problem on github discussion of unity technologies/notification sample.
As I said, I will update this reply in detail in case someone else is having a similiar problem.
Ps. As you said, the problem was only happening only on release build (due to proguard removing some unity component as far as i understand).
Edit:
As promised, here are the exact problem and solution.
In Unity Gaming Services β DevOps β Cloud Diagnostic β Crash and Exception Reporting I was able to see below exception.
AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='getNotificationManagerImpl' signature='(Landroid.app.Application;Lcom.unity3d.player.UnityPlayerActivity;)Ljava/lang/Object;' in class Ljava.lang.Object;
When I searched google I found below topic:
As suggested under this topic, in my build options I enabled custom proguard file (Player Settings β Publishing Settings β Custom Proguard File) and in Assets/Plugins/Android/proguard-user.txt I added following line
-keep class com.unity.** { *; }
And this was the solution to my problem with Unity Mobile Notification on android. I hope this can help also other people.