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

Add multiple push tokens support? #41

Open
alexalok opened this issue Oct 13, 2020 · 3 comments
Open

Add multiple push tokens support? #41

alexalok opened this issue Oct 13, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@alexalok
Copy link
Owner

Add a new AddTokens method allowing us to pass an array of push tokens so that the push is sent to each one of them instead of one.

@penguinawesome
Copy link

+1 :D For faster sending of APNS

@alexalok alexalok removed the question Further information is requested label Aug 17, 2021
@NebulaSleuth
Copy link

I would also like this feature.

In the meantime, I was wondering what the best way to do this is.
Should I create a new ApnsClient for each push, or use the same one over and over? If using the same one and there is an unsuccessful push (or anything other reason) might I need to create a new one?

I have been creating a new one each time. But I have reports that when sending thousands at a time, about half of the recipients are failing to receive the pushes. Does Apple do throttling? Any feedback is appreciated.

@alexalok
Copy link
Owner Author

In the meantime, I was wondering what the best way to do this is.

Currently the way to go is to create a new ApplePush instance for each recipient.

Should I create a new ApnsClient for each push, or use the same one over and over?

Generally, you should reuse an ApnsClient instance as much as possible, especially if you are using JWT-based authorization (as opposed to certificate-based one).

If using the same one and there is an unsuccessful push (or anything other reason) might I need to create a new one?

No, there is no need.

But I have reports that when sending thousands at a time, about half of the recipients are failing to receive the pushes.

I suggest inspecting ApnsResponse.Reason property, it might give you some clues.

Does Apple do throttling?

I'm not aware of that, but if you use JWT-based authorization you should try to reuse a single ApnsClient instance as much as possible. Internally, each ApnsClient manages its own JWT instance and APNs really doesn't like having multiple different JWTs received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants