twilio / voice-quickstart-ios

Twilio Voice Quickstart for iOS with Swift
MIT License
183 stars 97 forks source link

Not Getting Incoming Voice Notification #547

Closed wmt-raj-mobile closed 1 year ago

wmt-raj-mobile commented 1 year ago

'm getting success message from this method """ TwilioVoiceSDK.register(accessToken: accessToken, deviceToken: cachedDeviceToken) { error in if let error = error { NSLog("An error occurred while registering: (error.localizedDescription)") } else { NSLog("Successfully registered for VoIP push notifications.") } }

""" and my certificate is also not expired but still getting

"52131 - Invalid APNs credentials" this error

Please HELP!

bobiechen-twilio commented 1 year ago

Hi @wmt-raj-mobile

From the error code most likely the certificate or key in the Push Credential is incorrect or the format is not valid. Please make sure you followed the quickstart quide for retrieving the credentials out of the VoIP Certificate.

wmt-raj-mobile commented 1 year ago

I have followed Quickstart Quide and made certificates accordingly, but still getting ""52131 - Invalid APNs credentials" this error" and Twilio SDK also returning success message "Successfully registered for VoIP push notifications" Can you please help me with this

i have used this commands to generate key and certificates openssl pkcs12 -in PATH_TO_YOUR_P12 -nokeys -out cert.pem -nodes openssl x509 -in cert.pem -out cert.pem openssl pkcs12 -in PATH_TO_YOUR_P12 -nocerts -out key.pem -nodes openssl rsa -in key.pem -out key.pem

bobiechen-twilio commented 1 year ago

Hi @wmt-raj-mobile

The successful registration message from the SDK means the account credentials in the access token and the PushKit device token passed in the register() method are valid, but the certificate information stored in the Push Credential might not be valid and Twilio was not able to send the push notification request to APNS successfully.

Please check that you have copied

when filling the APN Push Credential in the developer console. Also make sure the sandbox option is configured correctly according to the iOS app development environment (see quickstart instructions)

wmt-raj-mobile commented 1 year ago

Ok i think it was cache issue i removed the existing push creds ids and added new one from twilio and its starts working