Skip to content

Use the Firebase Remote-Config SDK in Axway Titanium πŸš€

License

Notifications You must be signed in to change notification settings

kitenium/titanium-firebase-config

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Firebase Remote Config - Titanium Module

Use the native Firebase SDK in Axway Titanium. This repository is part of the Titanium Firebase project.

Requirements

Download

Example Config Manager

import TiFirebaseConfig from 'firebase.config';

export default class ConfigManager {
    
    static fetch () {
        TiFirebaseConfig.fetch({
            callback: event => {
                TiFirebaseConfig.activateFetched();
            }
        });
    }

    static getString(key) {
        const value = TiFirebaseConfig.configValueForKey(key);
        if (!value) return undefined;

        return value.string;
    }

    static getBool(key) {
        const value = TiFirebaseConfig.configValueForKey(key);
        if (!value) return undefined;

        return value.bool;
    }

    static getNumber(key) {
        const value = TiFirebaseConfig.configValueForKey(key);
        if (!value) return undefined;

        return value.number;
    }

    static getData(key) {
        const value = TiFirebaseConfig.configValueForKey(key);
        if (!value) return undefined;

        return value.data;
    }
}

API's

Cross Platform Methods

activateFetched() (iOS / Android)

fetch(parameters) (iOS / Android)

  • parameters (Dictionary)
    • callback (Function)
    • expirationDuration (Number, optional)

configValueForKey(key, namespace) -> Dictionary (iOS / Android)

  • key (String)
  • namespace (String, optional)

iOS-only Methods

objectForKeyedSubscript(keyedSubscript) -> Dictionary

  • keyedSubscript (String)

allKeysFromSource(source, namespace) -> Array<String>

  • source (SOURCE_)
  • namespace (String, optional)

keysWithPrefix(prefix, namespace) -> Array<String>

  • prefix (String)
  • namespace (String, optional)

setDefaults(defaults, namespace)

  • defaults (Dictionary)
  • namespace (String, optional)

setDefaultsFromPlist(plistName, namespace)

  • plistName (Dictionary)
  • namespace (String, optional)

defaultValueForKey(parameters) -> Dictionary

  • key (String)
  • namespace (String, optional)

iOS-only Properties

lastFetchTime (Date, get)

lastFetchStatus (FETCH_STATUS_*, get)

developerModeEnabled (Bool, get/set)

iOS-only Constants

FETCH_STATUS_NO_FETCH_YET

FETCH_STATUS_SUCCESS

FETCH_STATUS_FAILURE

FETCH_STATUS_THROTTLED

SOURCE_REMOTE

SOURCE_DEFAULT

SOURCE_STATIC

Build

cd [ios|android]
appc run -p [ios|android] --build-only

Legal

This module is Copyright (c) 2017-present by Hans KnΓΆchel. All Rights Reserved.

About

Use the Firebase Remote-Config SDK in Axway Titanium πŸš€

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 69.4%
  • Python 23.2%
  • Java 7.4%