温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》
  • 首页 > 
  • 教程 > 
  • 开发技术 > 
  • 使用Parse内付费服务出现的Error Domain=Parse Code=146 "The operation couldn’t be completed.

使用Parse内付费服务出现的Error Domain=Parse Code=146 "The operation couldn’t be completed.

发布时间:2020-07-25 12:03:33 来源:网络 阅读:842 作者:新风作浪 栏目:开发技术

因为开发一个应用有个内付费去广告功能,介于苹果官方提供的方法没用过,感觉有些复杂,于是选用了第三方组件Parse来解决这个问题,简单易操作;

简化苹果官方内付费问题,使用方法分厂简单只有两个Block方法,以下实现简单的购买过程


在AppDelegate的application:didFinishLaunchingWithOptions:方法中


// Use the product identifier from iTunes to register a handler.
[PFPurchase addObserverForProduct:@"ProductID" block:^(SKPaymentTransaction *transaction) {
    // Write business logic that should run once this product is purchased.
    
}];



在购买的地方调用

[PFPurchase buyProduct:@"ProductID" block:^(NSError *error) {
    if (!error) {
        // Run UI logic that informs user the product has been purchased, such as displaying an alert view.
    }
}];



但是我在真机测试的时候一直出现Error Domain=Parse Code=146 "The operation couldn’t be completed. (Parse error 146.),即使新建工程也同样此错误。

Parse官方网站提供了对这个错误答疑,由于不够细心把解决方案多次忽略:①可能是这个产品ID(ProductID)有问题,或者不存在。②而我存在的问题是设备越狱了导致不能购买。

解决办法:①检查在itunes上ID问题;

②在Cydia中卸载掉Assync插件,重启设备即可解决;

③以上不行,换未越狱的设备试吧。



向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI