IOS 应用在添加时 info.plist 中缺少目的字符串

IOS app missing purpose string in info.plist while it is added

我的 ios 应用程序现在被拒绝了 3 次,因为缺少 info.plist 中的目的字符串。 Apple 说我必须为位置使用添加目的字符串。有趣的是,我补充说,它在 info.plist 中,但由于某种原因,phone 和 Apple 都没有找到它。我做错了什么?!

以下是我的部分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>CFBundleDisplayName</key>
    <string>----</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1.1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
    <string>13.0</string>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIMainStoryboardFile~ipad</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>CFBundleIdentifier</key>
    <string>-----</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <array>
        <string>App would like to use location to track the exact location of the vehicle in real time. Also notify our warehouses when the driver is arriving.</string>
    </array>
    <key>NSLocationAlwaysUsageDescription</key>
    <array>
        <string>App would like to use location to track the exact location of the vehicle in real time. Also notify our warehouses when the driver is arriving.</string>
    </array>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <array>
        <string>App would like to use location to track the exact location of the vehicle in real time. Also notify our warehouses when the driver is arriving</string>
    </array>

更新您的 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>CFBundleDisplayName</key>
    <string>----</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1.1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>MinimumOSVersion</key>
    <string>13.0</string>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UIMainStoryboardFile~ipad</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>CFBundleIdentifier</key>
    <string>-----</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>App would like to use location to track the exact location of the vehicle in real time. Also notify our warehouses when the driver is arriving.</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>App would like to use location to track the exact location of the vehicle in real time. Also notify our warehouses when the driver is arriving.</string>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>App would like to use location to track the exact location of the vehicle in real time. Also notify our warehouses when the driver is arriving</string>

您需要为位置权限添加一个唯一的字符串并且您已将其添加到数组中。

希望对你有用。