InAppPurchase

Preposition: Before you start this tutorial, create an IAP setting in iTune Connect https://itunesconnect.apple.com and Apple Developer https://developer.apple.com or Google Play Dev https://play.google.com/apps/publish/. You need a test user account for IAP app and corresponding provisioning file for iOS and a keystore file for android.
IAP guide Corona lab http://docs.coronalabs.com/daily/guide/monetization/IAP/index.html

Let's create 4 pages

Pages

page0 is the first page. Let's make it blue

page1 has unlock button and restore button

page2 is the page user purchases to unlock viewing. If not purchased, IAP dialog prompts automatically for purchase. The dialog appears by the system so you don't have to create it


The last page3 is completely hidden until user purchases

Kwik

project and pages > In-App project properties

Register a product name and ID by clicking + icon. ID is the one you set in iTune Connect/Manage In App Purchase or Android Developer Console

Unlock Button

page1.psd unlockBtn layer

Restor Button

page1.psd restoreBtn

Page2

page2 is unlocked by user purchase. Open page2.psd and select Project and Page properties. Click In-App Purchse unlock. Click + icon and select a product from the listbox. In App Purchase Unlock is set. If not purchased, redirect to page1

that's all

Build for Device

Code Signing Signature(iOS) or keystore(Android) should be the one for IAP specific. Dont't use normal debug signature or key store.

Test on Device

page0. user swipes to next page

page1 with unlock button and restore button

Swip to page2 will show up a dialog. If not purchased, not open page3.

click unlock button

Purchase dialog

Input the test user account and password

When purchased, user can open page2 and page3

Restore

In order to test restore, uninstall the app after purchased. Re-install again and select restore button.