Steps

Steps

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

M.debug     = false

M.episodes = {
            book01  ={name = "book01", dir = "book01", numOfPages = 6, info = "test", versions ={  }},
            book02  ={name = "book02", dir = "book02", numOfPages = 2, info = "test", versions ={  }},
    }
--
M.catalogue = {
    products = {
            book01 = {
            productNames = { apple="com.kwiksher.bookshelf.book01", google="com.kwiksher.bookshelf.book01", amazon=""},
            productType  = "non-consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_book01") end,
            onRefund     = function() IAP.removeFromInventory("unlock_book01") end,
        },
            book02 = {
            productNames = { apple="com.kwiksher.bookshelf.book02", google="book02", amazon=""},
            productType  = "consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_book02") end,
            onRefund     = function() IAP.removeFromInventory("unlock_book02") end,
        },
    },

Debug mode

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

fo instance, book01 and book02 are set

M.debug     = true

M.catalogue = {
    products = {
            book01 = {
            productNames = { apple="book01", google="book01", amazon="book01"},
            productType  = "non-consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_book01") end,
            onRefund     = function() IAP.removeFromInventory("unlock_book01") end,
        },
            book02 = {
            productNames = { apple="book02", google="book02", amazon="book02"},
            productType  = "non-consumable",
            onPurchase   = function() IAP.setInventoryValue("unlock_book02") end,
            onRefund     = function() IAP.removeFromInventory("unlock_book02") 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.