科罗纳 SDK IAP 不确定如何解锁物品



我正在使用电晕软件开发工具包编写我的应用程序,并正在尝试在应用程序中实施IAP。我正在使用 http://coronalabs.com/blog/2013/09/03/tutorial-understanding-in-app-purchases/中的示例代码

我没有得到的是:

local function removeAds( event )
   if event.phase == "began" then
      event.target:setFillColor(224)
   elseif event.phase == "ended" then
      event.target:setFillColor(255)
      if system.getInfo("targetAppStore") == "amazon" or system.getInfo("targetAppStore") == "google" then
         store.purchase( "com.acme.superrunner.upgrade" )
      else
         store.purchase( { "com.acme.superrunner.upgrade" } )
      end
   end
   return true
end
local buyBtn = display.newImageRect("images/buy_button.png", 614, 65)
group:insert( buyBtn )
buyBtn.x = display.contentCenterX - 465
buyBtn.y = 430
buyBtn:addEventListener( "touch", removeAds )

com.acme.superrunner.upgrade在main.lua或utilities.lua文件中从未提及。我错过了什么吗,store.purchase( { "com.acme.superrunner.upgrade" } ) 如何等同于游戏中实际解锁的东西。非常感谢您的任何帮助!我需要另一个IAP文件或其他东西吗?

com.acme.superrunnerupgrade 表示您希望开始购买的商店项目的 ID。这通常在商店(Google Play,Apple,Amazon)配置中配置。

在商店中配置物品/奖励后,启动对该商品的购买会将您的用户带到相应的商店商品并执行付款过程。

如果付款完成,手机上的iTunes将激活您的应用程序/游戏,并调用回调函数。

适用于 IOS 的应用程序内购买使用 iTunes Connect 进行设置。您可以在以下链接上阅读有关该过程的信息:https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnectInAppPurchase_Guide/Chapters/Introduction.html

最新更新