Downloadable Contents

  • A sample app consists of three epsodes. Epsode1 is free, Epsode2 and Epsode3 are to be paied.
  • Once paied, the image files of Eposde2 or Epsode3 is downloaded from an Internet server

sample project

Sample app

1 toc.psd table of contents, user to read an epsode or to purchase an epsode free
2 ep01.psd Epsode1 free
3 ep02_info.psd Epsode2 Purchase Infomation free
4 ep02_1 Epsode2-1 paied
5 ep02_2 Epsode2-2 paied
6 ep03 Epsode3 paied

Usecases

Purchase

  • user purchases Epsode2 from toc
  • alternatively user goes to ep02_info by clicking Epsode02Icon on toc.
  • when user pruchased, Epsode2Icon goes to ep02_1 page not to ep02_info

Restore

  • user taps the restore button on toc to recover all
  • The epsode been purchased is to be donwloaded again when user clicks the download button

Preparation

  • copyright.txt

    create a text file and put your copyright message in it. Name it as copyright.txt and put it each image folder of pages.

    • build4/assets/images/p##/

Kwik4 outputs images to build4/assets/images with "p##" folder Where ## is the number of page.

For Epsode02

  • build4/assets/images/p4
  • build4/assets/images/p5
  • zip the image files of Epsode2-1 and Epsode2-2 together as Epsode02/assets.zip. The zip contains copyright.txt and image files.

assets.zip

    assets
        └─images
            ├─p4
            └─p5

For Epsode03

  • build4/assets/images/p6
  • zip the imagefiles of Epsode3 as Epsode03/assets.zip

assets.zip

    assets
        └─images
            └─p6

Put them on a http server for instance,

Project Properties

Please set product name and ID from In-App Purchase from Monetization tab. For instance, Epsode02 pages are p4-p5, startPageNum is 4 and numOfPages is 2 and the infomation page is p3 so that infoPage is 3

  • Product: Epsode02, ID: 4_2_3

    ID :=__

    if infoPage not exist, please make it empty. So Epsode03's ID can be 61

  • Product: Epsode03, ID: 61

soon, I will update Monetization Panel with startPageNum, numOfPages and infoPage field, and each product ID for apple, google and amazon.

With debug mode with these dummy ID, you can test your app with Corna simulator. iap_badger library performs faking purchase with debug mode.

You must edit components/store/model.lua in order to set valid product IDs of apple, google and amazon when building for final app.


toc.psd

Need to create the following layers with the name given because store/UI.lua references to each layer name.

  • restoreBtn
  • purchaseBtn
  • downloadBtn
  • savingTxt
  • savedBtn
  • Epsode01Icon
  • Epsode02Icon
  • Epsode03Icon

Need to create an action from Project and Pages > Action

  • Monetization to add Buy Product Epsode02
  • Monetization to add Buy Product Epsode03


ep02_info.psd

Need to create an action from Project and Pages > Action

  • Monetization to add Buy Product Epsode02

Need to create the following layers with the names below because store/UI.lua references to each layer by name.

  • purchaseBtn
  • downloadBtn
  • savingTxt
  • savedBtn
  • Epsode02Icon
  • hideOverlayBtn

ep01.psd

epsode01 is free to download

Check off prelodng next page at because ep02_1 is paied page, it prevents from showing an alert for purchase when ep01 is loaded

  • preloading off


ep02-1.psd

epsode2 is a paied content

  • preloading off
  • In-App UnlockSet
    • product Epsode02 and redirect to toc page


ep02-2.psd

epsode2 is a paied content

  • Set product Epsode02 and redirect to toc page

ep03.psd

epsode3 is a paied content

  • Set product Epsode03 and redirect to toc page

that's all . Publish and check the behavior with Corona Simulator

results matching ""

    No results matching ""