APN Push Notifications in Twilio IP Messaging

I am trying to get push notifications in an application using Twilio IP Messaging. Following the instructions I see here: https://www.twilio.com/docs/api/ip-messaging/guides/push-notifications-ios

I draw spaces.

AppDelegate registration functions for remote notifications work well - iOS devices successfully provide device token for the Twilio client. However, TwilioIPMessagingClient does not indicate success or failure in registering a token. Moreover, I do not receive any signs of push notifications when sending messages. I'm not sure how to debug this further, since Twilio is a black box for APNS clicks.

Is there a logging service inside IPM / another debugging method that I can access to see the status of APN?

+5
source share
2 answers

I am a developer on the IP Messaging team at Twilio and can hope to provide more information here.

Registration feedback from the IP Messaging SDK is currently limited to errors that you will get through the delegate method -ipMessagingClient:toastRegistrationFailedWithError:

At the same time, by calling registerWithToken: in your TwilioIPMessagingClient instance, you should see the log entries that indicate that the registration is being sent to our server:

TNNotificationClient | Starting registration..., id: <....> TNRegTransport | Creating registration: apn - <....> TNRegTransport | Registration is created, location: https://ers.us1.twilio.com/v1/registrations/<...>

When a message is sent to a channel, they request registration for members of that channel and send messages sent to any registered members. Twilio uses the device token that you provide for this user using the registerWithToken: method and the SID (starting with CR) that you provided in the JWT, the client was created with this registration created. The credentials that you provide Twilio through REST or the web interface must match the registration that is performed on the device in both the AppID and the environment (sandbox versus production).

A few confirmations:

  • Make sure you create a security identifier and it appears here: https://www.twilio.com/user/account/ip-messaging/credentials
  • Make sure that when you created the credentials, you indicated whether it was for an isolated APNS sandbox (development support profiles) or a production (ad-hoc, corporate, or app store) certificate
  • Make sure that the JWT you created has a grant credential_sid and that it matches the CR and the environment in which you run the application during push registration

If you would like, I would be happy to help you diagnose this further with your specific account information if you open a ticket at https://www.twilio.com/help/contact and a link to this post. We will definitely update this SO post with any additional publicly available information that arises from this conversation.

Randy

+4
source

I found the Twilio debugging console useful for diagnosing push notification issues. I only found out about this after I received an error message in which my APNS token was invalid. This was after spending some time trying to diagnose the problem.

Here you can find the console: https://twilio.com/console/dev-tools/debugger

+2
source

Source: https://habr.com/ru/post/1245130/


All Articles