Quantcast
Channel: LiveCode Forums
Viewing all articles
Browse latest Browse all 821

Talking LiveCode • In-App purchase testing

$
0
0
Hey all,

I am looking to test in-app purchases.

1. I have set up a non-consumable purchase in the app store
2. I have reworded the following code:

In a button:

CODE:

on mouseUp   mobileStoreEnablePurchaseUpdates   mobileStoreSetProductType "com.runrev.sampleapp.nonconsumable" ((changed to "com.mydomain.myapp.myproductID" to match my internal app ID and product ID on Apple Connect)), "inapp"   mobileStoreMakePurchase "com.runrev.sampleapp.nonconsumable" ((changed to "com.mydomain.myapp.myproductID" to match my internal app ID and product ID on Apple Connect)), "1", "This belongs to me"end mouseUp And in the stack script:on purchaseStateUpdate pPurchaseID, pProductID, pState   switch pState      case "paymentReceived"          answer "payment received!"         offerPurchasedProduct pProductID         mobileStoreConfirmPurchase pProductID         mobileStoreDisablePurchaseUpdates         break      case "error"         answer "Error occured during purchase handling:" & return & return & mobileStorePurchaseError(pPurchaseID)         mobileStoreDisablePurchaseUpdates         break      case "invalidSKU"         answer "Invalid SKU."         mobileStoreDisablePurchaseUpdates         break      case "alreadyEntitled"         answer "Already Owned."         mobileStoreDisablePurchaseUpdates         break      case "restored"         answer "restored"         offerPurchasedProduct pProductID         mobileStoreConfirmPurchase pProductID         mobileStoreDisablePurchaseUpdates         break      case "cancelled"         answer "Purchase Cancelled:" && pProductID         mobileStoreDisablePurchaseUpdates         break        end switchend purchaseStateUpdate on offerPurchasedProduct pProductID   if pProductID is "com.runrev.sampleapp.nonconsumable" ((changed to "com.mydomain.myapp.myproductID" to match my internal app ID and product ID on Apple Connect)) then      put "success" into field resultend ifend offerPurchasedProduct
I use a sandbox account that I didn't log into the app store with seperately and first logged in through the app.

But i get:

Error occured during pruchase handling: an unknown error occured.

Any ideas?

Statistics: Posted by Aduro91 — Wed Jan 01, 2025 11:26 pm



Viewing all articles
Browse latest Browse all 821

Trending Articles