【问题标题】:Remove iPad from device list in PhoneGap app从 PhoneGap 应用程序的设备列表中删除 iPad
【发布时间】:2018-03-01 06:44:17
【问题描述】:

我刚刚在 PhoneGap 中完成了我的第二个应用程序,这个问题又出现了,除了这次它阻止了应用程序被应用程序商店批准,所以我不能再忽略它了。

我已经用谷歌搜索了这个并尝试了很多东西,但我似乎无法从 iPad 上删除该应用程序。它是一个仅限 iPhone 的应用程序,我什至没有 iPad 来测试它,所以我什至无法让 ipad 让它通过 App 商店“让它变得更好”。我在这篇文章的底部包含了我当前版本的 config.xml,你会看到我有标准:

<preference name="target-device" value="handset" />

...以及我在网上找到的解决这个问题的假设方法(这似乎很普遍,但现在显然也应该得到修复?!):

<gap:config-file platform="ios" parent="UIDeviceFamily" mode="replace">
    <string>1</string>
</gap:config-file>

...当我在 PhoneGap build 中编译 ipa 并在我的 iTunes 中打开它时,它甚至说它仅适用于 iPhone 和 iPod touch:

...但是当我通过应用程序加载器上传它时,它出现在 iTunes Connect 中,可用于 iPad 和 TestFlight。奇怪的是,它不需要 iPad 友好的屏幕截图,这让我觉得我已经成功了,但审查团队坚持要在他们允许它进入商店之前让它配得上 iPad,而且时间有点紧迫。

这是我的完整 config.xml(我已经 XXX 删除了敏感信息,因为它不是个人应用程序)

<widget xmlns     = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        id        = "XXX.XXXXXXX.XXXXXXXX"
        version   = "14">

    <gap:config-file platform="ios" parent="CFBundleShortVersionString">
        <string>1.0.0</string>
    </gap:config-file>

    <name>XXXXXXXX</name>

    <description>
        XXXXXXXXXX
    </description>

    <author href="http://XXXXXX.co.uk" email="XXXX@XXXXXXXXX.co.uk">
        XXXXXXXXXXX
    </author>

    <!-- Define the main entry-point to the application -->
    <content src="index.html" />

    <!-- Customize your app and platform with the preference element. -->
    <preference name="orientation" value="portrait" />       <!-- all: default means both landscape and portrait are enabled -->
    <preference name="target-device" value="handset" />        <!-- all: possible values handset, tablet, or universal -->
    <preference name="fullscreen" value="true" />           <!-- all: hides the status bar at the top of the screen -->
    <preference name="webviewbounce" value="true" />           <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
    <preference name="prerendered-icon" value="true" />           <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->
    <preference name="stay-in-webview" value="false" />          <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
    <preference name="ios-statusbarstyle" value="default" />    <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar -->
    <preference name="detect-data-types" value="false" />          <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
    <preference name="exit-on-suspend" value="true" />           <!-- ios: if set to true, app will terminate when home button is pressed -->
    <preference name="show-splash-screen-spinner" value="true" />          <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
    <preference name="auto-hide-splash-screen" value="true" />           <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->
    <preference name="deployment-target" value="8.0" />
    <preference name="phonegap-version" value="cli-6.5.0" />

    <!-- Plugins -->
    <!-- Core plugins -->
    <plugin name="cordova-plugin-console"             source="npm" spec="~1.0.2" />
    <plugin name="cordova-plugin-device"              source="npm" spec="~1.1.1" />
    <plugin name="cordova-plugin-dialogs"             source="npm" spec="~1.2.0" />
    <plugin name="cordova-plugin-inappbrowser"        source="npm" spec="~1.3.0" />
    <plugin name="cordova-plugin-network-information" source="npm" spec="~1.2.0" />
    <plugin name="cordova-plugin-splashscreen"        source="npm" spec="~3.2.1" />
    <plugin name="cordova-plugin-statusbar"           source="npm" spec="~2.1.2" />
    <plugin name="cordova-plugin-vibration"           source="npm" spec="~2.1.0" />
    <plugin name="cordova-plugin-whitelist"           source="npm" spec="~1.2.1" />

    <gap:config-file platform="ios" parent="ITSAppUsesNonExemptEncryption" mode="add">
        <false/>
    </gap:config-file>

    <gap:config-file platform="ios" parent="UIDeviceFamily" mode="replace">
        <string>1</string>
    </gap:config-file>

    <!-- Define app icon and splashscreen for each platform. -->
    <icon src="icon.png" gap:platform="ios" width="57" height="57"/>

    <icon src="res/icon/ios/icon-57.png" gap:platform="ios" width="57" height="57"/>
    <icon src="res/icon/ios/icon-57@2x.png" gap:platform="ios" width="114" height="114"/>

    <icon src="res/icon/ios/icon-72.png" gap:platform="ios" width="72" height="72"/>
    <icon src="res/icon/ios/icon-72@2x.png" gap:platform="ios" width="144" height="144"/>

    <!-- iPhone / iPod Touch  -->
    <icon src="res/icon/ios/icon-60.png" gap:platform="ios" width="60" height="60" />
    <icon src="res/icon/ios/icon-60@2x.png" gap:platform="ios" width="120" height="120" />

    <!-- iPhone 6 / 6+ -->
    <icon src="res/icon/ios/icon-60@3x.png" gap:platform="ios" width="180" height="180" />

    <!-- Settings Icon -->
    <icon src="res/icon/ios/icon-small.png" platform="ios" width="29" height="29" />
    <icon src="res/icon/ios/icon-small@2x.png" platform="ios" width="58" height="58" />
    <icon src="res/icon/ios/icon-small@3x.png" platform="ios" width="87" height="87" />

    <!-- Spotlight Icon -->
    <icon src="res/icon/ios/icon-40.png" platform="ios" width="40" height="40" />
    <icon src="res/icon/ios/icon-40@2x.png" platform="ios" width="80" height="80" />
    <icon src="res/icon/ios/icon-40@3x.png" platform="ios" width="120" height="120" />

    <!-- iPhone and iPod touch -->
    <gap:splash src="res/screen/ios/Default.png" gap:platform="ios" width="320" height="480" />
    <gap:splash src="res/screen/ios/Default@2x.png" gap:platform="ios" width="640" height="960" />

    <!-- iPhone 5 / iPod Touch (5th Generation) -->
    <gap:splash src="res/screen/ios/Default-568h.png" gap:platform="ios" width="320" height="568" />
    <gap:splash src="res/screen/ios/Default-568h@2x.png" gap:platform="ios" width="640" height="1136" />

    <!-- iPhone 6 -->
    <gap:splash src="res/screen/ios/Default-667h@2x.png" gap:platform="ios" width="750" height="1334" />
    <gap:splash src="res/screen/ios/Default-Portrait-736h@3x.png" gap:platform="ios" width="1242" height="2208" />
    <gap:splash src="res/screen/ios/Default-Landscape-736h@3x.png" gap:platform="ios" width="2208" height="1242" />

    <access origin="*" />

    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />

