I am trying to send push notifications using the expo-server-sdk-node package from a firebase cloud function.
the server returns a fetchError : getaddrinfo EAI_AGAIN exp.host:443
The rest of the function executes with no error.
The expo token and message format seem correct (see actual behavior).
I use :
let chunk = expo.chunkPushNotifications(messages);
let ticketChunk = await expo.sendPushNotificationsAsync(chunk);
The message object sent is :
[ { to: 'ExponentPushToken[wpZZfVOYDjb8Xq_jmNOXGI]',
sound: 'default',
body: 'jkObject wrote : Hello World!',
title: 'New Message on PiPle' } ]
The ticketChunk gets this error :
{ FetchError: request to https://exp.host/--/api/v2/push/send failed, reason: getaddrinfo EAI_AGAIN exp.host:443
at ClientRequest.<anonymous> (/srv/node_modules/node-fetch/lib/index.js:1345:11)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
message: 'request to https://exp.host/--/api/v2/push/send failed, reason: getaddrinfo EAI_AGAIN exp.host:443',
type: 'system',
errno: 'EAI_AGAIN',
code: 'EAI_AGAIN' }