-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Expose client.close()? #4
Comments
Have you tried using my apns library (which is built on fetch-http2)? That should give you a better idea on how to correctly implement this if you want to do it from scratch for whatever reason |
I think this will give you what you want though: #5 |
I had not seen const client = new ApnsClient({
team: `team-id`,
keyId: `key-id`,
signingKey: key,
defaultTopic: `com.my.app`,
})
const bn = new Notification(token, {
alert: body,
badge,
data,
})
try {
await client.send(bn)
} catch (err) {
console.error(err.reason)
} |
I'm going to merge that PR and then update apns2 with a |
I just released v1.4.0 of this package, give it a shot. If its working correctly I'll update apns2 |
Thanks! Setting |
Hello and thanks for a nice library.
I tried to convert this code to fetch-http2. I ended up with:
It sort of works, I get the push notification, but then it hangs and the function never exists. I get the same behaviour if I comment out the
client.close()
call from the reference code above.Can this be solved without calling client.close()
The text was updated successfully, but these errors were encountered: