twilio / voice-quickstart-ios

Twilio Voice Quickstart for iOS with Swift
MIT License
178 stars 95 forks source link

[Invalid APNS token] Unable to receive incoming call notification for Adhoc (Firebase App Distribution) apps #505

Closed abhinavsingh closed 1 year ago

abhinavsingh commented 1 year ago

Description

Please see Ticket ID 9327718 for background. I was asked to open a ticket with the SDK team here.

We are using Firebase App Distribution for ad-hoc builds. But somehow, this doesn't seem to work. Devices are unable to receive incoming call notification. Apple rejects notification with Invalid APNS token error.

Note that, same works fine when app is installed using XCode/VSCode etc (i..e debug build).

Steps to Reproduce

  1. Distribute app via Firebase App Distribution
  2. Call the app
  3. Invalid APNS token errors

Expected Behavior

Ad-Hoc builds must receive incoming call notifications as do builds via XCode & TestFlight.

Actual Behavior

Ad-Hoc builds don't receive incoming call notifications. Apple rejects it with Invalid Device token errors.

Reproduces How Often

100%

Twilio Call SID(s)

CAa584bdee31918cfe733c63a91814639b

^^^ I created a new Twilio account as recommended by support team. This required end-to-end re-setup including new VoIP certificates and credentials. Unfortunately, results in the same error.

iOS Version

12.5.5

iOS Device

iPhone 6

bobiechen-twilio commented 1 year ago

Hi @abhinavsingh

Thanks for reaching out and providing the Call SID. I've checked the system and found that indeed that the system failed to send the notification delivery request to Apple. I also noticed that under the same Push Credential, there are successful push notification deliveries afterwards, which mean you probably solve the issue itself.

Let us know if you still need help getting the incoming call notifications to work. If this issue is only happening on some devices, try unregister and register so the push notification binding has the correct PushKit device token for the APNS requests.

abhinavsingh commented 1 year ago

@bobiechen-twilio Thank you. Yes, I was able to resolve this shortly after raising this issue. Closing this for now. Will re-open if we run into similar issue again. Best