YoYoGames / GMEXT-Firebase

Repository for GameMaker's Firebase Extension
Other
9 stars 6 forks source link

[Remote Configs] : Add "realtime listeners" for the configs. #22

Closed Callsign54 closed 2 months ago

Callsign54 commented 6 months ago

The current GMExt implementation does not have realtime configs listening functionality. It's quite easy to add with one listener method `mFirebaseRemoteConfig.addOnConfigUpdateListener(new ConfigUpdateListener() { @Override public void onUpdate(ConfigUpdate configUpdate) { Log.d(TAG, "Updated keys: " + configUpdate.getUpdatedKeys());

    mFirebaseRemoteConfig.activate().addOnCompleteListener(new OnCompleteListener`
jzavala-YYG commented 5 months ago

Hi @Callsign54!

mFirebaseRemoteConfig.activate( It's already implemented in FirebaseRemoteConfig_FetchAndActivate().

But you are right it's possible get realt-ime updates, for that _FirebaseRemoteConfigAddOnConfigUpdateListener() (Only work on Android and iOS) just got implemented.

@YYBartT

void FirebaseRemoteConfig_AddOnConfigUpdateListener() https://firebase.google.com/docs/reference/android/com/google/firebase/remoteconfig/ConfigUpdateListenerRegistration Description: Starts listening for real-time config updates from the Remote Config backend and automatically fetches updates from the RC backend when they are available.

NOTE: Function available only for Android & iOS.

async event: "type": "FirebaseRemoteConfig_AddOnConfigUpdateListener" "keys": array of strings "success": boolean

YYBartT commented 2 months ago

Documented the new function FirebaseRemoteConfig_AddOnConfigUpdateListener() and updated the wiki.