cannot connect to example.com in iOS enterprise app

纵然是瞬间 提交于 2019-12-23 09:32:36

问题


I'm facing a serious problem. I'm trying to make a enterprise app live.By using BetaBuilder I follows these steps:

myApp.ipa
manifest.plist
index.html

manifest.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>items</key>
    <array>
        <dict>
            <key>assets</key>
            <array>
                <dict>
                    <key>kind</key>
                    <string>software-package</string>
                    <key>url</key>
                    <string>https://example.com/ios/myapp.ipa</string>
                </dict>
            </array>
            <key>metadata</key>
            <dict>
                <key>bundle-identifier</key>
                <string>com.com.myapp</string>
                <key>bundle-version</key>
                <string>1.0</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>
                <string>Myapp</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>

and the index.html file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Myapp - Beta Release</title>
</head>
<body>

<div id="container">
  <h1>iOS 4.0 Users:</h1>
  <div class="link"><a href="itms-services://?action=download-manifest&url=https://example.com/ios/manifest.plist">Tap Here to Install</a>
  </div>
</div>

</body>
</html>

I even made the link http to https. But it always says :Cannot connect to example.com. Whats wrong with the setup?


回答1:


Over-The-Air iOS distributions must be served from using SSL with a verified SSL certificate.

Now to distrubute OTA you must follow these steps.

1) Provide a link to your generated .plist file that contains the manifest for the application download. This link MUST be served over SSL with a verified SSL certificate. An example of a valid .plist file is such:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>items</key>
    <array>
      <dict>
        <key>assets</key>
        <array>
          <dict>
            <key>kind</key>
            <string>software-package</string>
            <key>url</key>
            <string>https://[full download url].ipa</string>
          </dict>
        </array>
        <key>metadata</key>
        <dict>
          <key>bundle-identifier</key>
          <string><full bundle identifier></string>
          <key>bundle-version</key>
          <string>[version string]</string>
          <key>kind</key>
          <string>software</string>
          <key>title</key>
          <string>[software name]</string>
        </dict>
      </dict>
    </array>
  </dict>
</plist>

2) URL key in the .plist file must be served from a valid SSL certificate.

Now I am not 100% of your server setup but there is the possibility the web server does not respond correctly to the .plist extension as well as the .ipa extension. You must set your web server to understand the following file extension \ mime-type:

  • Extension: .plist
  • MimeType: application/xml

  • Extension: .ipa

  • MimeType: application/octet-stream

We had many problems at first getting our applications to be deployed over the air. The biggest hurdle was around the SSL certificate and MimeTypes.

One final comment, I am sure you have your own domain and arent using example.com in your links or plist files.

Cheers..



来源:https://stackoverflow.com/questions/29559793/cannot-connect-to-example-com-in-ios-enterprise-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!