Notificare / notificare-sdk-android

Notificare's Android SDK
MIT License
2 stars 0 forks source link

Notification not received for huawei device that uses only hms #48

Closed gtsak1 closed 1 year ago

gtsak1 commented 1 year ago

Notification is sent and received successfully by non-huawei devices as well as by huawei devices using both gms+hms. Problem is that newest huawei devices running only hms seem to not allow app to send remote notification (see attached screenshots). Also, hms only devices have transport protocol set to "Notificare", not "HMS". I am not sure if that is the problem. Notificare version used is 3.3.1

Screenshot 2022-10-18 at 11-29-37 Notificare - Marketing Automation Platform Screenshot 2022-10-18 at 10-32-25 Notificare - Marketing Automation Platform Screenshot 2022-10-18 at 10-32-48 Notificare - Marketing Automation Platform

hpinhal commented 1 year ago

Hi @gtsak1 ,

You must include the push-hms peer dependency for supporting HMS devices.

implementation "re.notifica:notificare-push:$notificare_version"
implementation "re.notifica:notificare-push-gms:$notificare_version"        // Enable support for Google Mobile Services.
implementation "re.notifica:notificare-push-hms:$notificare_version"

I've quickly tested it with our sample app and push messages are being received.

We intend to keep the GitHub issues as a channel for reporting bugs. For support-related matters, please create a ticket via our helpdesk or send an email to support@notifica.re. That way we can provide more contextualised support.

gtsak1 commented 1 year ago

Thank you for your answer. I have already included both gms and hms notificare peer dependencies and followed the process for seting up firebase and hms in the project.

hpinhal commented 1 year ago

We cannot reproduce this with our HMS-only devices.

Can you share some evidence of the problem? Application logs from the configuration phase until after you've enabled remote notifications, a sample app where the problem occurs.

For the logs, enable debug logging by adding the following to your AndroidManifest.xml application node:

<meta-data android:name="re.notifica.debug_logging_enabled" android:value="true" />
gtsak1 commented 1 year ago

It seems there is certificate fingerprint error, although I have configured SHA-256 certificate fingerprint in developer Huawei appGallery Connect

E/Notificare: [ServiceManager] Failed to retrieve HMS token. com.huawei.hms.common.ApiException: 6003: certificate fingerprint error

There is also a warning:

W/Notificare: [NotificarePush] Push notifications permission is denied for this app.

hpinhal commented 1 year ago

Unlike Firebase, Huawei requires you to configure all fingerprints — not just the release fingerprint. I suggest checking your signing configurations (debug & release), configuring those in the Huawei portal and downloading their configuration file. From that error, we can be sure it's a configuration mismatch.

Regarding the warning, the SDK only prints the warning but does not restrict anything. We must, indeed, improve that warning since it's only checking for the FCM permission, which is not applicable in this case. I will create a task for correctly checking and issuing the appropriate warning, but you can discard this warning.

gtsak1 commented 1 year ago

Problem solved by adding apps in the Huawei portal for every product flavor of the project and by adding debug and release SHA-256 certificate fingerprints for each app in the Huawei portal.