@@ -40,6 +40,7 @@ abstract class AppWebViewModel : ViewModel(), AppWebViewClient.WebClientCallback
4040
4141 abstract val currentUrl: MutableLiveData <String ?>
4242 abstract val init : LiveData <Event <String >>
43+ abstract val loadUrl: LiveData <Event <String >>
4344 abstract val isInErrorState: LiveData <Event <Boolean >>
4445 abstract val showLoadingIndicator: LiveData <Event <Boolean >>
4546 abstract val biometricRequest: LiveData <Event <BiometricRequest >>
@@ -68,13 +69,14 @@ class AppWebViewModelImpl(
6869
6970 override val currentUrl = MutableLiveData <String ?>()
7071 override val init = MutableLiveData <Event <String >>()
72+ override val loadUrl = MutableLiveData <Event <String >>()
7173 override val isInErrorState = MutableLiveData <Event <Boolean >>()
7274 override val showLoadingIndicator = MutableLiveData <Event <Boolean >>()
7375 override val biometricRequest = MutableLiveData <Event <BiometricRequest >>()
7476 override val goBack = MutableLiveData <Event <Unit >>()
7577
7678 override fun init (url : String ) {
77- this . init .value = Event (url)
79+ init .value = Event (url)
7880 }
7981
8082 override fun closeApp () {
@@ -380,18 +382,25 @@ class AppWebViewModelImpl(
380382 OpenURLInNewTabResult (OpenURLInNewTabResult .Failure (OpenURLInNewTabResult .Failure .StatusCode .RequestTimeout , OpenURLInNewTabError (" Timeout for openURLInNewTab" ))),
381383 OpenURLInNewTabResult (OpenURLInNewTabResult .Failure (OpenURLInNewTabResult .Failure .StatusCode .InternalServerError , OpenURLInNewTabError (" An error occurred" )))
382384 ) {
383- val redirectScheme = DeviceUtils .getPACERedirectScheme(context)
384- if (! redirectScheme.isNullOrEmpty() ) {
385+ // If integrated is true, do not check if PACE redirect scheme is set but always load the URL in the WebViewActivity
386+ if (openURLInNewTabRequest.integrated == true ) {
385387 appModel.openUrlInNewTab(openURLInNewTabRequest)
386388 OpenURLInNewTabResult (OpenURLInNewTabResult .Success ())
387389 } else {
388- appModel.onCustomSchemeError(context, " ${redirectScheme} ://redirect" )
389- OpenURLInNewTabResult (
390- OpenURLInNewTabResult .Failure (
391- OpenURLInNewTabResult .Failure .StatusCode .MethodNotAllowed ,
392- OpenURLInNewTabError (" Redirect scheme for deep linking has not been specified." )
390+ val redirectScheme = DeviceUtils .getPACERedirectScheme(context)
391+ if (! redirectScheme.isNullOrEmpty()) {
392+ appModel.openUrlInNewTab(openURLInNewTabRequest)
393+ OpenURLInNewTabResult (OpenURLInNewTabResult .Success ())
394+ } else {
395+ appModel.onCustomSchemeError(context, " ${redirectScheme} ://redirect" )
396+ loadUrl.postValue(Event (openURLInNewTabRequest.cancelUrl))
397+ OpenURLInNewTabResult (
398+ OpenURLInNewTabResult .Failure (
399+ OpenURLInNewTabResult .Failure .StatusCode .MethodNotAllowed ,
400+ OpenURLInNewTabError (" Redirect scheme for deep linking has not been specified." )
401+ )
393402 )
394- )
403+ }
395404 }
396405 }
397406 }
0 commit comments