Ionic Cordova OneSignal + Huawei InAppAlert Issue

Viewed 150

I have an existing Ionic Cordova app where i have set the inFocusDisplaying to use OSInFocusDisplayOption.InAppAlert and it works well in Android and IOS. However when i try to setup it for Huawei devices, the InAppAlert doesn't work and it only shows the Notification Banner.

Does anyone know if the InAppAlert should work in Huawei devices as well ?

Using the following setup/plugins

Cordova v10.0.0
Cordova-Android v9.1.0
onesignal-cordova-plugin v2.11.4
@ionic-native/onesignal v5.33.1
@hmscore/ionic-native-hms-push v5.1.1-301
@hmscore/cordova-plugin-hms-push v5.1.1-301

Code to initialize OneSignal

this.oneSignal.startInit('myappid');
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
this.oneSignal.handleNotificationOpened().subscribe('mycallback');
this.oneSignal.endInit();
1 Answers

According to the oneSignal documentation, this interface is deprecated .

Blockquote

So as an alternative,you may use the new setNotificationWillShowInForegroundHandler method (But I am not sure whether the OneSignal supports this function of the HMS) or you can use huawei push kit directly,which aslo supports this capability.

For details, check this Docs.

Related