authgear-server
authgear-server copied to clipboard
Webview reload on rotation causes bugs in AuthUI
@louischan-oursky is this issue done from the two merged PR?
yes
Reported by user:
On Android, changing orientation will crash the custom tab when the app is portrait only
.
@axolotl0212 fixed it by setting the orientation in Android "on create activity",
@louischan-oursky Can this be fixed in the SDK level? or do we need to mention this case in the doc?
See discussion here: https://github.com/oursky/hkland-agent-platform/issues/3047#issuecomment-1087128095
If possible, we should allow the developer to configure our activities so that they can only be in portrait mode. The app will be consistent in the orientation it supports.
If possible, we should allow the developer to configure our activities so that they can only be in portrait mode. The app will be consistent in the orientation it supports.
@louischan-oursky So we should change something in the SDK?
Hi, just saw this issue. I don't know the details yet but I think we should strive to behave well in both orientation and be resilient to configuration change (screen density, orientation, language, etc) unless we are 100% sure it's a system bug. Could it be that our oauth/web view activity isn't handling configuration change properly? I can take a look at it.
It seems that we are talking about two different unrelated things here.
First, AuthUI should support orientation change. Additionally it should still look nice in landscape orientation.
Second, allow the developer to force the webview in a particular orientation. On iOS, I guess ASWebAuthenticationSession will follow the orientation of the app. Nothing needs to be done by us. On Android, we use an Activity to show the webview. We declare this activity in the AndroidManifest.xml of the SDK. We do this because we want to streamline the setup of the SDK. In case the developer wants to change the properties of the Activity, they should be able to override the properties by declaring this activity in their AndroidManifest.xml. We need to make sure this approach work.