Ios应用内采购请求数据功能未启动
Ios In-app Purchase RequestData Function not firing?
我使用的是phonegap 2.6.0 in,ios 7 sdk设备是5.1。我已经实现了应用内采购管理插件
在deviceready函数上,我尝试调用requestData((函数,但它没有启动,因为它应该是
function onDeviceReady(){
alert(window.plugins.inAppPurchaseManager); //-->This alerts as Object
window.plugins.inAppPurchaseManager.onPurchased = function(transactionIdentifier, productId, transactionReceipt) {
updatePurchaseTable(productId);
window.location.reload();
console.log('purchased: ' + productId);
}
window.plugins.inAppPurchaseManager.onRestored = function(transactionIdentifier, productId, transactionReceipt) {
console.log('restored: ' + productId);
/*See the developer guide for details of what to do with this */
}
window.plugins.inAppPurchaseManager.onFailed = function(errno, errtext) {
alert('failed: ' + errtext);
}
window.plugins.inAppPurchaseManager.requestProductData("ProductId1", function(result) {
alert(result.id); //-->this doesn't happen
console.log("productId: " + result.id + " title: " + result.title + " description: " + result.description + " price: " + result.price);
//window.plugins.inAppPurchaseManager.makePurchase(result.id, 1);
}, function(id) {
alert("Invalid product id: " + result.id);
}
);
}
我的config.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<widget>
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableLocation" value="false" /><!-- DEPRECATED -->
<preference name="EnableViewportScale" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value=".25" />
<preference name="HideKeyboardFormAccessoryBar" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="KeyboardShrinksView" value="false" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="TopActivityIndicator" value="gray" />
<content src="index.html" />
<plugins>
<plugin name="Device" value="CDVDevice" />
<plugin name="Logger" value="CDVLogger" />
<plugin name="Compass" value="CDVLocation" />
<plugin name="Accelerometer" value="CDVAccelerometer" />
<plugin name="Camera" value="CDVCamera" />
<plugin name="NetworkStatus" value="CDVConnection" />
<plugin name="Contacts" value="CDVContacts" />
<plugin name="Debug Console" value="CDVDebugConsole" />
<plugin name="Echo" value="CDVEcho" />
<plugin name="File" value="CDVFile" />
<plugin name="FileTransfer" value="CDVFileTransfer" />
<plugin name="Geolocation" value="CDVLocation" />
<plugin name="Notification" value="CDVNotification" />
<plugin name="Media" value="CDVSound" />
<plugin name="Capture" value="CDVCapture" />
<plugin name="SplashScreen" value="CDVSplashScreen" />
<plugin name="Battery" value="CDVBattery" />
<plugin name="Globalization" value="CDVGlobalization" />
<plugin name="InAppBrowser" value="CDVInAppBrowser" />
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="InAppPurchaseManager">
<param name="ios-package" value="InAppPurchaseManager" />
</feature>
</config-file>
<!-- Note: the ios src is based off src/ios implicitly -->
<header-file src="InAppPurchaseManager.h" />
<source-file src="InAppPurchaseManager.m" />
<framework src="StoreKit.framework" />
</platform>
</plugins>
<access origin="*" />
</widget>
.h和.m文件位于项目源中的plugins文件夹中。
我也在本地中发出了警报
InAppPurchaseManager.m
- (void) requestProductData:(CDVInvokedUrlCommand*)command
函数中不显示任何警报的文件。
这里有一个更新、更受欢迎的iOS IAP插件:https://github.com/j3k0/PhoneGap-InAppPurchase-iOS
最终它会更好地工作。
相关文章:
- 美国地图插件,具有状态数据/悬停功能的新按钮
- 控制器切换后匿名功能中的访问服务数据发生变化
- 带有嵌套表的数据表;t没有功能
- 从 AngularJS 中的控制器功能发送数据以供查看
- 从文件目录结构创建JSON数据的有效功能
- 是否有任何功能可以合并两个JSON数据集并替换旧信息?(节点.JS)
- 成功:功能(数据);不使用命名函数
- d3中的数据联接;我一定没有正确理解选择和/或数据键功能
- EXT JS : 数据存储过滤器功能不起作用
- GAS - 等到用户输入数据后,功能才会继续
- 对多个数据集多次使用单个把手功能
- 文件上传功能会显示 Safari 和 Chrome iOS8.1.2 上带有空字符串的数据
- 如何在输入下从数据列表中选择一个选项后立即触发功能
- jQuery功能,用于隐藏基于未在点击上运行的HTML5数据标签的元素
- 添加将Excel数据粘贴到Django表单的功能
- 搜索功能在 jquery 数据表中中断
- 仅在 AngularJS 中加载数据绑定功能
- 在一个php页面中使用ajax加载搜索后数据功能
- NVD3 -如何刷新数据功能,以产生新的数据点击
- Ios应用内采购请求数据功能未启动