pusher / push-notifications-swift

Swift SDK for the Pusher Beams product:
https://www.pusher.com/beams
MIT License
34 stars 24 forks source link

SDK will not start #154

Closed MagzhanImangazy closed 4 years ago

MagzhanImangazy commented 4 years ago

Unrecoverable error when registering device with Pusher Beams (Reason - Bad Device Token: The device token could not be validated against any known credentials) how solve this problem?

rorycoconnor commented 4 years ago

I am also receiving this error. I have recreated the Beams instance, tried new certs and keys and nothing seems to change the behavior. I am able to successfully print the deviceToken to the console, but I cannot get past this step.

Any ideas?

buhikon commented 4 years ago

the same error happened. this has to be fixed.

luismfonseca commented 4 years ago

Thanks for raising it, we are looking into it now. We will update when we have more details.

jonathanlloyd commented 4 years ago

Hi, we're looking into this now. I will post a reply here when we have a solution.

jonathanlloyd commented 4 years ago

We're looking to reproduce this issue - could everyone please contact support@pusher.com and provide:

Thank you

rorycoconnor commented 4 years ago

Hi y'all,

I was able to resolve this issue. It was a problem with my cert files files from Apple. I would recommend that anyone running into this problem check the following area:

  1. Go to the developer.apple.com portal and access Certificats, Identifiers and Profiles.
  2. Click to Identifiers in the left hand console.
  3. Click into the app experiencing this problem.
  4. Find the Push Notification Setting. Presumably, y'all already had this enabled.
  5. Click "Configure".

Now this is where I found my problem. When creating the certificate initially, I had chosen "Sandbox and Production". If you made the same error as myself, in the "Configure" modal mentioned above, you will see that no Developer cert had been associated. I simply walked through the steps to create and add that cert to Keychain. I then restarted Xcode and reinstalled the app on my phone and it worked!

Let me know if y'all hit any snags.

jonathanlloyd commented 4 years ago

Hello all,

This looks like an issue with how APNs credentials are being configured. We've updated Beams to return specific error messages in this case, this should help you resolve any issues with configured certificates. If the issue persists, please send any details to support@pusher.com where we'll help you debug further.

Thanks!

zzantares commented 4 years ago

For the record, I did experience this same error message The device token could not be validated against any known credentials while developing for Android, I don't know what was the cause but deleting the instance in the pusher dashboard and re-creating it again (and following the quick start setup) made it to work again.