Steps

Steps

Kwik publishes it to build4/components/store/model.lua

M.debug     = false

M.episodes = {
            Episode02  ={name = "Episode02", startPage = 4, dir = "assets/images/p4", numOfPages = 2, info = "3"},
            Episode03  ={name = "Episode03", startPage = 6, dir = "assets/images/p6", numOfPages = 1, info = ""},
    }
--
M.catalogue = {
    products = {
            Episode02 = {
            productNames = { apple="com.kwiksher.bookshelf.episode02", google="com.kwiksher.bookshelf.episode02", amazon=""},
            productType  = "non-consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_Episode02") end,
            onRefund     = function() IAP.removeFromInventory("unlock_Episode02") end,
        },
            Episode03 = {
            productNames = { apple="com.kwiksher.bookshelf.episode03", google="com.kwiksher.bookshelf.episode03", amazon=""},
            productType  = "non-consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_Episode03") end,
            onRefund     = function() IAP.removeFromInventory("unlock_Episode03") end,
        },
    },

Debug mode

When you test it with debug as true for IAP on corona simulator. You need to set the episode names as dummies for the productNames. Don’t use the official product names from apple, google or amazon. With offcial IDs, debug mode fails to return an episode name and IAP not work correctly.

fo instance, Episode02 and Episode03 are set

M.debug     = true
...
...
M.catalogue = {
    products = {
            Episode02 = {
            productNames = { apple="Episode02", google="", amazon=""},
            productType  = "non-consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_Episode02") end,
            onRefund     = function() IAP.removeFromInventory("unlock_Episode02") end,
        },
            Episode03 = {
            productNames = { apple="Episode03", google="", amazon=""},
            productType  = "non-consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_Episode03") end,
            onRefund     = function() IAP.removeFromInventory("unlock_Episode03") end,
        },
    },

build.settings

iOS

if you use http server instead of https, please set your domain in build.settings

NSExceptionDomains

https://docs.coronalabs.com/guide/hardware/appleATS/index.html

Android

To do so, please enable expansion file and set the license key from goggle. Then config.lua and build.settings will be configured when publishing with Kwik

project properties > Advanced Settings.