0

我正在尝试从具有 .ipa 和 .plist 的服务器安装应用程序。当我尝试调用 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];
4

2 回答 2

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

嗨,我使用上述格式来请求 URL,我收到了要求安装和取消的警报,现在它工作正常。

请求网址:

"itms-services://?action=download-manifest&url=itms-services://?action=download-manifest&url=http:/oursite.com/myApp.plist" id="text"

于 2013-10-21T05:40:05.967 回答
0

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

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

而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];

像魅力一样工作!

于 2013-10-17T06:54:59.800 回答