javascript PhoneGap 是否支持应用内购买?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5679352/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Does PhoneGap support In-App Purchase?
提问by daniellmb
Has anyone used David Orchard's forkfor in-app purchases with PhoneGap? It hasn't been updated in over a year. According to this threadUrban Airship can't help yet.
有没有人使用David Orchard 的 fork通过 PhoneGap 进行应用内购买?它已经一年多没有更新了。根据这个线程Urban Airship 还帮不上忙。
采纳答案by daniellmb
Ah! I just needed to look a bit harder, this PhoneGap plugin should work perfectly. I'll comment here how well it works with Urban Airship.
啊! 我只是需要看起来更努力一点,这个 PhoneGap 插件应该可以完美运行。我将在这里评论它与 Urban Airship 的配合情况。
https://github.com/phonegap/phonegap-plugins/tree/master/iOS/InAppPurchaseManager
https://github.com/phonegap/phonegap-plugins/tree/master/iOS/InAppPurchaseManager
回答by Pasta
The phonegap pluginsuggested by daniellmb works well. Please keep the following in mind
daniellmb建议的phonegap 插件运行良好。请记住以下几点
CORDOVA_FRAMEWORK in InAppPurchaseManager.h, remove all the code around that. You will run into 'CDVPlugin.h' file not found in inAppPurchaseManager.h, this is how both import should look
#import <Cordova/CDVPlugin.h> #import <Cordova/NSData+Base64.h>
If you get the errror Plugin 'InAppPurchaseManager' not found, or is not a CDVPlugin. Check your plugin mapping in Cordova.plist. You have to add the following to Cordova.plist
<key>InAppPurchaseManager</key> <string>InAppPurchaseManager</string>
InAppPurchaseManager.h 中的 CORDOVA_FRAMEWORK,删除围绕它的所有代码。您将遇到在 AppPurchaseManager.h 中找不到的“CDVPlugin.h”文件,这就是导入的外观
#import <Cordova/CDVPlugin.h> #import <Cordova/NSData+Base64.h>
如果你得到错误插件'InAppPurchaseManager' not found,或者不是CDVPlugin。检查 Cordova.plist 中的插件映射。您必须将以下内容添加到 Cordova.plist
<key>InAppPurchaseManager</key> <string>InAppPurchaseManager</string>