-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
An notify exception occurs on certain tokens.
Error message is "\Exceptions\UnexpectedResponseException(code: 500):
Unexpected response was received from Expo API".
The causative token ends in "_lD]".
If you register multiple tokens including this one and send push notifications, an error will occur.
But Push notifications will not fail if only this token is used.
Is it possible that "_lD]" has been changed to some kind of control character?
souce code
// EXPOセットアップ
$expo = Expo::normalSetup();
foreach ($expoPushTokens as $expoPushToken) {
// EXPO登録
Log::debug('subscribe expo', ['channel' => $channel, 'expo_push_token' => $expoPushToken]);
try {
$expo->subscribe($channel, $expoPushToken);
} catch (\Exception $ex) {
Log::error('subscribe exception', [$ex]);
try {
// EXPO解除
$expo->unsubscribe($channel);
} catch (\Exception $ex) {
Log::error('subscribe->unsubscribe exception', [$ex]);
return;
}
return;
}
}
$notification = [
'title' => $title,
'body' => $body,
'data' => json_encode($data),
'_displayInForeground' => true,
];
try {
// プッシュ通知
$expo->notify([$channel], $notification);
} catch (\Exception $ex) {
// ↓Location of error
Log::error('notify exception', [$ex]);
}
try {
// EXPO解除
$expo->unsubscribe($channel);
} catch (\Exception $ex) {
Log::error('unsubscribe exception', [$ex]);
return;
}
Metadata
Metadata
Assignees
Labels
No labels