Giter Site home page Giter Site logo

hansemannn / titanium-firebase-config Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 6.0 13.79 MB

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

License: Other

JavaScript 0.32% Objective-C 58.91% Java 3.19% C++ 37.59%
firebase firebase-remote-config axway titanium native javascript

titanium-firebase-config's Introduction

Firebase Remote Config - Titanium Module

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

Supporting this effort

The whole Firebase support in Titanium is developed and maintained by the community (@hansemannn and @m1ga). To keep this project maintained and be able to use the latest Firebase SDK's, please see the "Sponsor" button of this repository, thank you!

Requirements

Download

Example Config Manager

import TiFirebaseConfig from 'firebase.config';

export default class ConfigManager {

    static fetch () {
        TiFirebaseConfig.fetch({
            callback: event => {
                TiFirebaseConfig.activateFetched(); // Activate the fetched values
            }
        });
    }

    static getString(key) {
      return TiFirebaseConfig.getString(key);
    }

    static getBool(key) {
      return TiFirebaseConfig.getBool(key);
    }

    static getNumber(key) {
      return TiFirebaseConfig.getNumber(key);
    }
}

API's

Methods

fetchAndActivate(callback) (iOS / Android)

  • callback (Function)

setMinimumFetchIntervalInSeconds(minimumFetchInterval) (iOS / Android)

  • minimumFetchInterval (Number)

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)

getString(key) -> String //Use for JSON too

  • key (String)

getBool(key) -> String

  • key (String)

getNumber(key) -> String

  • key (String)

Properties

enableRealtimeUpdates(value: Boolean)

Start listening for real-time config updates from the Remote Config backend and automatically fetch updates when they're available. The result can be listened to via the update event.

If a connection to the Remote Config backend is not already open, calling this method will open it. Multiple listeners can be added by calling this method again, but subsequent calls re-use the same connection to the backend.

Note: Real-time Remote Config requires the Firebase Remote Config Realtime API. See Get started with Firebase Remote Config at https://firebase.google.com/docs/remote-config/get-started for more information.

Events

update

  • keys (Array) The updated keys. Fired when a real time config update occurs.

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)

getData(key) -> String

  • key (String)

iOS-only Properties

lastFetchTime (Date, get)

lastFetchStatus (FETCH_STATUS_*, get)

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.

titanium-firebase-config's People

Contributors

hansemannn avatar jordanbisato avatar m1ga avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

titanium-firebase-config's Issues

Please provide example

Hello Hans,
can you please update example folder with example code how to configure and fetch remote config parameters?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.