capacitor: bug: DeepLinks not redirect back to App
Bug Report
Capacitor Version
๐ Capacitor Doctor ๐
Latest Dependencies:
@capacitor/cli: 2.2.1
@capacitor/core: 2.2.1
@capacitor/android: 2.2.1
@capacitor/electron: 2.2.1
@capacitor/ios: 2.2.1
Installed Dependencies:
@capacitor/electron not installed
@capacitor/cli 2.2.0
@capacitor/core 2.2.0
@capacitor/ios 2.2.0
@capacitor/android 2.2.0
[success] Android looking great! ๐
Found 5 Capacitor plugins for ios:
cordova-plugin-browsertab (0.2.0)
cordova-plugin-compat (1.2.0)
cordova-plugin-deeplinks (1.1.1)
cordova-plugin-inappbrowser (4.0.0)
ionic-plugin-deeplinks (1.0.20)
[success] iOS looking great! ๐
Platform(s)
IOS
Current Behavior
We are using cmotion/ionic-keycloak-auth. Opens Keycloak in BrowserTab for redirecting its Using DeepLinks. After Login Success it should close the browser and save the token in the storage. Android works perfect. In Ios the DeepLink is not fired, **App.addListener(โappUrlOpenโ ** gets called.
i have setup all URL Scheme`s if i delete them Safari tells me about unknown URL.
Expected Behavior
Browser Close after Successfull login
Code Reproduction
Install cmotion/ionic-keycloak-auth and try to login with IOS
Other Technical Details
npm --version
output: 6.14.6
node --version
output: v12.11.0
pod --version
output (iOS issues only): 1.9.3
Additional Context
I already posted directly in cmotion github but doesnt get an answer https://github.com/coding-motion/ionic-keycloak/issues/8
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 27 (1 by maintainers)
Because deep link event โappUrlOpenโ did not fire in some special cases as described above we now use cordova-plugin-inappbrowser:
With InAppBrowser you can clear the cache on each session, hide the URL bar, customize colors and more. You could even remove deep links completely: InAppBrowser provides the possibility to read the current URL with the โloadstopโ event, where you can process the Keycloak login redirect URL params. Since using InAppBrowser everything works like expected and setup without deep links is much simpler.
I found I could fix the problem of the appUrlOpen not firing by changing
App.addListener('appUrlOpen', (data: AppUrlOpen) => {
toCapacitor.Plugins.App.addListener('appUrlOpen', (data: AppUrlOpen) => {