Edit File: config.js
const SCOPES = ['https://www.googleapis.com/auth/firebase.messaging'], GOOGLE_APPLICATION_CREDENTIALS = __dirname+'/arsel-5b93f-firebase-adminsdk-iq6vs-8966605485.json', { google } = require('googleapis'), key = require(GOOGLE_APPLICATION_CREDENTIALS); class accessToken { static async getAccessToken(){ return new Promise(function(resolve, reject) { const jwtClient = new google.auth.JWT( key.client_email, null, key.private_key, SCOPES, null ); jwtClient.authorize(function(err, tokens) { if (err) { reject(err); return; } resolve(tokens.access_token); }); }); } } module.exports = accessToken;
Back to File Manager