Добавить <dict>к существующему <key>в Info.plist - PullRequest
0 голосов
/ 28 апреля 2020

Я использую ионный c конденсатор для разработки моего ios приложения. Выполнение ioni c cap syn c ios дает мне <key> и <string> для добавления Info.plist. Также предлагается добавить

<dict>
<key>CFBundleTypeRole</key>
      <key>CFBundleURLSchemes</key>
      <string>Editor</string>
      <array>
        <string>prefs</string>
      </array>
    </dict>
in the existing CFBundleURLTypes entry of your Info.plist to work

Вот мой 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>************</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</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>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>com.getcapacitor.capacitor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>capacitor</string>
            </array>
        </dict>
        ***<dict>
            <key>CFBundleTypeRole</key>
            <key>CFBundleURLSchemes</key>
            <string>Editor</string>
            <array>
                   <string>prefs</string>
            </array>
        </dict>***
    </array>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    <key>NSMotionUsageDescription</key>
    <string>Allow background geolocation</string>
    <key>NSCameraUsageDescription</key>
    <string>To Take Photos and Video</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>Always allow Geolocation?</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Allow Geolocation?</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>To Record Audio With Video</string>
    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>Store camera photos to camera</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>To Pick Photos from Library</string>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <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>UIViewControllerBasedStatusBarAppearance</key>
    <true/>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>Allow iBEacon</string>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>Allow background geo location</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>location</string>
    </array>
</dict>
</plist>

После компиляции вы получите Error: Unexpected key "CFBundleURLSchemes" while parsing <dict/>. Я не знаю, что пошло не так. Может кто-нибудь помочь мне решить это? Спасибо.

...