當前位置: 首頁>>代碼示例>>Java>>正文


Java FirebaseRemoteConfigSettings類代碼示例

本文整理匯總了Java中com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings的典型用法代碼示例。如果您正苦於以下問題:Java FirebaseRemoteConfigSettings類的具體用法?Java FirebaseRemoteConfigSettings怎麽用?Java FirebaseRemoteConfigSettings使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FirebaseRemoteConfigSettings類屬於com.google.firebase.remoteconfig包,在下文中一共展示了FirebaseRemoteConfigSettings類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setConfigSettings

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
public void setConfigSettings(final CallbackContext callbackContext, final JSONObject config) {
    mFirebase.cordova.getThreadPool().execute(new Runnable() {
        public void run() {
            try {
                Log.i(TAG, "Setting config settings");
                boolean devMode = config.getBoolean("developerModeEnabled");
                FirebaseRemoteConfigSettings.Builder settings = new FirebaseRemoteConfigSettings.Builder()
                        .setDeveloperModeEnabled(devMode);
                FirebaseRemoteConfig.getInstance().setConfigSettings(settings.build());
                callbackContext.success();
            } catch (Exception e) {
                Log.e(TAG, "Error setting config settings", e);
                callbackContext.error(e.getMessage());
            }
        }
    });
}
 
開發者ID:jsayol,項目名稱:cordova-plugin-firebase-sdk,代碼行數:18,代碼來源:RemoteConfigComponent.java

示例2: onCreate

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();

    buildNotification();
    setStatusMessage(R.string.connecting);

    mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(BuildConfig.DEBUG)
            .build();
    mFirebaseRemoteConfig.setConfigSettings(configSettings);
    mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);

    mPrefs = getSharedPreferences(getString(R.string.prefs), MODE_PRIVATE);
    String email = mPrefs.getString(getString(R.string.email), "");
    String password = mPrefs.getString(getString(R.string.password), "");
    authenticate(email, password);

}
 
開發者ID:ayushghd,項目名稱:iSPY,代碼行數:21,代碼來源:TrackerService.java

示例3: RemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
@SuppressWarnings("ConstantConditions") public RemoteConfig(boolean isDebug, final IAnalytics analytics) {
    firebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    FirebaseRemoteConfigSettings configSettings =
            new FirebaseRemoteConfigSettings.Builder().setDeveloperModeEnabled(isDebug).build();

    firebaseRemoteConfig.setConfigSettings(configSettings);
    firebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);

    firebaseRemoteConfig.fetch().continueWith((Continuation<Void, Void>) task -> {
        if (task.isSuccessful()) {
            Log.e(TAG, "then: Success");
            firebaseRemoteConfig.activateFetched();
            analytics.setUserProperty(EXPERIMENT_ABOUT_MENU,
                    getExperimentVariant(EXPERIMENT_ABOUT_MENU));
            return null;
        }
        Log.e(TAG, "then: Failure");
        throw task.getException();
    });
}
 
開發者ID:riteshakya037,項目名稱:Wallpapers-Android-Clean-Architecture,代碼行數:21,代碼來源:RemoteConfig.java

示例4: fetchFirebase

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
private void fetchFirebase() {
    FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();
    remoteConfig.setConfigSettings(
            new FirebaseRemoteConfigSettings.Builder()
                    .setDeveloperModeEnabled(BuildConfig.DEBUG)
                    .build());
    remoteConfig.fetch()
            .addOnCompleteListener(this, task -> {
                if (task.isSuccessful()) {
                    remoteConfig.activateFetched();
                    setup();
                } else {
                    Snackbar snackbar = Snackbar.make(findViewById(android.R.id.content), "Da ist was schiefgelaufen.\nVersuche es noch einmal...", Snackbar.LENGTH_SHORT);
                    View snackbarView = snackbar.getView();
                    snackbarView.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), theme().primaryColorDark));
                    snackbar.show();
                }
            });
}
 
開發者ID:M4lik,項目名稱:burning-series,代碼行數:20,代碼來源:MainActivity.java

示例5: RemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
public RemoteConfig(boolean isDebug, final ITracking tracking) {
    this.tracking = tracking;

    firebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(isDebug)
            .build();

    firebaseRemoteConfig.setConfigSettings(configSettings);
    firebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);

    firebaseRemoteConfig.fetch()
            .addOnCompleteListener(new OnCompleteListener<Void>() {
                @Override
                public void onComplete(@NonNull Task<Void> task) {
                    if (task.isSuccessful()) {
                        firebaseRemoteConfig.activateFetched();

                        tracking.setUserProperty(EXPERIMENT_HOME_SCREEN_ABOUT_MENU, getExperimentVariant(EXPERIMENT_HOME_SCREEN_ABOUT_MENU));
                    }
                }
            });
}
 
開發者ID:lolevsky,項目名稱:Android-Clean-Architecture,代碼行數:24,代碼來源:RemoteConfig.java

示例6: provideFirebaseRemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
@Provides @Singleton @Nullable
public FirebaseRemoteConfig provideFirebaseRemoteConfig() {
    try {
        FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
        FirebaseRemoteConfigSettings settings = new FirebaseRemoteConfigSettings.Builder()
                .setDeveloperModeEnabled(BuildConfig.DEBUG)
                .build();
        config.setConfigSettings(settings);
        return config;
    } catch (IllegalStateException ex) {
        /* When there is no google-secrets.json file found, the library throws an exception
         * here which causes insta-crashes for us. Silently recover here...
         */
        TbaLogger.e("Unable to find google-secrets.json, disabling remote config");
        return null;
    }
}
 
開發者ID:the-blue-alliance,項目名稱:the-blue-alliance-android,代碼行數:18,代碼來源:ConfigModule.java

