In app purchases.

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

In app purchases.

Post by Kaubs » Tue Nov 01, 2011 5:46 pm

Has anyone made an in app purchase with LC 5 yet?

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: In app purchases.

Post by Kaubs » Thu Nov 10, 2011 11:28 pm

Is this close to what things should look like?

Code: Select all

   //enable purchase updates to be pushed to the phone
   mobileEnablePurchaseUpdates
   //checks to see if purchases can be made
   mobileCanMakePurchase
   return it
   //create a purchase 
   mobilePurchaseCreate newprod
   //send a purchase request
   mobilePurchaseSendRequest newprod
   //check the status of the purchase
   mobilePurchaseState(newprod)
   //check for an update to the purchase request
   purchaseStateUpdate newprod
   return it
   //return content delivery confirmation to appstore
   mobilePurchaseConfirmDelivery newprod
   return it
   mobileDisablePurchaseUpdates

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: In app purchases.

Post by bn » Thu Nov 10, 2011 11:31 pm

Hi Kaubs,

you might have a look at:

http://lessons.runrev.com/m/4069/l/48771

Kind regards

Bernd

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: In app purchases.

Post by Kaubs » Thu Nov 10, 2011 11:34 pm

You rock, I feel like an idiot. Lol thanks!

bleddy
Posts: 8
Joined: Wed Jan 17, 2007 2:51 am

Re: In app purchases.

Post by bleddy » Thu Jan 19, 2012 8:32 pm

bn wrote:Hi Kaubs,

you might have a look at:

[link to in app purchase lesson]

Kind regards

Bernd
This lesson seems to cover it well, but I have a question that I hope someone can help me with.

If a user deletes the app that was used to make a purchase, then reloads it. I assume the text file described in the lesson is no longer there. What is a good strategy for retrieving the purchases for a customer in that case?

I'm thinking some thing like:

Code: Select all

If extra features not purchased then
   connect to remote host and query purchase
   update purchase history
end if
Should work, I think but I would much prefer a self contained solution.

Thanks for any advise or comments.

Bill

Edit: Looks like I need to do more research... Looks like maybe the mobilePurchases() function will return a list of the features that have already been purchased.

Post Reply