iOSitms-サービスのURLスキーム



Ios Itms Services Url Scheme



iOSの使用itms-services合意は、開発者がヒットするipaインストールパッケージを配布することです。これは主に、エンタープライズ開発アカウント配布および非エンタープライズ開発アカウントテストフェーズのインストールパッケージです。 (( タンポポfir.im インストールパッケージの配布に使用されるのはこのプロトコルです)

次の必要な材料を準備する必要があります
ipaインストールパッケージ、plistファイル、およびWebページ 画像



ipaインストールパッケージ
ここでのipaインストールパッケージは、会社の開発者アカウントを通じてパッケージ化されています。通常どおりにインストールして使用するには、デバイスを開発者アカウントに追加する必要があるため、ここでは詳しく説明しません。

plistファイルの構成
構成ファイルを変更する主な必要性は、インストールパッケージアドレスurlbundle-identifierbundle-versionです。



<plist version='1.0'> <dict> <key>itemskey> <array> <dict> <key>assetskey> <array> <dict> <key>kindkey> <string>software-packagestring> <key>urlkey> <string>https://tengfenglian.github.io/InstallIpa/PushDemo.ipastring> dict> <dict> <key>kindkey> <string>display-imagestring> <key>needs-shinekey> <true/> <key>urlkey> <string>http://img3.100bt.com/upload/ttq/20140523/1400836956582_middle.jpgstring> dict> <dict> <key>kindkey> <string>full-size-imagestring> <key>needs-shinekey> <true/> <key>urlkey> <string>http://img3.100bt.com/upload/ttq/20140523/1400836956582_middle.jpgstring> dict> array> <key>metadatakey> <dict> <key>bundle-identifierkey> <string>com.ltf.PushDemostring> <key>bundle-versionkey> <string>1.0string> <key>kindkey> <string>softwarestring> <key>subtitlekey> <string>Install App Subtitlestring> <key>titlekey> <string>Install App Titlestring> dict> dict> array> dict> plist>

htmlページ
使用するにはitms-services://?action=download-manifest&url= + plist file addressインストールパッケージをロードするには、plistファイルのアドレスがhttpsである必要があります
Safariブラウザに次のWebページをロードすると、ジャンプに応答してインストールプロンプトが表示されます

<meta name='viewport' content='initial-scale=1.0'/> <html lang='en'> <head> <meta name='apple-itunes-app' content='app-id=477927812 text/html charset=utf-8' http-equiv='Content-Type'> <title>Install Apptitle> head> <body> <a href='itms-services://?action=download-manifest&url=https://tengfenglian.github.io/InstallIpa/load.plist'>A key installationa> body> html>

WKWebView itms-servicesを使用してジャンプに応答してWebページをロードするときに、これをインターセプトする必要があります。 URLスキームを開いて開くと、インストールプロンプトが表示されます

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { NSURLRequest *request = navigationAction.request NSURL *url = navigationAction.request.URL NSString *scheme = [url scheme] if ([scheme isEqualToString:@'itms-services']) { if (@available(iOS 10.0, *)) { [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil] } else { [[UIApplication sharedApplication] openURL:url] } decisionHandler(WKNavigationActionPolicyCancel) return } decisionHandler(WKNavigationActionPolicyAllow) }



ここで私は使用します GitHub 上記の資料を保存するには、GitHubでプロジェクトを作成し、上記の3つのファイルを送信し、構成をリンクしてこれを表示します 論文