</widget>

我也刚刚看到,即使在 iTunes Connect 中,当我单击构建时,它会将其列为 iPhone / iPod touch with no iPad... 只有在 TestFlight 中并提交审核时,它才会出现可用于 iPad?!我从这里去哪里?!

我刚刚找到了一种从 ipa 查看 plist 的方法,即使在其中,设备也被正确列为 1。我完全感到困惑!我从这里去哪里?

【问题讨论】:

  • 我认为你做得很好。即使您的应用程序应该与手机设备兼容,您的应用程序也必须在某种程度上与 iPad 兼容。它不必完全适合 iPad。

标签: ios cordova phonegap-build phonegap


【解决方案1】:

您已经从设备列表中删除了 iPad,但无法避免安装在 iPad 设备上。所有应用程序都可以安装在设备上,但如果该应用程序不支持 iPad,它将显示为 iPhone 应用程序,您可以缩放以填满整个 iPad 屏幕

由于应用程序将在 iPhone 4 尺寸上显示,因此您不需要 iPad 来测试它是否看起来不错。反正你可以用模拟器测试一下

【讨论】:

  • 哇。因此,即使您可以在 XCode 和 PhoneGap 配置中将其设置为“手机”,您也始终可以在 ipad 上下载它?!
  • 是的,问题是 iPad 可以运行 iPhone 应用程序。避免在 iPad 上安装的唯一方法是要求电话功能,但如果应用程序并不真正需要电话功能,Apple 将拒绝该应用程序,并且要求它也会从受支持的设备中删除 iPod。
  • 嗯,我今天学到了一些东西(每隔一天!)我只是不禁觉得这应该更明显一点!我不是 ipad 所有者,但建议您可以将您的应用程序设置为“平板电脑”或“通用”的“手机”,这表明它应该仅适用于这些选项......清楚地说明了这一点在文档中会为我节省很多时间。我将我的应用程序设置为“通用”,并根据屏幕尺寸为平板电脑和手机添加了一个单独的样式表,以便为每个应用程序进行调整。谢谢!
猜你喜欢
  • 1970-01-01
  • 2013-08-18
  • 2014-11-11
  • 1970-01-01
  • 1970-01-01
  • 2016-10-16
  • 1970-01-01
  • 2014-07-16
相关资源
最近更新 更多