Sign In Register

How can we help you today?

Start a new topic
Answered

Connection lost during IAP

Hello,


Currently using a combination of Unity IAP to perform purchases and then the IOSBuyGoodsRequest/GooglePlayBuyGoodsRequest to validate the receipts and award the items.  The problem is as soon as the payment is made GameSparks loses it's connection and the request it tries to send (which is durable) does not get a response.  I've set the request to Durable but the requests do not seem to be sent until I send another request or restart the app which isn't very nice! I was wondering if there was a way to prevent the connection being lost during the purchase stage or to force the request to be resent as soon as the connection is re-established.  At the moment I'm sending the request twice which results in a success and a "verification":"5" error each time which is kind of messy.  Any help would be greatly appreciated!


Best Answer

Hi Scott,


Can you let me know what version of Unity you are using, also what version of our SDK are you on ? The latest is 5.3.3.165 and can be found here. The connection shouldn't drop on an IOSBuyGoodsRequest/GooglePlayBuyGoodsRequest. Do any of the other requests in your game cause the connection to drop or just these ones ? If it's just these ones it could be something to do with how Unity IAP is hooked up in your game. Durable request queues are designed to send when a connection has been re established so the behavior for that is correct. If you are sending an IOSBuyGoodsRequest/GooglePlayBuyGoodsRequest again after reconnecting that would explain why it's being sent twice as the durable one is also being sent.


Thanks,

Liam


Answer

Hi Scott,


Can you let me know what version of Unity you are using, also what version of our SDK are you on ? The latest is 5.3.3.165 and can be found here. The connection shouldn't drop on an IOSBuyGoodsRequest/GooglePlayBuyGoodsRequest. Do any of the other requests in your game cause the connection to drop or just these ones ? If it's just these ones it could be something to do with how Unity IAP is hooked up in your game. Durable request queues are designed to send when a connection has been re established so the behavior for that is correct. If you are sending an IOSBuyGoodsRequest/GooglePlayBuyGoodsRequest again after reconnecting that would explain why it's being sent twice as the durable one is also being sent.


Thanks,

Liam

Thanks Liam!


We were using 5.3.1 of the SDK and after updating it, the problem has vanished! It was being caused by the OnApplicationPause method in PlatformBase.cs which disconnected from GS everytime app focus was lost! I've noticed this method is commented out in 5.3.3 which is why it's working now! Thanks for your help!

Login to post a comment