Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Firebase - Remote Config

Firebase - Remote Config

Firebase - Remote Config @ shibuya.apk #8 Google I/O 2016 Report

Fumihiko Shiroyama

June 10, 2016
Tweet

More Decks by Fumihiko Shiroyama

Other Decks in Programming

Transcript

  1. ʂ

  2. BQQCVJMEHSBEMF apply plugin: 'com.android.application' android { // ... } dependencies

    { // ... compile 'com.google.firebase:firebase-core:9.0.2' compile 'com.google.firebase:firebase-config:9.0.2' } // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services'
  3. "DUJWJUZ FirebaseRemoteConfigSettings remoteConfigSettings = new FirebaseRemoteConfigSettings.Builder()
 .setDeveloperModeEnabled(BuildConfig.DEBUG)
 .build();
 remoteConfig =

    FirebaseRemoteConfig.getInstance();
 remoteConfig.setConfigSettings(remoteConfigSettings);
 remoteConfig.setDefaults(R.xml.remote_config_defaults);
  4. FirebaseRemoteConfigSettings remoteConfigSettings = new FirebaseRemoteConfigSettings.Builder()
 .setDeveloperModeEnabled(BuildConfig.DEBUG)
 .build();
 remoteConfig = FirebaseRemoteConfig.getInstance();


    remoteConfig.setConfigSettings(remoteConfigSettings);
 remoteConfig.setDefaults(R.xml.remote_config_defaults); ճ࣌ؒҎ্ͷϦΫΤετ͸ΤϥʔʹͳΔͷͰ ։ൃ࣌͸͜ͷઃఆ͸ඞਢʂ "DUJWJUZ
  5. FirebaseRemoteConfigSettings remoteConfigSettings = new FirebaseRemoteConfigSettings.Builder()
 .setDeveloperModeEnabled(BuildConfig.DEBUG)
 .build();
 remoteConfig = FirebaseRemoteConfig.getInstance();


    remoteConfig.setConfigSettings(remoteConfigSettings);
 remoteConfig.setDefaults(R.xml.remote_config_defaults); σϑΥϧτͷ,FZ7BMΛઃఆ "DUJWJUZ
  6. private void fetch() {
 long cacheExpiration = 3600;
 if (remoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled())

    {
 cacheExpiration = 0;
 }
 
 remoteConfig.fetch(cacheExpiration)
 .addOnSuccessListener(aVoid -> {
 Log.d(TAG, "Fetch succeeded.");
 remoteConfig.activateFetched();
 
 String colorName = remoteConfig.getString("color");
 container.setBackgroundColor(Color.parseColor(colorName));
 })
 .addOnFailureListener(e -> Log.e(TAG, "Fetch failed.", e));
 }
  7. private void fetch() {
 long cacheExpiration = 3600;
 if (remoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled())

    {
 cacheExpiration = 0;
 }
 
 remoteConfig.fetch(cacheExpiration)
 .addOnSuccessListener(aVoid -> {
 Log.d(TAG, "Fetch succeeded.");
 remoteConfig.activateFetched();
 
 String colorName = remoteConfig.getString("color");
 container.setBackgroundColor(Color.parseColor(colorName));
 })
 .addOnFailureListener(e -> Log.e(TAG, "Fetch failed.", e));
 } $BDIF&YQJSBUJPO EFGBVMUIPVST
  8. private void fetch() {
 long cacheExpiration = 3600;
 if (remoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled())

    {
 cacheExpiration = 0;
 }
 
 remoteConfig.fetch(cacheExpiration)
 .addOnSuccessListener(aVoid -> {
 Log.d(TAG, "Fetch succeeded.");
 remoteConfig.activateFetched();
 
 String colorName = remoteConfig.getString("color");
 container.setBackgroundColor(Color.parseColor(colorName));
 })
 .addOnFailureListener(e -> Log.e(TAG, "Fetch failed.", e));
 } 'FUDI4FSWFS4FUUJOHT
  9. private void fetch() {
 long cacheExpiration = 3600;
 if (remoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled())

    {
 cacheExpiration = 0;
 }
 
 remoteConfig.fetch(cacheExpiration)
 .addOnSuccessListener(aVoid -> {
 Log.d(TAG, "Fetch succeeded.");
 remoteConfig.activateFetched();
 
 String colorName = remoteConfig.getString("color");
 container.setBackgroundColor(Color.parseColor(colorName));
 })
 .addOnFailureListener(e -> Log.e(TAG, "Fetch failed.", e));
 } 4VDDFTT$BMMCBDL
  10. private void fetch() {
 long cacheExpiration = 3600;
 if (remoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled())

    {
 cacheExpiration = 0;
 }
 
 remoteConfig.fetch(cacheExpiration)
 .addOnSuccessListener(aVoid -> {
 Log.d(TAG, "Fetch succeeded.");
 remoteConfig.activateFetched();
 
 String colorName = remoteConfig.getString("color");
 container.setBackgroundColor(Color.parseColor(colorName));
 })
 .addOnFailureListener(e -> Log.e(TAG, "Fetch failed.", e));
 } "DUJWBUF
  11. private void fetch() {
 long cacheExpiration = 3600;
 if (remoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled())

    {
 cacheExpiration = 0;
 }
 
 remoteConfig.fetch(cacheExpiration)
 .addOnSuccessListener(aVoid -> {
 Log.d(TAG, "Fetch succeeded.");
 remoteConfig.activateFetched();
 
 String colorName = remoteConfig.getString("color");
 container.setBackgroundColor(Color.parseColor(colorName));
 })
 .addOnFailureListener(e -> Log.e(TAG, "Fetch failed.", e));
 } 'BJMVSF$BMMCBDL