APNS cert not found for requested project and bundle ID

savasy2 years ago

Hi there,

Firebase notifications don't work and when I check Firebase logs, I see "APNS cert not found for requested project and bundle ID" error message.

Any idea what it is?

Best,

Savas

Anton Tananaev2 years ago

It probably means that you haven't configured the Apple certificate in your Firebase console.

savasy2 years ago

Thanks Anton,

We configured the Apple certificate in your Firebase console, no more error messages on the logs. However, we still don't get Firebase notifications.

Best,

Savas

Anton Tananaev2 years ago

If there are no errors, it means that is was sent somewhere.

savasy2 years ago

I checked traccar server log file and noticed below error message.

2023-05-23 08:00:48  WARN: Firebase error - 400 Bad Request
POST https://oauth2.googleapis.com/token
{"error":"invalid_grant","error_description":"Invalid JWT Signature."} - HttpResponseException (... < NotificatorFirebase:114 < NotificationResource:96 < ...)
Anton Tananaev2 years ago

Sounds like some error with authentication.

savasy2 years ago

I deleted and created a new Firebase key, same error message.

My config,

<!-- Firebase  SETTINGS -->
<entry key='notificator.firebase.serviceAccount'>
{
  "type": "service_account",
  "project_id": ".................",
  "private_key_id": ".....................",
  "private_key": "-----BEGIN PRIVATE KEY-----\...............
  "client_email": "firebase-adminsdk-ha9v9@................",
  "client_id": ".....................",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/...............>  
  "universe_domain": "googleapis.com"
}
</entry>