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

Firebase Remote Config - Pro Tips

Firebase Remote Config - Pro Tips

Pro tips for using Firebase Remote Config as feature-flag engine in mobile apps.

Presentation given at Seven Masters by iMasters, Firebase Edition (august / 2017).

Ubiratan Soares
PRO

August 31, 2017
Tweet

More Decks by Ubiratan Soares

Other Decks in Programming

Transcript

  1. REMOTE CONFIG
    pro tips
    Ubiratan Soares
    August / 2017

    View Slide

  2. View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. PRO TIPS

    View Slide

  9. Attention to tool
    limits and policies
    1

    View Slide

  10. View Slide

  11. Do not forget to
    provide the
    default values
    2

    View Slide

  12. View Slide

  13. // At application setup level
    FirebaseRemoteConfig
    .getInstance()
    .setDefaults(R.xml.remote_config_defaults);
    ➜ ~/path/to/app/main tree res
    res
    !"" xml
    !"" remote_config_defaults.xml

    View Slide

  14. Beware of backward
    compatibility for
    configs
    3

    View Slide

  15. Assign values by
    build type per
    config
    4

    View Slide

  16. Choose the proper
    activate / fetch
    strategy for configs
    5

    View Slide

  17. Default Expires = 12h
    activateFetched()
    Async Fetching
    RemoteConfig SDK
    ACTUAL
    VALUES
    getXYZ()
    CACHED VALUES
    fetch(timeToCache)

    View Slide

  18. Are the upated
    values for configs
    needed right now ?

    View Slide

  19. Load values for the next
    time usage, at application
    lifecycle level.
    For non-critical configs

    View Slide

  20. If you cannot wait for the
    next interaction with your
    app …
    Can user wait for the actual
    values for configs at current
    app section ?

    View Slide

  21. Waiting for refresh
    Fetch and activate using
    callback and provide the
    proper visual feedback
    (usually a blocking, loading screen)

    View Slide

  22. If actual config
    values are critical
    for feature …

    View Slide

  23. Fetch and activate using
    callback before user
    interaction with remote-
    controled feature
    No delays accepted

    View Slide

  24. Find a way to override
    config`s local caching
    when needed
    6

    View Slide

  25. Default Expires = 12h
    activateFetched()
    Async Fetching
    RemoteConfig SDK
    ACTUAL
    VALUES
    getXYZ()
    CACHED VALUES
    fetch(timeToCache)

    View Slide

  26. Monitor application
    foreground / background
    dance and re-fetch with
    cache invalidation at
    transition

    View Slide

  27. Force a
    fetch with cache purging
    + activate using a
    push notification

    View Slide

  28. FINAL REMARKS
    • RemoteConfig is a great tool for feature-flagging
    • Deadly simple to integrate with provided SDKs
    • Beware of basics (default values, limitations, config compatibilities, etc)
    • Choose the proper fetch+activate strategy for each config

    View Slide

  29. UBIRATAN
    SOARES
    Computer Scientist by ICMC/USP
    Software Engineer, curious guy
    Google Developer Expert for Android
    Teacher, speaker, etc, etc

    View Slide

  30. THANK YOU
    @ubiratanfsoares
    ubiratansoares.github.io
    https://br.linkedin.com/in/ubiratanfsoares

    View Slide