示例7: init

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
private void init(){
    mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(BuildConfig.DEBUG)
            .build();
    mFirebaseRemoteConfig.setConfigSettings(configSettings);
    //mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);
}
 
開發者ID:Bruno125,項目名稱:Unofficial-Ups,代碼行數:9,代碼來源:AppRemoteConfig.java

示例8: init

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
public void init (FirebaseApp firebaseApp) {
	mFirebaseApp = firebaseApp;

	mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
	FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
	.setDeveloperModeEnabled(BuildConfig.DEBUG)
	.build();

	mFirebaseRemoteConfig.setConfigSettings(configSettings);
	mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);

	fetchRemoteConfigs();
}
 
開發者ID:FrogSquare,項目名稱:GodotFireBase,代碼行數:14,代碼來源:RemoteConfig.java

示例9: initRemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
private void initRemoteConfig() {
    mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(BuildConfig.DEBUG)
            .build();
    mFirebaseRemoteConfig.setConfigSettings(configSettings);
    fetchRemoteConfig();
}
 
開發者ID:victoraldir,項目名稱:BuddyBook,代碼行數:9,代碼來源:FirebaseDatabaseHelper.java

示例10: checkForUpdate

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
public void checkForUpdate() {
    remoteConfig = FirebaseRemoteConfig.getInstance();
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(true)
            .build();

    remoteConfig.setConfigSettings(configSettings);

    remoteConfig.fetch(cache)
            .addOnSuccessListener(new OnSuccessListener<Void>() {
                @Override
                public void onSuccess(Void aVoid) {
                    remoteConfig.activateFetched();
                    String url = remoteConfig.getString("android");
                    boolean isOptional = remoteConfig.getBoolean("android_optional");

                    Config config = new Config(isOptional, url, color, cache, message, buttonText);

                    if (!url.isEmpty()) {
                        Intent appUpdateIntent = new Intent(activity, UpdateAppActivity.class);
                        appUpdateIntent.putExtra("data", config);
                        if (!activity.isDestroyed())
                            activity.startActivity(appUpdateIntent);
                    }
                }
            })
            .addOnFailureListener(new OnFailureListener() {
                @Override
                public void onFailure(@NonNull Exception e) {
                    e.printStackTrace();
                }
            });

}
 
開發者ID:ibrahimGhailani,項目名稱:AppUpdate,代碼行數:35,代碼來源:CheckAppUpdate.java

示例11: onCreate

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
@Override
public void onCreate() {
    super.onCreate();

    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(BuildConfig.DEBUG)
            .build();

    FirebaseRemoteConfig.getInstance().setConfigSettings(configSettings);
    FirebaseRemoteConfig.getInstance().setDefaults(R.xml.firebase_remote_config_defaults);
}
 
開發者ID:hisaichi5518,項目名稱:Kise,代碼行數:12,代碼來源:ExampleApplication.java

示例12: setDebugMode

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
void setDebugMode(boolean debugMode) {
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(debugMode)
            .build();
    mFirebaseRemoteConfig.setConfigSettings(configSettings);
    mDebugMode = debugMode;
}
 
開發者ID:busbud,項目名稱:firely,代碼行數:8,代碼來源:InternalFirely.java

示例13: update

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
private void update(final long ttlSeconds, final CallbackContext callbackContext) {
    cordova.getThreadPool().execute(new Runnable() {
        public void run() {
            if (ttlSeconds == 0) {
                // App should use developer mode to fetch values from the service
                firebaseRemoteConfig.setConfigSettings(
                    new FirebaseRemoteConfigSettings.Builder()
                        .setDeveloperModeEnabled(true)
                        .build()
                );
            }

            firebaseRemoteConfig.fetch(ttlSeconds)
                .addOnCompleteListener(cordova.getActivity(), new OnCompleteListener<Void>() {
                    @Override
                    public void onComplete(Task<Void> task) {
                        if (task.isSuccessful()) {
                            firebaseRemoteConfig.activateFetched();

                            callbackContext.success();
                        } else {
                            callbackContext.error(task.getException().getMessage());
                        }
                    }
                });
        }
    });
}
 
開發者ID:chemerisuk,項目名稱:cordova-plugin-firebase-config,代碼行數:29,代碼來源:FirebaseConfigPlugin.java

示例14: firebaseRemoteConfigSettings

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
private void firebaseRemoteConfigSettings() {
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(BuildConfig.DEBUG)
            .build();
    mFirebaseRemoteConfig.setConfigSettings(configSettings);
    mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);

}
 
開發者ID:mangoblogger,項目名稱:MangoBloggerAndroidApp,代碼行數:9,代碼來源:HomeActivity.java

示例15: onCreate

import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mWelcomeTextView = findViewById(R.id.welcomeTextView);

    Button fetchButton = findViewById(R.id.fetchButton);
    fetchButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            fetchWelcome();
        }
    });

    // Get Remote Config instance.
    // [START get_remote_config_instance]
    mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    // [END get_remote_config_instance]

    // Create a Remote Config Setting to enable developer mode, which you can use to increase
    // the number of fetches available per hour during development. See Best Practices in the
    // README for more information.
    // [START enable_dev_mode]
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
            .setDeveloperModeEnabled(BuildConfig.DEBUG)
            .build();
    mFirebaseRemoteConfig.setConfigSettings(configSettings);
    // [END enable_dev_mode]

    // Set default Remote Config parameter values. An app uses the in-app default values, and
    // when you need to adjust those defaults, you set an updated value for only the values you
    // want to change in the Firebase console. See Best Practices in the README for more
    // information.
    // [START set_default_values]
    mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);
    // [END set_default_values]

    fetchWelcome();
}
 
開發者ID:firebase,項目名稱:quickstart-android,代碼行數:41,代碼來源:MainActivity.java


注:本文中的com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。