are you using the android SDK? If so, this is done automatically.
See https://appwrite.io/docs/advanced/security/authentication#persistence
Votes
0
Replies
24
Participants
Unknown
Messages
25
are you using the android SDK? If so, this is done automatically.
See https://appwrite.io/docs/advanced/security/authentication#persistence
Rank 2: Process
i use android web application
Rank 2: Process
from appwrite lib
sorry i don't understand
Rank 2: Process
a moment
Rank 2: Process
its not sdk?
account.createOAuth2Session( activity = context as ComponentActivity, provider = OAuthProvider.YANDEX, )what package did you install?
Rank 2: Process
implementation("io.appwrite:sdk-for-android:6.1.0")```
right that's the android sdk
so it's done automatically
so what you should do is:
Rank 2: Process
is it possible for me to just save the session and write it to SharedPreferences and then?
i do not recomment this. you end up with a weird source of truth
Rank 2: Process
What would be better?
so what you should do is:
Rank 2: Process
if(account.get()){
}else{
}
Rank 2: Process
right?
try/catch
account.get() will throw an exception on error
Rank 2: Process
i get it
Rank 2: Process
so it won't be stored in the SharePreference right?
the session cookie is stored in shared preferences automatically: https://github.com/appwrite/sdk-for-android/blob/main/library/src/main/java/io/appwrite/cookies/stores/SharedPreferencesCookieStore.kt
Rank 2: Process
thx
Rank 2: Process
i get it
Rank 2: Process
thank you so much