In App purchase in iOS suddenly stop working ( Err

2019-02-02 21:22发布

I have integrated in-App purchase in my application successfully. I tested it properly by making test user account in itunes. My in-app purchase worked fine. But suddenly my IAP stopped working.

App can load all of the products but after entering my account credentials then transection queue undergoes state SKPaymentTransactionStateFailed and gives an error

Error Domain=SSServerErrorDomain Code=5002 "An unknown error has occurred"

6条回答
别忘想泡老子
2楼-- · 2019-02-02 21:36

It seems that the storekit does not work in the simulator any longer. I quote from storekit docs:

Note: Store Kit does not operate in iOS Simulator. When running your application in iOS Simulator, Store Kit logs a warning if your application attempts to retrieve the payment queue. Testing the store must be done on actual devices.

Store Kit Docs

查看更多
smile是对你的礼貌
3楼-- · 2019-02-02 21:39

If you are testing on real device, make sure it is not JB. If you are testing on simulator, make sure you are running iOS 6.0 or above, lower version of simulator doesn't work, I wasted a whole day to figure this out...

查看更多
手持菜刀,她持情操
4楼-- · 2019-02-02 21:44

To fix this, sign out of any existing account in the Settings app on your device.

查看更多
再贱就再见
5楼-- · 2019-02-02 21:47

Facing the same problem in ios 5.1 the store kit dosent work on simulator anymore you need to check it in the device.

And even after connecting to the device say you get an error code "Cannot connect to iTunes Store"

then that means that your device cannot contact the apple store and that is something which is not your fault.

查看更多
Summer. ? 凉城
6楼-- · 2019-02-02 21:50

I've run into the same error on iOS Simulator, but it works on my device(iPhone 3G).

The error is returned from Apple's Server, it's not under control by us.

查看更多
你好瞎i
7楼-- · 2019-02-02 21:59

It has been stopped working on simulator. try to use it on real device. It will work fine.

查看更多
登录 后发表回答