Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apns push type override is not included in the list #574

Closed
chenkuanhuaian opened this issue Dec 10, 2019 · 4 comments
Closed

Apns push type override is not included in the list #574

chenkuanhuaian opened this issue Dec 10, 2019 · 4 comments

Comments

@chenkuanhuaian
Copy link

Description:

Hi, as this article suggest

“required when delivering notifications to devices running iOS 13”. Furthermore “if the header is missing on required systems, APNs may delay the delivery of the notification or drop it altogether.”

and according to OneSignal documentation https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/

I'm trying to add
key : apns_push_type_override
value : alert
in my header when I send post request

my I got this error

Client error: POST https:\/\/onesignal.com\/api\/v1\/notifications resulted in a 400 Bad Requestresponse:\n{\"errors\":[\"Apns push type override is not included in the list\"]}

I wondered what does this error mean, what is the "list" we are talking about.

tried to google the key words, but none helpful results.

Environment

SDK version 2.11.2, using cocoapods.

Steps to Reproduce Issue:

  1. add key value pair in my request header using postman
  2. send the request

Anything else:

(crash stacktraces, as well as any other information here)

@jkasten2
Copy link
Member

@chenkuanhuaian OneSignal will automatically set alert for you. You only need to use apns_push_type_override with OneSignal if you need to set voip. We will update our docs as I can see the confusion with this param.

@Div-VT
Copy link

Div-VT commented Dec 13, 2019

Hi @jkasten2 ,

Thanks for your response,
but I found your document about apns_push_type_override param below:

Set the value to voip for sending VoIP Notifications
Other valid values (Apple docs):
- alert
- background
- complication
- fileprovider
- mdm

I think default alert is good, but there are other options for apns_push_type_override.
I'd like to know why other options can't be use beacuse sometimes I need to use background for silent push.
If you can support that, I'll be very appreciate.

@jkasten2
Copy link
Member

jkasten2 commented Jan 8, 2020

@Div-VT Sorry for the confusion, this was meant to only show what Apple provides, we have updated the documentation page. OneSignal will automatically set alert or background for apns-push-type. voip is the only valid override, since it can't automatically be detected like alert or background can.
https://documentation.onesignal.com/reference#section-delivery

complication, fileprovider, and mdm are not support by OneSignal currently but let us know if these options are needed.

@gpminsuk
Copy link

@jkasten2 What's the condition when OneSignal automatically sets it to background?

    const notification = new OneSignal.Notification();

    notification.app_id = process.env.ONESIGNAL_APP_ID;
    notification.include_external_user_ids = ["user1"];
    notification.content_available = true;
    notification.mutable_content = true;
    notification.data = { foo: "bar" };

This is my notification struct and I don't think background is being set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants