Firebase Storage - How to install iOS over-the-air

2019-07-14 05:35发布

iOS OTA install is not working with Firebase Storage, and my guess is it is because the storage URL has query strings attached to it like so:

https://firebasestorage.googleapis.com/v0/b/some_project%2Fmanifest.plist?alt=media&token=some_token

When I use the Amazon S3 URL that ends with .plist it works fine, and when I erase the query part, the following code at leasts responds--although it says it can't connect:

let url = URL(string: "itms-services://?action=download-manifest&url=\(str)")! UIApplication.shared.openURL(url)

With the query string in place, it doesn't even respond.

I did some searching, and it's not because the URL is not percent escaped. The S3 URL also had no percent escape, but it worked fine.

In short, my question is

  1. Is it possible to install with Firebase Storage?
  2. If not, is it possible to install the app having download the plist file in advance?

Thank you.

1条回答
我命由我不由天
2楼-- · 2019-07-14 06:10
  1. It is possible to install the app OTA using Firebase storage.

The issue was that using the itms-services scheme, the query string could not be parsed. Also percent escaping the URL doesn't work because Firebase will not recognize the URL and return a 404.

This however can be circumvented using Google URL shortener. The shortened URL is parsed without error.

It's also worth mentioning that the URLs in the manifest.plist file do not have to be shortened--although you could. However, if you decide to use the URLs as they are, make sure the & in the URL are escaped with & in the XML.

I mention this because while Xcode escapes &s for you, the URL for the .ipa file can be known only after uploading to Firebase storage, and it's easy to forget to escape ampersands when you modify the plist file manually to update the installation file URL.

  1. Pre-downloading the plist file does not work.
查看更多
登录 后发表回答