0

If I would like to write a web apps that users can purchase some virtual things, can I call the iphone inapp? or I can use other payment methods?

4

1 回答 1

0

不,你不能,你需要在你的应用程序中实现特殊的非标准标签,当用户点击这些链接时,他们会有这样的事情:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    if (navigationType == UIWebViewNavigationTypeLinkClicked) {

        NSString *urlAbsolute = [request.URL absoluteString];
        if ([urlAbsolute hasPrefix:@"YourSpecialTag://"])
        {
            //YourSpecialTag://BuyID=100
            //Parse the url
            //Get the id = 100
            //Continue with in-app purchase
            return NO;
        }
    }
    return YES;
}
于 2012-05-24T06:59:03.983 回答