expo-server-sdk
Advanced tools
Comparing version 3.7.0 to 3.8.0
@@ -9,2 +9,3 @@ /// <reference types="node" /> | ||
private accessToken; | ||
private useFcmV1; | ||
constructor(options?: ExpoClientOptions); | ||
@@ -52,2 +53,3 @@ /** | ||
accessToken?: string; | ||
useFcmV1?: boolean; | ||
}; | ||
@@ -54,0 +56,0 @@ export declare type ExpoPushToken = string; |
@@ -70,2 +70,3 @@ "use strict"; | ||
this.accessToken = options.accessToken; | ||
this.useFcmV1 = options.useFcmV1; | ||
} | ||
@@ -94,2 +95,7 @@ /** | ||
return __awaiter(this, void 0, void 0, function* () { | ||
// @ts-expect-error We don't yet have type declarations for URL | ||
const url = new URL(`${BASE_API_URL}/push/send`); | ||
if (typeof this.useFcmV1 === 'boolean') { | ||
url.searchParams.append('useFcmV1', this.useFcmV1); | ||
} | ||
const actualMessagesCount = Expo._getActualMessageCount(messages); | ||
@@ -99,3 +105,3 @@ const data = yield this.limitConcurrentRequests(() => __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
return yield this.requestAsync(`${BASE_API_URL}/push/send`, { | ||
return yield this.requestAsync(url.toString(), { | ||
httpMethod: 'post', | ||
@@ -102,0 +108,0 @@ body: messages, |
{ | ||
"name": "expo-server-sdk", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"description": "Server-side library for working with Expo using Node.js", | ||
@@ -5,0 +5,0 @@ "main": "build/ExpoClient.js", |
@@ -19,3 +19,6 @@ # expo-server-sdk-node ![Tests](https://github.com/expo/expo-server-sdk-node/workflows/Tests/badge.svg) [![codecov](https://codecov.io/gh/expo/expo-server-sdk-node/branch/master/graph/badge.svg)](https://codecov.io/gh/expo/expo-server-sdk-node) | ||
// optionally providing an access token if you have enabled push security | ||
let expo = new Expo({ accessToken: process.env.EXPO_ACCESS_TOKEN }); | ||
let expo = new Expo({ | ||
accessToken: process.env.EXPO_ACCESS_TOKEN, | ||
useFcmV1: false // this can be set to true in order to use the FCM v1 API | ||
}); | ||
@@ -71,3 +74,3 @@ // Create the messages that you want to send to clients | ||
// Later, after the Expo push notification service has delivered the | ||
// notifications to Apple or Google (usually quickly, but allow the the service | ||
// notifications to Apple or Google (usually quickly, but allow the service | ||
// up to 30 minutes when under load), a "receipt" for each notification is | ||
@@ -74,0 +77,0 @@ // created. The receipts will be available for at least a day; stale receipts |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
34692
443
143
0