Skip to main content
Module

x/expo_server_sdk_deno/index.ts>Expo

Server-side library for working with Expo using Deno
Latest
class Expo
import { Expo } from "https://deno.land/x/expo_server_sdk_deno@1.0.4/index.ts";

Properties

private
accessToken: string | undefined
private
limitConcurrentRequests: <T>(thunk: () => Promise<T>) => Promise<T>

Methods

private
chunkItems<T>(items: T[], chunkSize: number): T[][]
private
getErrorFromResult(response: Response, result: ApiResult): Error

Returns an error for the first API error in the result, with an optional others field that contains any other errors.

private
getErrorFromResultError(errorData: ApiResultError): Error

Returns an error for a single API error

private
getTextResponseError(response: Response, text: string): Error
private
parseErrorResponseAsync(response: Response): Promise<Error>
private
requestAsync(url: string, options: RequestOptions): Promise<any>
chunkPushNotificationReceiptIds(receiptIds: ExpoPushReceiptId[]): ExpoPushReceiptId[][]
getPushNotificationReceiptsAsync(receiptIds: ExpoPushReceiptId[]): Promise<{ [id: string]: ExpoPushReceipt; }>

Sends the given messages to their recipients via push notifications and returns an array of push tickets. Each ticket corresponds to the message at its respective index (the nth receipt is for the nth message) and contains a receipt ID. Later, after Expo attempts to deliver the messages to the underlying push notification services, the receipts with those IDs will be available for a period of time (approximately a day).

There is a limit on the number of push notifications you can send at once. Use chunkPushNotifications to divide an array of push notification messages into appropriately sized chunks.

Static Properties

pushNotificationChunkSizeLimit
pushNotificationReceiptChunkSizeLimit

Static Methods

isExpoPushToken(token: unknown): token is ExpoPushToken

Returns true if the token is an Expo push token