Closed sktan810 closed 3 years ago
@sktan810 This is a current limitation with the OneSignal SDK and the Huawei integration with the "message" type which is default. It is possible to change this to the "data" type to match how OneSignal sends FCM message by setting "huawei_msg_type": "data"
. If you have a message body a "data" type message will still be displayed.
https://documentation.onesignal.com/reference/create-notification#attachments
However due note that on Huawei devices force kill apps more aggressively so "data" message may not be able to start your app for the notification to be displayed.
@sktan810 This is a current limitation with the OneSignal SDK and the Huawei integration with the "message" type which is default. It is possible to change this to the "data" type to match how OneSignal sends FCM message by setting
"huawei_msg_type": "data"
. If you have a message body a "data" type message will still be displayed. https://documentation.onesignal.com/reference/create-notification#attachmentsHowever due note that on Huawei devices they force kill apps more aggressively so "data" message may not be able to start your app for the notification to be displayed.
@jkasten2 Alright, it works after adding "huawei_msg_type": "data"
in backend API and tested with Postman.
Plus, HMS core need to be updated to latest version and Allow the permission of Location and Notifications, in order to retrieve the values in setNotificationWillShowInForegroundHandler.
Worked as @jkasten2 described. Last versions of HMS kit can be found here: https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/hmssdk-kit-0000001050042513-V5
Description: I'm currently integrating OneSignal react-native plugin in both HMS and GMS environment, it seems like does not work in HMS environment in Huawei device without GMS. But it works in normal Android GMS device. I follow all the guidelines in OneSignal documentation as well as contacting support team in OneSignal, but seems like does not getting solution and fixes from both sides.
I able to get getDeviceState() returned values, but setNotificationWillShowInForegroundHandler() I can't get any values after test push messages from OneSignal server as well as using postman API.
Environment react-native-onesignal": "^4.0.5" gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99] com.huawei.agconnect:agcp:1.4.2.301 com.huawei.agconnect:agconnect-core:1.4.2.301 com.huawei.hms:push:5.0.2.300
Steps to Reproduce Issue: