Onesignal-ios-sdk: OneSignal voip push fail on iOS 13.1.2

Created on 6 Oct 2019  ·  27Comments  ·  Source: OneSignal/OneSignal-iOS-SDK

Description:

I am trying to send voip notification through the REST API
Here is the payload
let payload = { app_id: env.oneSignalVoipAppId, include_player_ids: deviceList, data: userData, contents: {'zh-Hant': '遠距帶看需求', 'en': 'Remote Assistant'}, content_available: true, priority: 5, ttl: 30 };

And iOS PushKit can't receive payload on "didReceiveIncomingPushWith"
However, I saw the message was delivered on Dashboard
The code was work before, I don't know what's happened recently.

Environment

The iOS version is 13.1.2, and app is run on debug mode.

DO I need change something on REST api ?

Not OneSignal Enhancement / Feature Maintenance Issue Reproducible

Most helpful comment

Hi @rgomezp ,

Thank you for letting us know about the current status. But I don't think that it's a OneSignal-iOS-SDK issue and can be fixed on the client-side (OneSignal-iOS-SDK). I'm handling VoIP notification without using the SDK (because the SDK doesn't support PushKit VoIP notifications yet) and _pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:_ is never called only in _Debug_ mode for OneSignal notifications (again, it's called if I send notifications using other services). It seems to be a server-side issue

All 27 comments

I found similar issue from Amazon SNS voip push: https://forums.aws.amazon.com/thread.jspa?threadID=310017

Our issue is same as the above topic, production is work, sandbox env is not work

In iOS 13+, PushKit can only be used for VOIP calls. You can’t use it as a method for ensuring the app starts up in the background. Can you explain how you’re using PushKit?

Generally, we used the PushKit device token to do voip push, and immediately call reportNewIncomingCall after receive the notification.
Our app can receive the voip notification on release mode, however it can't work on sandbox mode.
https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/
I found the APN request already was changed from below link,
So the summary the issues we had:

  1. We can't receive the voip notification on sandbox mode, even the app is on foreground.
  2. In addition, app in background mode can't receive the voip notification (app is run on release mode)

I can't find how to setup parameters apn-priority and apn-push-type (voip) on REST notification create API
BTW, I used the apn testing tool to send voip notification, our app can receive notification payload from delegate "didReceiveIncomingPushWith", so I think the onesignal REST api should change something ?

We plan on fixing this soon. Thanks for your patience

I have the same issue here.
I built my app with a dev certificate and registered the device through the API with _test_type_ set to _1_. I see that VOIP notifications are marked as delivered no _pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:_ handler is called.
I use Twilio.Voice.SDK at the same time and the app does receive VOIP notifications in sandbox mode from Twilio.

But once I publish the app (ad-hoc, AppStore) and omit _test_type_ parameter it starts receiving all the VOIP notifications from the same OneSignal application.

Let me know if you want me to provide more info about this issue.

I have the same problem and there is no position on the correction, we are studying to remove the one signal because there is no provision to fix.

any progress?

Hello,
No progress yet, unfortunately. Thanks for your patience. If anyone would like to help, feel free to open a PR!

Hi @rgomezp ,

Thank you for letting us know about the current status. But I don't think that it's a OneSignal-iOS-SDK issue and can be fixed on the client-side (OneSignal-iOS-SDK). I'm handling VoIP notification without using the SDK (because the SDK doesn't support PushKit VoIP notifications yet) and _pushRegistry:didReceiveIncomingPushWithPayload:forType:withCompletionHandler:_ is never called only in _Debug_ mode for OneSignal notifications (again, it's called if I send notifications using other services). It seems to be a server-side issue

@dkornev ,
I'm sure you're correct. I'm not the one familiar with the implementation. Apologies for the confusion

@dkornev
Hi, is push voip working for you? Could you better explain how you implemented it to work?

@dkornev I am experiencing something similar.

didReceiveIncomingPushWithPayload doesn't ever get called when running Debug mode.

I have checked that the signing certificates are all good, I also pass test_type=1 when registering the device with OneSignal, and there are no errors/warning on the OneSignal dashboard.

Everything works fine in Release mode, but I am not able to test VoIP Push in Debug mode :(

there is anything new about that? i follow all the steps but still 'didReceiveIncomingPushWithPayload' function not getting called neve (also when I try to build release build'

Hi, we are working to resolve this issue

I received the information that this issue has been resolved. It should be sent to api
Apns_push_type_override parameter key with voip value
https://documentation.onesignal.com/docs/voip-notifications

I received the information that this issue has been resolved. It should be sent to api
Apns_push_type_override parameter key with voip value
https://documentation.onesignal.com/docs/voip-notifications

you test that and it's work?

I haven't had evolution yet, for me it didn't work

I can only push when the app is open, with it in the background the notification is not displayed, we will end up adopting another service for notification deliveries

I really not understand, onesignel team say it needs to work when adding Apns_push_type_override parameter key with voip value but actually nothing happened yet... and no any answer here.. So I really don't know status of this issue.

Thanks for your patience while we continue testing

Thanks for everyone waiting for a resolution. The issue is now fixed on OneSignal's backend. You can use either a VoIP specific .p12 OR a normal push cert such as one created from the OneSignal Provisionator tool.

2nd as noted by above, you can only send VoIP notifications via the OneSignal REST API and include the "apns_push_type_override": "voip" setting in your JSON payload.
Example:

{
    "app_id": "99999999-8888-7777-6666-555555555555",
    "include_player_ids": ["99999999-8888-7777-6666-555555555555"],
    "contents": { "en": "test" },
    "apns_push_type_override": "voip"
}

If you continue to see errors ensure the following is correct;

  1. The player id is correct in include_player_ids
  2. Check the pushToken for the player id matches the one shown your app from the PushKit didUpdatePushCredentials callback.

    • The pushToken for the player can be viewed on the OneSignal dashboard under All Users.

  3. Ensure the test_type is correct for the player_id when it was created with the api/v1/players endpoint.

    • test_type should be 1 for sandbox. Set this for the development version of your app.

    • Omit test_type for production, ad-hoc, or test flight builds of your app.

  4. Ensure you have made the required PushKit changes to your app for iOS 13
  5. Please fully read our updated VoIP documentation to ensure nothing else was missed.

Hi @jkasten2 this change broke our app for a few hours today.

Did OneSignal notify customers of this breaking change?

@rcidt Before this change today VoIP notifications were not working from OneSignal since this issue was reported

@jkasten2 they weren't working for debug builds, but were working fine for release builds.

Today, this change broke all builds.

@jkasten2 They were not working for _DEBUG_ builds only. Right now they are not being sent to _RELEASE_ builds

@dkornev you need to add the following flag to your OneSignal api request "apns_push_type_override": "voip"

@rcidt thank you!

Was this page helpful?
0 / 5 - 0 ratings