2013-10-11 48 views
0

我正嘗試從服務器安裝一個具有.ipa和.plist的應用程序。當我嘗試調用的URL在下載AdHoc分發中的.ipa文件時出錯

我收到不支持的URL,錯誤代碼1002,我應該怎麼辦。如何調用這個網址。

NSLog(@"requestString : %@",requestString); 
self.responseData=[[NSMutableData alloc]init]; 
NSMutableURLRequest *request = [NSMutableURLRequest 
           requestWithURL:[NSURL URLWithString:requestString]]; 
[request setHTTPMethod:@"GET"]; 
[request setValue:loginCredentials forHTTPHeaderField:@"Authorization"];  
NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 
[cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; 
[request setHTTPShouldHandleCookies:YES]; 

NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 
[connection start]; 
+0

上面的url是我嘗試調用的格式。請幫助我。 – Logunath

+0

任何人都可以爲我們提供示例代碼。 – Logunath

回答

0

我通常使用下面的格式來使它工作。

<a class="correct button" href="itms-services://?action=download-manifest&url=http://baseURL/app.plist">Distribution Link</a> 

而且plist中的內容結構如下圖所示:

PLIST

訪問:

self.responseData=[[NSMutableData alloc]init]; 
NSMutableURLRequest *request = [NSMutableURLRequest 
          requestWithURL:[NSURL URLWithString:requestString]]; 
[request setHTTPMethod:@"GET"]; 
[request setValue:loginCredentials forHTTPHeaderField:@"Auth"];  

NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 
[connection start]; 

作品般的魅力!

0
UIWebView *webView = [[UIWebView alloc]init]; 
webView.delegate = self; 
[self.view addSubview:webView]; 
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:requestString]]]; 

您好,我使用上述格式請求的URL和我得到了警告,要求進行安裝和取消,現在它的工作的罰款。

請求URL:

「ITMS服務://行動=下載艙單& URL = ITMS服務://行動=下載艙單& URL = HTTP:/oursite.com/myApp .plist「id =」text「