crisp-im / crisp-sdk-android

:package: Crisp Android SDK, add a chat in any Android app and communicate with your users.
https://docs.crisp.chat/guides/chatbox-sdks/android-sdk/
Other
56 stars 17 forks source link

Cannot resume chat activity whenever user minimize then click launcher icon #155

Closed edomuhammad closed 8 months ago

edomuhammad commented 1 year ago

Whenever user open my app and then open crisp then minimize it, then user click my app launcher icon, crisp suddenly disappeared, and my app going back to main activity. my expectation is, when user click my app launcher icon, it should be back to crisp not going back to main activity

https://github.com/crisp-im/crisp-sdk-android/assets/15313250/4c1636c6-b540-4a73-aa6c-b9cfaaab6b4b

Doc1faux commented 1 year ago

Hi @edomuhammad,

Which version of the SDK are you using? If you're not using the latest, i.e. 1.0.14, please update it :)

If you're using the latest, have you set your LauncherActivity (the one which starts on the launcher icon tap) to be launched in singleTask or singleInstance mode? If so, this is the usual behavior, these launch modes do not allow the Activity to be instantiated more than one time in one task. As LauncherActivity creates a new task or resets the current one if already launched, the whole task is reset so only your LauncherActivity remains.

Doc1faux commented 1 year ago

You can see both behavior in the Sample app of this repository and in the Crisp app on the Play Store.

The Sample app has its LauncherActivity launching in standard mode, so tapping the launcher icon just brings back the current task, with the chat running on top if started.

The Crisp app has its LauncherActivity launching in singleInstance mode (for deep links and notifications handling), so tapping the launcher icon creates a new task with our LauncherActivity as it is more like a SplashActivity, re-routing to the correct root Activity or creating a stack (for conversation deep links) then killing itself.

Doc1faux commented 8 months ago

Hi @edomuhammad, did my replies helped you understand your issue?

As this issue is stale, I close it, I let you reopen it if needed ;)