当前位置: 首页>>代码示例>>Java>>正文


Java FirebaseRemoteConfig.getInstance方法代码示例

本文整理汇总了Java中com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java FirebaseRemoteConfig.getInstance方法的具体用法?Java FirebaseRemoteConfig.getInstance怎么用?Java FirebaseRemoteConfig.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.firebase.remoteconfig.FirebaseRemoteConfig的用法示例。


在下文中一共展示了FirebaseRemoteConfig.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: pluginInitialize

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的package包/类
@Override
protected void pluginInitialize() {
    Log.d(TAG, "Starting Firebase Remote Config plugin");

    this.firebaseRemoteConfig = FirebaseRemoteConfig.getInstance();

    String filename = preferences.getString("FirebaseRemoteConfigDefaults", "");
    if (filename.isEmpty()) {
        // always call setDefaults in order to avoid exception
        // https://github.com/firebase/quickstart-android/issues/291
        this.firebaseRemoteConfig.setDefaults(Collections.<String, Object>emptyMap());
    } else {
        Context ctx = cordova.getActivity().getApplicationContext();
        int resourceId = ctx.getResources().getIdentifier(filename, "xml", ctx.getPackageName());
        this.firebaseRemoteConfig.setDefaults(resourceId);
    }
}
 
开发者ID:chemerisuk,项目名称:cordova-plugin-firebase-config,代码行数:18,代码来源:FirebaseConfigPlugin.java

示例2: onCreate

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Login checks
    if (!CacheUtils.isLoggedIn(this) || !CacheUtils.isFireBaseSetup(this)) {
        Intent intent = new Intent(this, OnBoardActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
        return;
    }

    //Now check if app update is required
    firebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    firebaseRemoteConfig.setDefaults(R.xml.config);
    testIfAppUpdateIsRequired();
}
 
开发者ID:Protino,项目名称:CodeWatch,代码行数:18,代码来源:PreChecksActivity.java

示例3: fetch

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的package包/类
void fetch() {
    FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
    config.activateFetched();

    config.fetch(urgentUpdateFlag ? 0 : cacheExpiration)
        .addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                Log.d("KiseFetcher", "onFailure: " + e.getMessage());
            }
        })
        .addOnSuccessListener(new OnSuccessListener<Void>() {
            @Override
            public void onSuccess(Void aVoid) {
                Log.d("KiseFetcher", "onSuccess");
            }
        })
        .addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                Log.d("KiseFetcher", "onComplete");
            }
        });
    disableUrgentUpdateFlag();
}
 
开发者ID:hisaichi5518,项目名称:Kise,代码行数:26,代码来源:Fetcher.java

示例4: onCreate

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例5: RemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例6: fetchFirebase

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例7: onCreate

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.UCOmoveTheme);
    super.onCreate(savedInstanceState);

    mBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);

    setupView();
    showHome();

    checkLocationPermissionsIfNeeded();
    setupGooglePlayRateIfNeeded();
}
 
开发者ID:Gnzlt,项目名称:UCOmove,代码行数:17,代码来源:MainActivity.java

示例8: refreshApiEndpoints

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的package包/类
private void refreshApiEndpoints() {
    FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();

    String apisString = remoteConfig.getString(FB_CONFIG_OSM_APIS);

    if (apisString == null || apisString.isEmpty()) {
        return;
    }

    String[] stringArray = apisString.replace("[", "").replace("]", "").split(",");

    for (int i = 0; i < stringArray.length; i++) {
        String apiHost = stringArray[i].replace("\"", "");
        boolean enabled = remoteConfig.getBoolean(FB_CONFIG_OSM_API_ENABLED_PREFIX + i);
        if (enabled) {
            OsmApiEndpoint endpoint = new OsmApiEndpoint(apiHost);
            initializeOsmService(endpoint);
            osmOverpassApis.add(endpoint);
        }
    }
}
 
开发者ID:plusCubed,项目名称:velociraptor,代码行数:22,代码来源:OsmLimitProvider.java

示例9: initialize

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的package包/类
public AbstractDownloadHelper initialize(Activity activity) {
        mActivity = activity;
        mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
        mFirebaseRemoteConfig.fetch().addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                mFirebaseRemoteConfig.activateFetched();
                AD_RATE = mFirebaseRemoteConfig.getLong("ad_rate");
            }
        });
/*        ColorTvSdk.init(activity, getAppId());
        ColorTvSdk.setRecordAudioEnabled(false);
        ColorTvSdk.onCreate();
        ColorTvSdk.registerAdListener(mListener);*/
        return this;
    }
 
开发者ID:ITVlab,项目名称:TvAppRepo,代码行数:17,代码来源:AbstractDownloadHelper.java

示例10: RemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例11: provideFirebaseRemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例12: init

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例13: init

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例14: initRemoteConfig

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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

示例15: checkForUpdate

import com.google.firebase.remoteconfig.FirebaseRemoteConfig; //导入方法依赖的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


注:本文中的com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。