As the IAPListener, when onInitialized is called, I do sdkbox::IAP::refresh(); to fetch the product information from remote market - this time Google Play.
When the product data comes back in onProductRequestSuccess, it’s always just with basic data like the market id of respective product filled in, but the prices are empty strings. The price is missing, so I cannot show the price in the in-game interface.
Only if I try to buy any product once, then cancel, the full information including the price comes back in.
AFAIK this works without problem with iOS/App Store. The problem is only with Google Play.
in applicationWillEnterForeground I also do sdkbox::IAP::refresh();.
Update: I added calls to sdkbox::IAP::refresh(); on a few more occasions during the startup sequence of my app, specifically in the onEnterTransitionFinished of a intro scene I have and also on a “title” scene. It seems to fix the problem. Somehow trying to fetch product prices does not work if the refresh is called “too early”… Looks like a bug?
I don’t think it is timing related - unless the first call to refresh screws things up if called too early.
I call :: refresh every time I open my shop scene, I always get the found handler executing as expected, but no data.
I suspect - but am not sure - that this is std::string related, but don’t know how to prove that.
A problem with std::string in C++ still? I don’t think so, but maybe you mean something else?
Yes, doing refresh when opening the in-app purchase interfaces would be a good idea again. Now I always like to have the necessary data upfront and try to fetch that on app startup too, and thus want to make sure that works too.
hi
Sorry, eclipse raised an error for the str template provided. This is environment related on my system. The only way I could get rid of this was to add c++11 into my search path. I couldn’t resolve by adding include< string> etc
Just because of this trouble I suspect string. I don’t know what is being compiled string wise on android.
Yes I also call init then refresh soon after start, but in are anything has changed or if connection lost I call refresh as I open my shop.