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: iOS platform detection wrong, when WKAppBoundDomains is in Info.plist #4721

Closed
gerritvanaaken opened this issue Jun 14, 2021 · 2 comments · Fixed by #4789
Closed

bug: iOS platform detection wrong, when WKAppBoundDomains is in Info.plist #4721

gerritvanaaken opened this issue Jun 14, 2021 · 2 comments · Fixed by #4789

Comments

@gerritvanaaken
Copy link

Bug Report

Capacitor Version


  @capacitor/cli: 3.0.0-rc.4
  @capacitor/core: 3.0.1
  @capacitor/android: 3.0.1
  @capacitor/ios: 3.0.1

Platform(s)

iOS

Current Behavior

Capacitor detects platform as "web" although it is clearly synced and running on iOS Simulator.

Expected Behavior

platform should be "ios", when built for and running on iOS.

Code Reproduction

Add key "WKAppBoundDomains" to the Info.plist in the ios/App folder

You don’t even have to add domain entries.

<key>WKAppBoundDomains</key>
<array>
	<string>mydomain.com</string>
</array>
@jcesarmobile
Copy link
Member

Adding WKAppBoundDomains key blocks JavaScript injection and other WKWebView features unless limitsNavigationsToAppBoundDomains is set to true (which is not possible at the moment, will be after the linked PR gets merged).
Without the JavaScript injection, native plugins don't work and the web version is used instead.

More information about App Bound Domains and how they affect the WKWebView can be found here

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants