Closed olbesp closed 3 years ago
@olbesp,
According to the Message History of the app 44AAF-9181A, you get the NoPermissionToSend error - this is a response we get from HMS when trying to send a push to a token registered with a different App ID/App Secret. I can see that the app configuration was changed several times, so there is a chance that push tokens in your database are no longer valid. Please make sure that the agconnect-services.json and the HMS credentials in the Control Panel configuration match.
As for the crash, may I ask you to share a reproducer APK so we could test it on our side?
The crash is reproduced on every version after v6.0.10.
I test on my old Huawei P Smart+ device (Android 9)
It even doesn't matter if I call Pushwoosh.enableHuaweiPushNotifications()
or not. Seems like the Pushwoosh plugin "understands" that I use the Huawei device by itself.
The app starts fine and I'm able to register my token and receive a push notification (unfortunately, only through firebase, Huawei push notifications don't work at all). When I restart the app I see this error again and again and the app crashes:
2021-04-01 16:55:19.144 25622-25622/com.koerapp.student E/koerapp.studen: [qarth_debug:] get PatchStore::createDisableExceptionQarthFile method fail.
2021-04-01 16:55:19.152 25622-25622/com.koerapp.student E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.koerapp.student, PID: 25622
java.lang.RuntimeException: Unable to get provider com.pushwoosh.PushwooshInitProvider: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pushwoosh.huawei.internal.registrar.HuaweiPushRegistrar$b.a()' on a null object reference
at android.app.ActivityThread.installProvider(ActivityThread.java:7278)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6813)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6699)
at android.app.ActivityThread.access$2000(ActivityThread.java:273)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pushwoosh.huawei.internal.registrar.HuaweiPushRegistrar$b.a()' on a null object reference
at com.pushwoosh.huawei.internal.registrar.HuaweiPushRegistrar.registerPW(Unknown Source:2)
at com.pushwoosh.notification.PushwooshNotificationManager.b(Unknown Source:90)
at com.pushwoosh.notification.PushwooshNotificationManager.e(Unknown Source:52)
at com.pushwoosh.d.a(Unknown Source:51)
at com.pushwoosh.PushwooshPlatform.l(Unknown Source:2)
at com.pushwoosh.PushwooshInitializer.init(Unknown Source:64)
at com.pushwoosh.PushwooshInitProvider.onCreate(Unknown Source:18)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1949)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1923)
at android.app.ActivityThread.installProvider(ActivityThread.java:7273)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6813)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6699)
at android.app.ActivityThread.access$2000(ActivityThread.java:273)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
2021-04-01 16:55:19.165 25622-25622/? I/Process: Sending signal. PID: 25622 SIG: 9
Unfortunately, I can't share the APK file
@olbesp,
I've reproduced the crash, the fix is already applied to our native Android SDK, and it will be fixed in the React Native plugin with the next release.
The app starts fine and I'm able to register my token and receive a push notification (unfortunately, only through firebase, Huawei push notifications don't work at all).
This might actually be unrelated to the crash - after successful registration, pushes should be received without running the code that caused this bug. Since you have changed Huawei configuration for your app several times and now I can see NoPermissionToSend error responses in your MessageHistory, there is a chance that the current configuration is incorrect. I would suggest deleting all Huawei devices from your database for the app 44AAF-9181A - after you register your device once again, we will see if the issue is related to the config or not. What do you think?
@wfhm Thanks! I'll check that.
@olbesp Just in case, to completely remove a device from our backend, you can use /deleteDevice API:
https://docs.pushwoosh.com/platform-docs/api-reference/device-api#deletedevice
I'm not able to receive push notifications on Huawei devices.
Steps I've done:
agconnect-services.json
file is placed under<PROJECT_ROOT>android/app/
<PROJECT_ROOT>/android/build.gradle
<PROJECT_ROOT>/android/app/build.gradle
Pushwoosh project is configured with App ID + App Secret
In my JavaScript:
PushwooshSDK.enableHuaweiPushNotifications();
PushwooshSDK.register()
2021-03-30 22:22:13 9512-11303/? D/Pushwoosh: [RequestManager] Try To send: setBadge; baseUrl: https://44AAF-9181A.api.pushwoosh.com/json/1.3/ 2021-03-30 22:22:13 9512-9818/? I/WM-WorkerWrapper: Worker result SUCCESS for Work [ id=b24cf56f-5fe8-49cc-a630-e94e5a56447d, tags={ com.pushwoosh.huawei.internal.registrar.HmsRegistrarWorker } ] 2021-03-30 22:22:13 9512-11303/? I/Pushwoosh: [RequestManager] | Pushwoosh request: | Url: https://44AAF-9181A.api.pushwoosh.com/json/1.3/setBadge 2021-03-30 22:22:13 9512-11303/? D/Pushwoosh: [RequestManager] setBadge response success 2021-03-30 22:22:14 9512-9512/? I/Pushwoosh: [HmsRegistrarWorker] HCM token is AE3MDD8i9LnuiNmZZA95-4A7AHCrMpCx-Zicw0e9dgKDUyjYrJXYnTVC8meGAjIHErwVDtcKZTSqCF-lz4E57VP5-TQ5bxsQ3p86FuXmhoxHIkXahwt3F7phMW2kvmi5xA 2021-03-30 22:22:14 9512-9512/? D/Pushwoosh: [DeviceRegistrar] Registering for pushes... 2021-03-30 22:22:14 9512-9605/? D/Pushwoosh: [RequestManager] Try To send: registerDevice; baseUrl: https://44AAF-9181A.api.pushwoosh.com/json/1.3/ 2021-03-30 22:22:14 9512-9605/? I/Pushwoosh: [RequestManager] | Pushwoosh request: | Url: https://44AAF-9181A.api.pushwoosh.com/json/1.3/registerDevice 2021-03-30 22:22:14 9512-9605/? D/Pushwoosh: [RequestManager] registerDevice response success 2021-03-30 22:22:14 9512-9512/? I/Pushwoosh: [DeviceRegistrar] Registered for push notifications: AE3MDD8i9LnuiNmZZA95-4A7AHCrMpCx-Zicw0e9dgKDUyjYrJXYnTVC8meGAjIHErwVDtcKZTSqCF-lz4E57VP5-TQ5bxsQ3p86FuXmhoxHIkXahwt3F7phMW2kvmi5xA 2021-03-30 22:22:44 14644-14644/? E/Pushwoosh: This is not an Amazon device. The service is not available. 2021-03-30 22:22:44 14644-14684/? D/Pushwoosh: [CrashAnalytics] Looking for exceptions in: /data/user/164/com.koerapp.student/files 2021-03-30 22:22:44 14644-14644/? I/Pushwoosh: Log level: DEBUG 2021-03-30 22:22:44 14644-14644/? I/Pushwoosh: [NotificationManager] Sender ID: HUAWEI_DEVICE 2021-03-30 22:22:44 14644-14644/? I/Pushwoosh: [NotificationManager] Sender ID changed, clearing token java.lang.RuntimeException: Unable to get provider com.pushwoosh.PushwooshInitProvider: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pushwoosh.huawei.internal.registrar.HuaweiPushRegistrar$b.a()' on a null object reference Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.pushwoosh.huawei.internal.registrar.HuaweiPushRegistrar$b.a()' on a null object reference at com.pushwoosh.huawei.internal.registrar.HuaweiPushRegistrar.registerPW(Unknown Source:2) at com.pushwoosh.notification.PushwooshNotificationManager.b(Unknown Source:90) at com.pushwoosh.notification.PushwooshNotificationManager.e(Unknown Source:52) at com.pushwoosh.d.a(Unknown Source:49) at com.pushwoosh.PushwooshPlatform.l(Unknown Source:2) at com.pushwoosh.PushwooshInitializer.init(Unknown Source:64) at com.pushwoosh.PushwooshInitProvider.onCreate(Unknown Source:18)