Skip to content

CFBundleURLTypes cannot be overridden from a plugin #2936

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

Closed
darind opened this issue Jun 30, 2017 · 0 comments · Fixed by #2961
Closed

CFBundleURLTypes cannot be overridden from a plugin #2936

darind opened this issue Jun 30, 2017 · 0 comments · Fixed by #2961

Comments

@darind
Copy link

darind commented Jun 30, 2017

Please, provide the details below:

Did you verify this is a real problem by searching [Stack Overflow]

No

Tell us about the problem

I developed a custom {N} plugin and added a platform/ios/Info.plist file with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>org.nativescript.foo</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>bar</string>
            </array>
        </dict>
    </array>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
</dict>
</plist>

Then I installed the plugin into a newly created {N} app with:

tns create myapp
cd my app
tns plugin add /work/myplugin
tns build ios

The resulting application doesn't appear to take into account the CFBundleURLTypes setting from the plugin. On the other hand the NSAppTransportSecurity works fine.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.1.1
  • Cross-platform modules: 3.1.0
  • Runtime(s): tns-android: 3.0.0 and tns-ios: 3.0.0
  • Plugin(s):

Please tell us how to recreate the issue in as much detail as possible.

mkdir myplugin
cd myplugin/
mkdir platforms
mkdir platforms/ios

echo '{
    "name": "MyPlugin",
    "version": "1.0.0",
    "nativescript": {
        "platforms": {
            "android": "3.0.0",
            "ios": "3.0.0"
        }
    }
}' > package.json

echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>org.nativescript.foo</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>bar</string>
            </array>
        </dict>
    </array>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
</dict>
</plist>' > ./platforms/ios/Info.plist

cd ..
tns create foo && cd foo && tns plugin add ../myplugin && tns build ios
cat platforms/ios/foo/foo-Info.plist

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

@dtopuzov dtopuzov added this to the 3.2.0 milestone Jun 30, 2017
@dtopuzov dtopuzov self-assigned this Jul 12, 2017
dtopuzov added a commit to NativeScript/nativescript-cli-tests that referenced this issue Jul 12, 2017
@rosen-vladimirov rosen-vladimirov modified the milestones: 3.1.3, 3.2.0 Jul 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants