Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

IAP
Started by andrew2212 Sep 27 2018 01:42 PM

1 reply to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

andrew2212

[GLOBAL: userInfoPane.html]
andrew2212
  • Enthusiast

  • 51 posts
  • Corona SDK

Hi,

 

I have my game published to Android, iOS and Kindle.  The IAP is working fine for Android and Kindle.  I thought it was working on iOS correctly but am wrong.  At first I thought this was due to problem with agreements, tax and banking section but I have "Paid Application" with all the info filled out and its past the pending state and has an effective date.

 

I think that I am just not handling iOS code right compared to Android (maybe specifically the way I handle init).  I dont ever call for products or to check if its active but I explain what the person is buying and how much it cost in the GUI I should not have to call products right?  Below is the general code im using.  Any help is immensely appreciated as my app is currently released without this working :( .

local store = require( "store" )
local transactionType

local function transactionListener( event )
  local transaction = event.transaction
  if ( transaction.isError ) then
  else
    if ( transaction.state == "purchased" or transaction.state == "restored" ) then
      if transactionType=="1_coin" then
        actualCoins.text=coinAmount+1
      end
    end
    store.finishTransaction( transaction )
  end
end

store.init( transactionListener )

buy1CoinButton = display.newImageRect( "1Coin.png", 100, 100)

local function buyCoinHandler(event)
  if ( event.phase == "began" ) then
    if event.target == buy1CoinButton then
      transactionType="1_coin"
      store.purchase( "1_coin" )
    end
  end
  return true
end

buy1CoinButton:addEventListener( "touch", buyCoinHandler )


[TOPIC: post.html]
#2

andrew2212

[GLOBAL: userInfoPane.html]
andrew2212
  • Enthusiast

  • 51 posts
  • Corona SDK

This can be disregarded I guess, it just started working.  Wasnt working for sure with 3 people in 3 different countries and today just started to work for all of them.  Maybe because my banking info was approved only a day before posting the question.




[topic_controls]
[/topic_controls]