dialogflow-android-client
dialogflow-android-client copied to clipboard
SessionID
It is not possible to put own sessionid. How can? i try with a java sdk and not found sessionid-branche thanks
jose patricio
@pcarermo Im late to the answer, but if you look at ai.api.android.SessionIdStorage You can see that it use sharedPref to store the data of Session ID:
If you edit the preferences using the same keys, you can use the value that you want.
You can use the code bellow, it add new random value at the begining of activity, to start new fresh session each time
val pref_name = "APIAI_preferences"
val SESSION_ID = "sessionId"
randomUUID = UUID.randomUUID().toString()
val sharedPreferences = getSharedPreferences(pref_name, Context.MODE_PRIVATE)
val editor = sharedPreferences.edit()
editor.putString(SESSION_ID, randomUUID)
editor.apply()