Community.Expo.Server.SDK 1.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Community.Expo.Server.SDK --version 1.0.7                
NuGet\Install-Package Community.Expo.Server.SDK -Version 1.0.7                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Community.Expo.Server.SDK" Version="1.0.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Community.Expo.Server.SDK --version 1.0.7                
#r "nuget: Community.Expo.Server.SDK, 1.0.7"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Community.Expo.Server.SDK as a Cake Addin
#addin nuget:?package=Community.Expo.Server.SDK&version=1.0.7

// Install Community.Expo.Server.SDK as a Cake Tool
#tool nuget:?package=Community.Expo.Server.SDK&version=1.0.7                

community-expo-push-notification-server-sdk

created by Ashley Messer

modified by Mikita Slaunikau

Installation

Install package through NuGet - Community.Expo.Server.SDK

Usage


using ExpoCommunityNotificationServer.Client;
using ExpoCommunityNotificationServer.Models;

	private IPushApiClient _client = new PushApiClient("your token here");
	PushTicketRequest pushTicketRequest1 = new PushTicketRequest()
            {
                PushTo = new List<string>() { ... },
                PushTitle = "TEST 1",
                PushBody = "TEST 1",
                PushChannelId = "test"
            };
        PushTicketRequest pushTicketRequest2 = new PushTicketRequest()
            {
                PushTo = new List<string>() { ... },
                PushTitle = "TEST 2",
                PushBody = "TEST 2",
                PushChannelId = "test"
            };

	PushTicketResponse result = await _client.SendPushAsync(
		new List<PushTicketRequest>() { pushTicketRequest1, pushTicketRequest2 }
		);

	if (result?.PushTicketErrors?.Count() > 0) 
	{
		foreach (var error in result.PushTicketErrors) 
		{
			// handle errors
		}
	}

//If no errors, then wait for a few moments for the notifications to be delivered
//Then request receipts for each push ticket

...

// Later, after the Expo push notification service has delivered the
// notifications to Apple or Google (usually quickly, but allow the the service
// up to 30 minutes when under load), a "receipt" for each notification is
// created. The receipts will be available for at least a day; stale receipts
// are deleted.
//
// The ID of each receipt is sent back in the response "ticket" for each
// notification. In summary, sending a notification produces a ticket, which
// contains a receipt ID you later use to get the receipt.
//
// The receipts may contain error codes to which you must respond. In
// particular, Apple or Google may block apps that continue to send
// notifications to devices that have blocked notifications or have uninstalled
// your app. Expo does not control this policy and sends back the feedback from
// Apple and Google so you can handle it appropriately.
	
	PushReceiptRequest pushReceiptRequest = new PushReceiptRequest() { PushTicketIds = new List<string>() { ... } };
	PushReceiptResponse pushReceiptResult = await _client.GetReceiptsAsync(pushReceiptRequest);

	if (pushReceiptResult?.ErrorInformations?.Count() > 0) 
	{
		foreach (var error in result.ErrorInformations) 
		{
			// handle errors
		}
	}
	foreach (var pushReceipt in pushReceiptResult.PushTicketReceipts) 
	{
		// handle delivery status, etc
	}

See Also

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.2 is compatible.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.2 2,953 6/23/2024
1.2.1.1 20,619 10/11/2022
1.2.1 1,201 8/18/2022
1.2.0.2 608 7/29/2022
1.2.0.1 473 6/22/2022
1.2.0 530 6/9/2022
1.1.2 2,187 3/5/2022
1.1.1 1,011 1/4/2022
1.0.7 4,468 12/22/2021
1.0.6 936 12/3/2021

add interface