PayLoadion.Apns
1.1.1
.NET Standard 1.0
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.
#r "nuget: PayLoadion.Apns, 1.1.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install PayLoadion.Apns as a Cake Addin
#addin nuget:?package=PayLoadion.Apns&version=1.1.1
// Install PayLoadion.Apns as a Cake Tool
#tool nuget:?package=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 =).
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard1.0 netstandard1.1 netstandard1.2 netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1 |
.NET Framework | net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen30 tizen40 tizen60 |
Universal Windows Platform | uap uap10.0 |
Windows Phone | wp8 wp81 wpa81 |
Windows Store | netcore netcore45 netcore451 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 1.0
- NETStandard.Library (>= 1.6.1)
- Newtonsoft.Json (>= 10.0.3)
- PayLoadion (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed null checking in Dispose() methods