This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
import functions = require("firebase-functions"); | |
import admin = require("firebase-admin"); | |
import * as rcFunctions from './RemoteConfigFunctions'; | |
import { RemoteConfigObj } from "./RemoteConfigObj"; | |
import * as secretProps from '../SecretProperties'; | |
const request = require('request'); | |
const STATUS_CODE_OK = 200 | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
admin.initializeApp({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PlatformSettingsObj, PushTopics, Platform } from './RemoteConfigObj'; | |
import { SCOPES } from '../SecretProperties'; | |
const { google } = require('googleapis'); | |
/** | |
* This method is for requesting an access token. | |
* @param service - is the service account data. | |
*/ | |
export function getAccessToken(service: any) { | |
return new Promise(function (resolve, reject) { | |
const jwtClient = new google.auth.JWT( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const DB_URL = "https://projec-name.firebaseio.com" | |
export const SCOPES = ["https://www.googleapis.com/auth/firebase.remoteconfig"]; | |
export const FB_URL_RC = | |
"https://firebaseremoteconfig.googleapis.com/v1/projects/projec-name/remoteConfig" | |
export const service: any = { | |
"type": "service_account", | |
"project_id": "********************", | |
"private_key_id": "********************", | |
"private_key": "********************", | |
"client_email": "********************", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface RemoteConfigObj { | |
parameters: Parameter; | |
version: Version; | |
} | |
export interface Parameter { | |
platform_setting: PlatformSettingsRC | |
} | |
export interface PlatformSettingsRC { | |
defaultValue: DefValue | |
} |
NewerOlder