Skip to content

Not copying the CFBundleURLTypes from the plist file to the project #2892

Closed

Description

@NickIliev

From @patrickpereira on June 15, 2017 7:2

Hi!

I'm running the latest nativescript@3.1.0-2017-06-13-9176, and if I create a new project and add the following to the plist:

<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>fbXXXXXXXXX</string>
			</array>
		</dict>
	</array>

I end up with this in the generated platform plist file:

<key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>orgnativescripttestApp</string>
        </array>
      </dict>
    </array>

It doesn't matter what I put in (also if I don't add any CFBundleURLSchemes), it will always have the same thing in the generated plist file.

Copied from original issue: NativeScript/NativeScript#4388

Activity

  1. NickIliev commented on Jun 15, 2017

    @NickIliev
    Author

    @patrickpereira using this sample project I was not able to reproduce the described problem.

    After adding these lines and using the next runtime and modules the info.plist was successfully introduced in the build under platforms/ios/issue4388/issue4388-Info.plist where issue4388 is the name of the test project.

    If you still have troubles adding the lines in your project you can try to rebuild it with deleted platforms folder

  2. NickIliev commented on Jun 15, 2017

    @NickIliev
    Author

    From @patrickpereira on June 15, 2017 9:1

    @NickIliev I created a brand new project again, and after building the project - same issue happens.

    package.json

    {
      "description": "NativeScript Application",
      "license": "SEE LICENSE IN <your-license-filename>",
      "readme": "NativeScript Application",
      "repository": "<fill-your-repository-here>",
      "nativescript": {
        "id": "org.nativescript.PlistTest",
        "tns-ios": {
          "version": "3.1.0-2017-5-16-2"
        }
      },
      "dependencies": {
        "nativescript-theme-core": "~1.0.2",
        "tns-core-modules": "3.1.0-2017-06-14-6966"
      },
      "devDependencies": {
        "nativescript-dev-android-snapshot": "^0.*.*"
      }
    }
    

    ./app/App_Resources/iOS/Info.plist

    <?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>CFBundleDevelopmentRegion</key>
    	<string>en</string>
    	<key>CFBundleDisplayName</key>
    	<string>${PRODUCT_NAME}</string>
    	<key>CFBundleExecutable</key>
    	<string>${EXECUTABLE_NAME}</string>
    	<key>CFBundleInfoDictionaryVersion</key>
    	<string>6.0</string>
    	<key>CFBundleName</key>
    	<string>${PRODUCT_NAME}</string>
    	<key>CFBundlePackageType</key>
    	<string>APPL</string>
    	<key>CFBundleShortVersionString</key>
    	<string>1.0</string>
    	<key>CFBundleSignature</key>
    	<string>????</string>
    	<key>CFBundleVersion</key>
    	<string>1.0</string>
    	<key>LSRequiresIPhoneOS</key>
    	<true/>
    	<key>UILaunchStoryboardName</key>
    	<string>LaunchScreen</string>
    	<key>UIRequiresFullScreen</key>
    	<true/>
    	<key>UIRequiredDeviceCapabilities</key>
    	<array>
    		<string>armv7</string>
    	</array>
    	<key>UISupportedInterfaceOrientations</key>
    	<array>
    		<string>UIInterfaceOrientationPortrait</string>
    		<string>UIInterfaceOrientationLandscapeLeft</string>
    		<string>UIInterfaceOrientationLandscapeRight</string>
    	</array>
    	<key>UISupportedInterfaceOrientations~ipad</key>
    	<array>
    		<string>UIInterfaceOrientationPortrait</string>
    		<string>UIInterfaceOrientationPortraitUpsideDown</string>
    		<string>UIInterfaceOrientationLandscapeLeft</string>
    		<string>UIInterfaceOrientationLandscapeRight</string>
    	</array>
    	<key>CFBundleURLTypes</key>
    	<array>
    		<dict>
    			<key>CFBundleURLSchemes</key>
    			<array>
    				<string>fbXXXXXXXXX</string>
    			</array>
    		</dict>
    	</array>
    </dict>
    </plist>
    

    ./platforms/ios/PlistTest/PlistTest-Info.plist

    <?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>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleDisplayName</key>
        <string>${PRODUCT_NAME}</string>
        <key>CFBundleExecutable</key>
        <string>${EXECUTABLE_NAME}</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>${PRODUCT_NAME}</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>1.0</string>
        <key>LSRequiresIPhoneOS</key>
        <true/>
        <key>UILaunchStoryboardName</key>
        <string>LaunchScreen</string>
        <key>UIRequiresFullScreen</key>
        <true/>
        <key>UIRequiredDeviceCapabilities</key>
        <array>
          <string>armv7</string>
        </array>
        <key>UISupportedInterfaceOrientations</key>
        <array>
          <string>UIInterfaceOrientationPortrait</string>
          <string>UIInterfaceOrientationLandscapeLeft</string>
          <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
          <string>UIInterfaceOrientationPortrait</string>
          <string>UIInterfaceOrientationPortraitUpsideDown</string>
          <string>UIInterfaceOrientationLandscapeLeft</string>
          <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>CFBundleURLTypes</key>
        <array>
          <dict>
            <key>CFBundleURLSchemes</key>
            <array>
              <string>orgnativescriptPlistTest</string>
            </array>
          </dict>
        </array>
        <key>CFBundleIdentifier</key>
        <string>org.nativescript.PlistTest</string>
      </dict>
    </plist>
    
  3. NickIliev commented on Jun 15, 2017

    @NickIliev
    Author

    @patrickpereira even the newly created project has already created platforms folder. Can you try to delete the folder, make your changes in info.plist and then execute

    tns build ios
    

    In fact, even without deleting the platforms folder the changes made in info.plist should still be respected when rebuilding the project with tns build command - I have tested this on several projects with 100 percent success ratio.

  4. NickIliev commented on Jun 15, 2017

    @NickIliev
    Author

    From @patrickpereira on June 15, 2017 10:2

    @NickIliev I just removed the platform added the stuff in plist, and the tns build ios. With same result. This problem didn't occur while I was running Nativescript@3.0.3, it's only after I updated to next that this issue has started.

  5. NickIliev commented on Jun 15, 2017

    @NickIliev
    Author

    From @patrickpereira on June 15, 2017 10:3

    I will just downgrade to 3.0.3, to see if it fixes it, will let you know.

  6. NickIliev commented on Jun 15, 2017

    @NickIliev
    Author

    From @patrickpereira on June 15, 2017 10:6

    Yes I can confirm it works as you describe on 3.0.3, but not on the next version.

  7. NickIliev commented on Jun 15, 2017

    @NickIliev
    Author

    @patrickpereira I was under the impression you are running only the next for ios-runtime.
    When tested with next of CLI (3.1.0-2017-06-13-9176) I was able to reproduce the issue you are describing.

  8. added this to the 3.1.0 milestone on Jun 21, 2017
  9. modified the milestones: 3.1.1, 3.1.0 on Jun 22, 2017
  10. rosen-vladimirov commented on Jun 26, 2017

    @rosen-vladimirov
    Contributor

    Hey @patrickpereira, thank you very much for trying our @next version and reporting this issue. We've already applied a fix, so can you please try the latest @next version of NativeScript CLI and see if it resolves your issue?

    Once again thanks for reporting this regression in our master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions