From 879ec1ae04b37eb7bf9357903d10acc860d84d5b Mon Sep 17 00:00:00 2001 From: zhujie <leon.zhu@cloudroam.com.cn> Date: 星期二, 15 四月 2025 03:02:18 +0800 Subject: [PATCH] 1 --- app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt b/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt index b9636a9..932bdd3 100644 --- a/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt +++ b/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt @@ -10,6 +10,7 @@ private const val KEY_FIRST_INSTALL = "first_install" private const val LAST_LOGIN_PHONE = "last_login_phone" private const val PREF_LAST_CHECK_TIME_PREFIX = "last_check_time_" + private const val KEY_INVITE = "user_invite" private lateinit var preferences: SharedPreferences @@ -64,4 +65,12 @@ fun setLastCheckTime(categoryId: Int, time: Long) { preferences.edit().putLong(PREF_LAST_CHECK_TIME_PREFIX + categoryId, time).apply() } + + fun getInviteCode(): String { + return preferences.getString(KEY_INVITE, "") ?: "" + } + + fun setInviteCode(invite: String) { + preferences.edit().putString(KEY_INVITE, invite).apply() + } } \ No newline at end of file -- Gitblit v1.9.3