Agasper / unity-android-notifications

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

Fix a null reference exception #115

Closed sableangle closed 5 years ago

sableangle commented 5 years ago

In Android 8.0 (maybe above) a notification with action may cause a null reference exception. In may case, it happen when notification shows and the app is already close, so a message likes "XXX is stop working" will show. This is annoyance to user and cause high rate of crash report in Android Vitals.

I try to fix the problem by replace the "UnityPlayer.currentActivity" to "context" (from parameter of onReceive method)