Apple Push Notification using .net http2

I am trying to send apple push notifications using c# dot net code. in that i am able to send notification using

gateway.sandbox.push.apple.com

but i need to use the following host for sending notification

api.development.push.apple.com

api's.

can anyone please send the code or link for certificate based or token based send notification

Thanks in Advance.

Upvotes: 2

Views: 2705

Answers (1)

Andrei
Andrei

Reputation: 44600

With .NET Core you can use this lightweight library for APN HTTP/2 Push notifications (And also FCM if needed):

Install-Package CorePush

This is JWT token based sending:

using (var apn = new ApnSender(
    p8privateKey, 
    p8privateKeyId, 
    teamId, appBundleIdentifier, server)) 
{
    await apn.SendAsync(deviceToken, notification);
}

Upvotes: 2

Related Questions