PayLoadion.Apns 1.1.1

The implementation of PayLoadion for APNS - Apple Push Notification Service.

Install-Package PayLoadion.Apns -Version 1.1.1
dotnet add package PayLoadion.Apns --version 1.1.1
<PackageReference Include="PayLoadion.Apns" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PayLoadion.Apns --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PayLoadion.Apns

<img src="https://github.com/vinguan/payloadion/blob/master/ProjectsIcons/PayLoadion.Apns/payloadion_apple.png?raw=true" width="200">

Implementation of PayLoadion for Apple Push Notification Service(APNS), following Remote Notification Programming Guide of APNS.

Nuget

Install-Package PayLoadion.Apns

Getting Started

Creating the PayloadBuilder

var apnsPayloadBuilder = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()

Building a simple Apns's Payload

PayLoad built to object

var apnsPayload = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                           .Alert("Simple Message")
                                           .BuildPayLoad();

PayLoad built and serialized to string

var apnsPayloadString = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                                 .Alert("Simple Message")
                                                 .BuildPayLoadToString(true);

It should produce this Payload :

{
  "aps": {
    "alert": "Simple Message"
  }
}

More complex cenarios

Custom Alert

var apnsPayLoadString = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                                 .Alert()
                                                 .Title("Hello Payloadion.Apns Title")
                                                 .Body("Hello Payloadion.Apns Body")
                                                 .BuildPayLoadToString(true);

It should produce this Payload :

{
  "aps": {
    "alert": {
      "title": "Hello Payloadion.Apns Title",
      "body": "Hello Payloadion.Apns Body"
    }
  }
}

With Custom data

var apnsPayLoadString = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                                 .Alert()
                                                 .Title("Hello Payloadion.Apns")
                                                 .Body("Hello Payloadion.Apns Body")
                                                 .AddCustomData("NewsId", 11)
                                                 .BuildPayLoadToString(true);

It should produce this Payload :

{
  "aps": {
    "alert": {
      "title": "Hello Payloadion.Apns",
      "body": "Hello Payloadion.Apns Body"
    }
  },
  "NewsId": 11
}

Author

Vinicius Gualberto @Vinguan.

Contribute

Fork me and send the pull requests =).

PayLoadion.Apns

<img src="https://github.com/vinguan/payloadion/blob/master/ProjectsIcons/PayLoadion.Apns/payloadion_apple.png?raw=true" width="200">

Implementation of PayLoadion for Apple Push Notification Service(APNS), following Remote Notification Programming Guide of APNS.

Nuget

Install-Package PayLoadion.Apns

Getting Started

Creating the PayloadBuilder

var apnsPayloadBuilder = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()

Building a simple Apns's Payload

PayLoad built to object

var apnsPayload = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                           .Alert("Simple Message")
                                           .BuildPayLoad();

PayLoad built and serialized to string

var apnsPayloadString = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                                 .Alert("Simple Message")
                                                 .BuildPayLoadToString(true);

It should produce this Payload :

{
  "aps": {
    "alert": "Simple Message"
  }
}

More complex cenarios

Custom Alert

var apnsPayLoadString = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                                 .Alert()
                                                 .Title("Hello Payloadion.Apns Title")
                                                 .Body("Hello Payloadion.Apns Body")
                                                 .BuildPayLoadToString(true);

It should produce this Payload :

{
  "aps": {
    "alert": {
      "title": "Hello Payloadion.Apns Title",
      "body": "Hello Payloadion.Apns Body"
    }
  }
}

With Custom data

var apnsPayLoadString = ApnsPayLoadBuilderFactory.CreateApnsPayLoadBuilder()
                                                 .Alert()
                                                 .Title("Hello Payloadion.Apns")
                                                 .Body("Hello Payloadion.Apns Body")
                                                 .AddCustomData("NewsId", 11)
                                                 .BuildPayLoadToString(true);

It should produce this Payload :

{
  "aps": {
    "alert": {
      "title": "Hello Payloadion.Apns",
      "body": "Hello Payloadion.Apns Body"
    }
  },
  "NewsId": 11
}

Author

Vinicius Gualberto @Vinguan.

Contribute

Fork me and send the pull requests =).

Release Notes

Fixed null checking in Dispose() methods

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.1 160 1/5/2019
1.1.0 374 6/30/2017
1.0.2 672 5/2/2016
1.0.1 301 4/27/2016
1.0.0 272 4/27/2016