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

Is there a way to include apns headers #34

Open
michzio opened this issue Mar 14, 2020 · 7 comments
Open

Is there a way to include apns headers #34

michzio opened this issue Mar 14, 2020 · 7 comments
Labels
waiting for feedback Answered/solved by collaborators, awaiting feedback from the issue author

Comments

@michzio
Copy link

michzio commented Mar 14, 2020

With watchOS 6 standalone and i think new app there is requirement for

"apns-topic": "#bundle-id" ,
"apns-push-type": "alert",

I think it should go not into body but into the header. So it will be nice to define header fields!

@Ariandr
Copy link
Collaborator

Ariandr commented Mar 14, 2020

Hi @michzio
The app sets these headers automatically, both apns-topic and apns-push-type.

Without apns-topic the notifications wouldn't work at all and when you specify bundle id, you set the header. apns-push-type was defined starting from iOS 13 and app version 1.7.0+ supports it.

Please, check out the latest stable release if you are using an old version and having any issues with that: https://github.com/onmyway133/PushNotifications/releases

@Ariandr Ariandr added the waiting for feedback Answered/solved by collaborators, awaiting feedback from the issue author label Mar 14, 2020
@michzio
Copy link
Author

michzio commented Mar 16, 2020

Ok cause I am searching for reason why my standalone watchOS app is not receiving push notifications but through iOS app it is delivered to watch correctly.

@Ariandr
Copy link
Collaborator

Ariandr commented Mar 18, 2020

Hi @michzio
Okay, I see.
I will close the issue for now, but if you find something specific, please feel free to create a new issue or reopen this one with additional details.

@Ariandr Ariandr closed this as completed Mar 18, 2020
@onmyway133 onmyway133 reopened this Mar 22, 2020
@ArturRuZ
Copy link

Good day! Is there way to change apns-push-type from "alert" to "background"?

@Ariandr
Copy link
Collaborator

Ariandr commented Apr 22, 2021

Hi @ArturRuZ
Now it's set if content-available == 1 and there are no other fields included in aps (exception is category)

.....
 .... else if (aps && aps["content-available"] === 1) {
        const maxKeysNumber = aps.hasOwnProperty("category") ? 2 : 1

        let size = 0, key
        for (key in aps) {
          size++
        }

        if (size === maxKeysNumber) {
          notification.pushType = "background"
          notification.priority = 5
        }
      }

@max-potapov
Copy link

@Ariandr
Copy link
Collaborator

Ariandr commented Nov 18, 2022

Hi @max-potapov
You can enter collapse id from the UI and it's send inside apns-collapse-id header.
Two others are not available to enter now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Answered/solved by collaborators, awaiting feedback from the issue author
Projects
None yet
Development

No branches or pull requests

5 participants