the code in the in-app purchases tutorial is way outdated. the timestamp function to determine if it is a restore does not work. It always returns as a restore and the purchase never occurs for google store.
Can you provide a better description other than “It doesn’t work”.
Google never returns a “restored” state. If you call store.restore() you get “purchased” events. If you need to differentiate between purchased and restored, you have to look at the time stamp and say “just how fast could someone make a purchase and then trigger a restore”. Anyway, we found out that Google V3 is apparently returning the time in milliseconds. The tutorial was updated a few days ago to include dividing the timestamp by 1000 to convert it back to seconds.
If you’re having other issues, we need a better description, what error your getting, etc.
Rob
Hey Rob, I had my code up at first and it was pretty much the same as the tutorial before you made the milliseconds edit along with the v3 edits. My android app only received a restore transaction state and never got the purchase, so it never updated my app upgrades. I deleted that function and it all worked, so I figured it was that function and so I deleted my first forum post. Thanks for the update on that restore function! I will try it again with those updates and let you know how it comes out
Can you provide a better description other than “It doesn’t work”.
Google never returns a “restored” state. If you call store.restore() you get “purchased” events. If you need to differentiate between purchased and restored, you have to look at the time stamp and say “just how fast could someone make a purchase and then trigger a restore”. Anyway, we found out that Google V3 is apparently returning the time in milliseconds. The tutorial was updated a few days ago to include dividing the timestamp by 1000 to convert it back to seconds.
If you’re having other issues, we need a better description, what error your getting, etc.
Rob
Hey Rob, I had my code up at first and it was pretty much the same as the tutorial before you made the milliseconds edit along with the v3 edits. My android app only received a restore transaction state and never got the purchase, so it never updated my app upgrades. I deleted that function and it all worked, so I figured it was that function and so I deleted my first forum post. Thanks for the update on that restore function! I will try it again with those updates and let you know how it comes out