IAP Testing - Login to store (SOLVED)

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]

Make sure you are completely logged out of the store in settings. Go into your app and try to buy something, you will then be asked to log in at which point enter your test account details. [import]uid: 93133 topic_id: 31464 reply_id: 125741[/import]

Yes, I understand but I’m not asked for login… I’m logged off from store in settings.

In which point should I be asked for login? At store.init or store.purchase?


Testing with Corona sample code I get zero valid products, but my products are set up in iTunes Connect, I’m using Ad Hoc profile as suggested, and my device is added to profile for testing.
What am I doing wrong? [import]uid: 177091 topic_id: 31464 reply_id: 125744[/import]

SOLVED:

The device I was testing on was Jailbraked.

Do not try to test IAP on Jailbraked devices!

Ah… took me 2 days to figure it our. [import]uid: 177091 topic_id: 31464 reply_id: 125817[/import]

Make sure you are completely logged out of the store in settings. Go into your app and try to buy something, you will then be asked to log in at which point enter your test account details. [import]uid: 93133 topic_id: 31464 reply_id: 125741[/import]

Yes, I understand but I’m not asked for login… I’m logged off from store in settings.

In which point should I be asked for login? At store.init or store.purchase?


Testing with Corona sample code I get zero valid products, but my products are set up in iTunes Connect, I’m using Ad Hoc profile as suggested, and my device is added to profile for testing.
What am I doing wrong? [import]uid: 177091 topic_id: 31464 reply_id: 125744[/import]

SOLVED:

The device I was testing on was Jailbraked.

Do not try to test IAP on Jailbraked devices!

Ah… took me 2 days to figure it our. [import]uid: 177091 topic_id: 31464 reply_id: 125817[/import]