Monetization
Monetization
Prepares the project for in-app purchasing and advertisement.

Ads panel
Captures information about ad keys for (depending on the device targets) iOS and/or Android. iAds will work only for iOS devices, while adMob works for both platforms. If both are in use, AdMob will be used only for Android connections.
-
Enable iAds (iOS only): if checked, will show iAds (banner format) in the app (it requires the iTunes Bundle ID below);
- iTunes Bundle ID: it is the app bundle id, created by iTunes Connect;
Apple finished iAds support. It is deprecated.
-
Enable AdMob: if checked, will show adMob ads (banner format) in the app (it requires the adMob Key below);
- Key: it is an unique key the identifies your app in Google’s adMob;
For more information on how to setup your adMob key, check this
-
Add Ads in all pages: if checked, loads and display different banners in all
-
pages of the app;
-
Ad position X: x axis position of the ad in the page;
-
Ad position Y: y axis position of the ad in the page;
-
Important: Ads only show in the devices, not in the Simulator.
In-App Purchase panel

Add icon to add a new product Name&ID

Select icon to select a row of products table. You can delete a selected row with Trash icon
Add icon opens Add New Product dialog

-
Name: enter a name for your product, as set in the appropriated store (we strongly suggest you to have the same product name and id if you are connecting with more than one store);
-
ID: it is the ID created in the appropriated store (this is the string used to get your product from Apple/Google’s store;
Allows you to setup products that can be purchased from the app. It requires to custom the stores you want to connect (Apple and Google Play only at this moment) that are out of the scope of this guide.
Below, a quick overview of the process (an even better document to follow comes from Solar2D Tutorial: Understanding In-App Purchase):
Understanding IAP
IAP is complex mostly because it does not allow you to test your application in the Simulator and, part of the code needs to reside in Apple or Google’s servers. As several “how-tos” mention (see some below), you are going to spend more time working in Apple/Google’s side (configuring profiles, etc) than with Kwik.
Start reading this great walk-through from Troy Brant’s (the code part is not important as Kwik will handle it for you):
Basically you will need to create a Unique App ID
- Create a new provisioning profile
- Add you application to iTunes
- Upload your app binary (even if it is not finished) – you need a binary to create a product
- Add your product(s)
- IAP in Kwik
Kwik4 uses iap_badger from Happy Mongoose Games. It is a good IAP library for Solar2D. Please read this page as well
Solar2D Documents
valid screen shot size in iTune Connect: 960x640 960x600 640x960 640x920 1136x640 1136x600 640x1136 640x1096 2208x1242 1242x2208 1334x750 750x1334 1024x748 768x1024 768x1004 2048x1536 2048x1496 1536x2048 1536x2008
You need a test user account for IAP app and corresponding provisioning file for iOS and a keystore file for android.
As mentioned before, Kwik only works with internal asset purchases. Considering it uses the concept of pages, imagine that some pages will be unlocked only when the user purchase them. You may have a free storybook that allows the reader to read until the middle of the story. To finish it, he/she needs to buy the rest of the pages.
This simple page lock/unlock is Kwik default IAP function. You can lock a page from Page Properties.
Downloadable Sample With IAP Badger
This is advanced programming to enable downloadable contents with IAP.
A sample app consists of three episodes. Episode1 is free, Episode2 and Episode3 are to be payed. Once payed, the image files of Episode2 or Episode3 is downloaded from an Internet server iap_badger is well known library of Solar2D. It supports apple, google and amazon Sample app
this sample uses IAP Badgear so that you can test IAP function with Corona simulator with dummy product IDs.
Further information on IAP configuration and testing is here