当前位置: 首页>>代码示例>>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;未经允许,请勿转载。