Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: openUrl conflict on iOS #328

Closed
DavidStrausz opened this issue Mar 4, 2020 · 3 comments
Closed

bug: openUrl conflict on iOS #328

DavidStrausz opened this issue Mar 4, 2020 · 3 comments
Labels
bug Something isn't working properly ios relates to iOS platform runtime issue An issue related to app runtime

Comments

@DavidStrausz
Copy link

Bug report

Current behavior:

By implementing Google SignIn it is required to add an openURL handler on iOS, by doing so the notification is not propagated to the webview anymore (window.handleOpenURL is not called anymore):

As a result this plugin is incompatible with e.g. cordova-plugin-customurlscheme.

Expected behavior:
When opening an app with a custom URL scheme the notification should be propagated to the webview.

Steps to reproduce:
Use this plugin in combination with an custom URL scheme, then open the app with that custom URL scheme -> window.handleOpenURL is never called.

Environment information

  • Cordova CLI version
  • Cordova platform version
    • ios 5.0.1
  • Plugins & versions installed in project (including this plugin)
com.verso.cordova.clipboard 0.1.0 "Clipboard"
cordova-android-play-services-gradle-release 4.0.0 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release"
cordova-custom-config 5.1.0 "cordova-custom-config"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-android-fingerprint-auth 1.5.0 "FingerprintAuth"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-crosswalk-webview 2.4.0 "Crosswalk WebView Engine"
cordova-plugin-customurlscheme 5.0.0 "Custom URL scheme"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
cordova-plugin-firebasex 8.1.0 "Google Firebase Plugin"
cordova-plugin-inappbrowser 3.1.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-network-information 2.0.2 "Network Information"
cordova-plugin-safariviewcontroller 1.6.0 "SafariViewController"
cordova-plugin-sms-retriever-manager 0.0.2 "Device"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-taptic-engine 2.1.0 "Taptic Engine"
cordova-plugin-touch-id 3.3.1 "Touch ID"
cordova-plugin-whitelist 1.3.4 "Whitelist"
  • Dev machine OS and version, e.g.
    • macOS Catalina
      • 10.15

Related code:
The problematic override was added here:

- (BOOL)application:(nonnull UIApplication *)application

handleOpenURL notification in CDVPlugin:
https://github.com/apache/cordova-ios/blob/29224370fff52dd3ee210bdf49571f338c0770c6/CordovaLib/Classes/Public/CDVPlugin.m#L130

Other information:

Cordova triggers a notification (handleOpenURL) when the app is opened by a custom url which is broadcasted to all plugins, this notification can be used instead of overriding the global openURL handler. Related Cordova documentation can be found here

@dpa99c
Copy link
Owner

dpa99c commented Mar 4, 2020

Thanks for reporting - I didn't realise CDVPlugin exposed a handler for this method.
It should therefore be possible to modify this plugin to use the override instead on an app delegate which should resolve the issue.

@dpa99c dpa99c added bug Something isn't working properly ios relates to iOS platform runtime issue An issue related to app runtime labels Mar 4, 2020
@DavidStrausz
Copy link
Author

@yeah I also did not know about all the handlers that are available until I ran into this issue and did some research on possible solutions! :)

dpa99c pushed a commit that referenced this issue Mar 11, 2020
…d of implementing app delegate `application:openURL:options` to prevent conflicts with other plugins.

Resolves [#328](#328).
@dpa99c dpa99c added the ready for release Something has been implemented and is awaiting release to npm label Mar 11, 2020
@dpa99c
Copy link
Owner

dpa99c commented Mar 11, 2020

v9.0.0 has now been published which fixes this issue

@dpa99c dpa99c closed this as completed Mar 11, 2020
@dpa99c dpa99c removed the ready for release Something has been implemented and is awaiting release to npm label Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly ios relates to iOS platform runtime issue An issue related to app runtime
Projects
None yet
Development

No branches or pull requests

2 participants