This file contains 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 | |
} |
This file contains 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 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 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 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
override fun onCreate() { | |
super.onCreate() | |
initFirebase() | |
this.getRCF().setDefaultRC() | |
} | |
private fun initFirebase() { | |
FirebaseApp.initializeApp(this) | |
firebaseRemoteConfig = FirebaseRemoteConfig.getInstance() | |
val configSettings = FirebaseRemoteConfigSettings.Builder() | |
.setFetchTimeoutInSeconds(0) |
This file contains 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
/** | |
* App extension function, which return reference on RemoteConfigFunctions. | |
* @return reference on RemoteConfigFunctions. | |
*/ | |
fun App.getRCF() = RemoteConfigFunctions(gson, this, this, remoteConfigManager) |
This file contains 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
class FCMService : FirebaseMessagingService() { | |
companion object { | |
private const val TAG = "FCMService" | |
private const val RECEIVER_TAG = "Receiver:" | |
const val IN_AP_EX_STR_TITLE = "in_ap_ex_str_title" | |
const val IN_AP_EX_STR_BODY = "in_ap_ex_str_body" | |
} | |
@SuppressLint("TimberArgCount") |
This file contains 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
abstract class BaseActivity : AppCompatActivity() { | |
companion object { | |
private const val TAG = "BaseActivity:" | |
private const val RECEIVER_TAG = "BaseActivity-Receiver:" | |
} | |
private val localBroadcastManager: LocalBroadcastManager by lazy { | |
LocalBroadcastManager.getInstance(this) | |
} |
This file contains 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
override fun handleRcUpdate(isItServiceUpdate: Boolean, | |
isFeatureOnBoardingVisible: Boolean) { | |
super.handleRcUpdate(isItServiceUpdate, isFeatureOnBoardingVisible) | |
when { | |
isItServiceUpdate -> updateUrls() | |
isFeatureOnBoardingVisible -> | |
navigateToOnBoardingMenu(true) | |
} | |
} |
This file contains 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
class RemoteConfigConstants { | |
companion object { | |
const val DEFAULT_LOCAL_RC_JSON = "RemoteConfig.json" | |
const val LOCAL_RC_JSON = "DeviceRemoteConfig.json" | |
const val RC_JSON_PARAM_NAME = "config_json" | |
const val RC_EXTRA_BACK_NOTIFICATION = "rc_extra_back_notification" | |
} | |
} |
OlderNewer