Hi,
i’m testing IAP on my Iphone and I’m not seeing login to store screen.
If I try to login to my store test account in ‘Settings’ I need to review my account which I can’t because it is only a test account (no credit card)
Using the code below I get an error: “Transaction failed, type: Unknown, Cannon connect to Itunes Store.”
I also tried using sample code, and then I can’t load products (I get “this device doesn’t support IAP” error) probaby because I’m not logged in with my test account.
Tnx for any suggestions.
[code]
---------------------------IAP--------------------------------
–produkti za apple store
local appleProductList =
{
–HIDDEN
}
–produkti za google store
local googleProductList =
{
“android.test.purchased”,
“android.test.canceled”,
“android.test.item_unavailable”,
}
function transactionCallback( event )
local infoString
if event.transaction.state == “purchased” then
–BUY LOGIC / DATABASE
elseif event.transaction.state == “restored” then
– RESTORE LOGIC / DATABASE
elseif event.transaction.state == “cancelled” then
infoString = “Transaction cancelled by user!”
elseif event.transaction.state == “failed” then
infoString = “Sorry, transaction failed!”
–zakomentirati
infoString = "Transaction failed, type: " …
tostring(event.transaction.errorType) … " " … tostring(event.transaction.errorString)
else
infoString = “Sorry, unknown transaction event!”
end
native.showAlert( “Transaction info”, infoString, { “OK” } )
store.finishTransaction( event.transaction )
end
–inicijalizacija store-a
if store.availableStores.apple then
currentProductList = appleProductList
store.init(“apple”, transactionCallback)
elseif store.availableStores.google then
currentProductList = googleProductList
store.init(“google”, transactionCallback)
else
native.showAlert( “Store Inicialization Error”, “In-app purchases are not supported on this system / device.”, { “OK” } )
end
local function buyItemOnStore(cijenaVoce)
local productId = nil
if (cijenaVoce == 20000) then
productId = currentProductList[1]
end
if (cijenaVoce == 50000) then
productId = currentProductList[2]
end
if (cijenaVoce == 200000) then
productId = currentProductList[3]
end
if (cijenaVoce == 350000) then
productId = currentProductList[4]
end
if (cijenaVoce == 700000) then
productId = currentProductList[5]
end
if store.canMakePurchases then
store.purchase( {productId} )
else
native.showAlert(“Store Error”, “Store purchases are not available, please try again later!”, { “OK” } )
end
end
---------------------------IAP--------------------------------
[/code] [import]uid: 177091 topic_id: 31464 reply_id: 331464[/import]