Google IAP v3 plugin error

Hello

Because we don’t have access to current list of corona bugs [that’s the worst thing about corona i believe] I wanted to share what I just reported - Case 39101

When initializing Google IAP Plugin v3 after network request call is made, it will hang on the .init() function.

This was tested using Android 4.4, 5, 5.0.1. This does not happen [or we were unable to reproduce] on Android 2.3.6.

Test case is very simple:

local function test()   local store = require("plugin.google.iap.v3")   store.init("google", function(event)    print(require("json").encode(event))   end) end network.request("www.google.com", "GET", test)

Hi @krystian6,

Can you reproduce this by require()-ing the plugin outside of the network callback function? Also, can you explain your usage in triggering the store after a network request? How does that apply to the app’s functionality? Why would you need to check that it can connect to google.com before require()-ing the plugin? I’m sure you have reasons for this, but this overall implementation seems odd.

Thanks,

Brent

I would also suggest dropping the init call into a timer to give the network.request() a change to finish itself. 

Rob

Hello

Google.com is just an example. I connect to my server to sync user data first and only then to allow transactions.
Normally everything is fine with starting the iap firdt, but in case someone kills the app before finishing the transaction i will get that info on app start.,and that would be too soon for me.
I will check thw early require.

Thanks Rob for pointing this out for me.

Hi @krystian6,

Can you reproduce this by require()-ing the plugin outside of the network callback function? Also, can you explain your usage in triggering the store after a network request? How does that apply to the app’s functionality? Why would you need to check that it can connect to google.com before require()-ing the plugin? I’m sure you have reasons for this, but this overall implementation seems odd.

Thanks,

Brent

I would also suggest dropping the init call into a timer to give the network.request() a change to finish itself. 

Rob

Hello

Google.com is just an example. I connect to my server to sync user data first and only then to allow transactions.
Normally everything is fine with starting the iap firdt, but in case someone kills the app before finishing the transaction i will get that info on app start.,and that would be too soon for me.
I will check thw early require.

Thanks Rob for pointing this out for me.

I’ve ignored the issue for a while thinking that it only affects us - developers - because of the way we update the app through adb, but after last update of the game, for some people the same issue started to happen.

The only way to recover is to reset the data on the device, nothing else works. Unfortunately, this causes people to loose their progress in game, and if they didn’t use the sync functionality, they are probably not going to play it anymore. So for us this now becomes SERIOUS.

I’ve tried to move the require bit to main, but it’s no use. It is the init function that hangs and I have no control over it.

I cannot init in main or before any other activity, because first I have to do some other things with user’s data before I get info about unfinished transaction.

Do you have any idea what else could I do to debug this?

Right now it seems I will have to dive into the iap plugin and debug it to check where it hangs :confused:

I’ve ignored the issue for a while thinking that it only affects us - developers - because of the way we update the app through adb, but after last update of the game, for some people the same issue started to happen.

The only way to recover is to reset the data on the device, nothing else works. Unfortunately, this causes people to loose their progress in game, and if they didn’t use the sync functionality, they are probably not going to play it anymore. So for us this now becomes SERIOUS.

I’ve tried to move the require bit to main, but it’s no use. It is the init function that hangs and I have no control over it.

I cannot init in main or before any other activity, because first I have to do some other things with user’s data before I get info about unfinished transaction.

Do you have any idea what else could I do to debug this?

Right now it seems I will have to dive into the iap plugin and debug it to check where it hangs :confused: