diff --git a/src/fcm/index.js b/src/fcm/index.js index 408c097..7cf6440 100644 --- a/src/fcm/index.js +++ b/src/fcm/index.js @@ -17,15 +17,9 @@ async function registerFCM({ senderId, token }) { }, form : { authorized_entity : senderId, - endpoint : `${FCM_ENDPOINT}/${token}`, - encryption_key : keys.publicKey - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'), - encryption_auth : keys.authSecret - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_'), + endpoint : escape(`${FCM_ENDPOINT}/${token}`), + encryption_key : keys.publicKey, + encryption_auth : keys.authSecret, }, }); return {