Bonobolabs / ios-in-app-purchasing

36 stars 5 forks source link

isPurchasing with Consumables #2

Closed oxcug closed 2 years ago

oxcug commented 11 years ago

When I purchase a consumable, the isPurchasing state gets fired the first time I purchase it, however when I purchase it a second or more times, it doesn't read it and instead gives me the following error message:

WARNING! Tried to appy event SetPurchasing while in state Purchased.

pzmudzinski commented 11 years ago

Have you fixed this issue? Is anyone working on this lib? :zzz:

dZbear commented 11 years ago

I have fixed my issue of RE-purchasing a consumable, let me know if you'd like to know the fix.

Sent from my iPhone

On 2013-03-03, at 5:14 PM, dzbanek notifications@github.com wrote:

Have you fixed this issue? Is anyone working on this lib?

— Reply to this email directly or view it on GitHub.

pzmudzinski commented 11 years ago

Yes, please. Are you recommending this library anyway?

x0661t commented 11 years ago

Would be great if you post fixed lib here

dZbear commented 11 years ago

Here's the link to my modified lib to support re-purchasing : https://dl.dropbox.com/u/96564087/InAppPurchasing/InAppPurchasing.zip

Basically, I added a state in the Finite State Machine for when the item is in the Purchased state, enabling it to go from Purchased to Purchasing again. This does mean that if you have in-app purchases that can only be bought once, you need to make the check in the app layer to make sure the user doesn't buy it twice.

Let me know if that worked for you. Feel free to add me on skype (md_lasalle).

On Mon, Mar 4, 2013 at 5:17 AM, x0661t notifications@github.com wrote:

Would be great if you post fixed lib here

— Reply to this email directly or view it on GitHubhttps://github.com/Bonobolabs/ios-in-app-purchasing/issues/2#issuecomment-14373466 .

pzmudzinski commented 11 years ago

Thanks man, that's great. Could you tell me how are you saving information about products bought by user? What if user delete app and install it again? Let's say user buys consumable inapp purchase (providing 10 potions for example) and you save this info in standardUserDefaults. Then he eats 5 of them, but after that he reinstall app. There's no saved data but you know that he bought 10 potions before from Apple's server. How can I retrieve information about already used 5 of them? Do I need any external server?

x0661t commented 11 years ago

use iCloud for this. Keep your data at *.plist file at iCloud. User purchase coins, you provide him with coins and write it to your plist, than sync it with cloud. On 7 марта 2013, at 00:00, dzbanek notifications@github.com wrote:

Thanks man, that's great. Could you tell me how are you saving information about products bought by user? What if user delete app and install it again? Let's say user buys consumable inapp purchase (providing 10 potions for example) and you save this info in standardUserDefaults. Then he eats 5 of them, but after that he reinstall app. There's no saved data but you know that he bought 10 potions before from Apple's server. How can I retrieve information about already used 5 of them? Do I need any external server?

— Reply to this email directly or view it on GitHub.