Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #40 from elimu-ai/feat-#37-Prepare-SharedPreferenc…
Browse files Browse the repository at this point in the history
…es-for-Web3

feat: #37 Prepare SharedPreferences for Web3
  • Loading branch information
nya-elimu authored May 20, 2022
2 parents 09e9686 + 1e68839 commit 8975aec
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class SharedPreferencesHelper {
public static final String PREF_APP_VERSION_CODE = "pref_app_version_code";
public static final String PREF_LANGUAGE = "pref_language";
public static final String PREF_PROVIDER_ID_GOOGLE = "pref_provider_id_google";
public static final String PREF_PROVIDER_ID_WEB3 = "pref_provider_id_web3";
public static final String PREF_EMAIL = "pref_email";
public static final String PREF_FIRSTNAME = "pref_firstname";
public static final String PREF_LASTNAME = "pref_lastname";
Expand Down Expand Up @@ -76,6 +77,24 @@ public static String getProviderIdGoogle(Context context) {
}


public static void storeProviderIdWeb3(Context context, String providerIdWeb3) {
Timber.i("storeProviderIdWeb3");
SharedPreferences sharedPreferences = context.getSharedPreferences(SHARED_PREFS, Context.MODE_PRIVATE);
sharedPreferences.edit().putString(PREF_PROVIDER_ID_WEB3, providerIdWeb3).apply();
}

public static String getProviderIdWeb3(Context context) {
Timber.i("getProviderIdWeb3");
SharedPreferences sharedPreferences = context.getSharedPreferences(SHARED_PREFS, Context.MODE_PRIVATE);
String providerIdWeb3 = sharedPreferences.getString(PREF_PROVIDER_ID_WEB3, null);
if (TextUtils.isEmpty(providerIdWeb3)) {
return null;
} else {
return providerIdWeb3;
}
}


public static void storeEmail(Context context, String email) {
Timber.i("storeProviderIdGoogle");
SharedPreferences sharedPreferences = context.getSharedPreferences(SHARED_PREFS, Context.MODE_PRIVATE);
Expand Down

0 comments on commit 8975aec

Please sign in to comment.