如何在UIWebView中使用Apple(在应用内购买)? [英] How to use Apple (in app purchases) in UIWebView?

查看:102
本文介绍了如何在UIWebView中使用Apple(在应用内购买)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从应用程序内的UIWebView购买Apple In App?

Is there any way to use Apple In App purchases from a UIWebView inside the application ?

因为我想使用网页视图加载外部网站并使用在应用程序中购买应用程序内的付款方式。

Since i want to use a web view to load an external website and use in app purchases as payement method inside the app.

推荐答案

您可以从UIWebView调用Objective-C方法。这可以通过在 shouldStartLoadWithRequest:方法中捕获自定义URL来实现。同样,您可以从Objective-C代码( stringByEvaluatingJavaScriptFromString:)中调用HTML中的JS方法。详细信息如这里

You can call Objective-C methods from UIWebView. This you can do by trapping your custom urls in the shouldStartLoadWithRequest: method. As well, you can call JS methods in HTML from Objective-C code (stringByEvaluatingJavaScriptFromString:). Details are here.

我认为可以从UIWebView内部购买Apple的InApp,但这取决于您的具体要求。只要你使用Apple的支付网关(这样他们就可以减少30%:))没关系。

I think it is possible to use Apple's InApp purchase from inside UIWebView, though it depends on your exact requirements. As long as you use Apple's payment gateway (so that they get their 30% cut :)) it's okay.

这篇关于如何在UIWebView中使用Apple(在应用内购买)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