Apple
Apple
https://docs.coronalabs.com/guide/monetization/IAP/index.html
Apple Developer Portal
- create a new AppID (not use a wildcard App ID)
- create iOS Provisioning Profiles (development or distribution)
App Store Connect
https://appstoreconnect.apple.com/
Agreements, Tax and Banking
- Contact info
- Banking info
- Tax Info
My Apps
- create a new App with the same Bundle ID as your app in App Developer Portal
Features > Products
-
add IAP products
For instance, IAP products are defined like this
name type product id book01 Non-Consumable com.kwiksher.bookshelf.book01 book02 Non-Consumable com.kwiksher.bookshelf.book02 -
also each product needs screenshot image of 1024x1024 and 960x640
-
fill each filed and price list box with text and value and make it Ready to Submit when saved
Tester Account
-
Add testers for IAP
you can create sandbox tester accounts and build your app with the development profile.
from Users and Rolls > SandBox Testers,
[original] foo@gmail.com
[test accounts]
There seems no way to clear transaction record once the test account purchased an item. You need to create a new test account if you like to start from an initial state.
Don’t sign in iTunes store with a tester account. Once signed in, the account is not treated as SandBox tester any longer.
http://help.apple.com/itunes-connect/developer/#/dev8b997bee1
Notes
iOS does not require an additional settings to build.setting or config.lua
Purchasing Disabled (Apple)
https://docs.coronalabs.com/guide/monetization/IAP/index.html#initialization
store.canMakePurchases is a Solar2D API.
iOS devices have a setting which can disable in-app purchasing entirely. You should use this API to check in advance with external codes if purchasing is allowed and notify the user if it’s forbidden.
Connection error
Sandbox testing would work with devices. Don’t test with XCode’s iOS simulator.
- You find the current logging Apple ID from the Apple’s store app on iPhone\iPad, the bottom of Featured tab. Click it and sign out. Then continue your test with your app.
Even tested with device, the sandbox testing would return “NSURLConnection finished with error - code -1001” or “Cannot connect to iTunes Store”
Solar2D sample
To make sure your settings in iTuneConnect, you can test with InAppPurchase sample of Solar2D
-
SampleCode/Monetization/InAppPurchase
-
In productData.lua, you may set your product IDs and run the sample built with your provisioning profile.
local appleProductList =
{
-- These Product IDs must already be set up in your store
-- We'll use this list to retrieve prices etc. for each item
-- Note, this simple test only has room for about 6 items, please adjust accordingly
-- The iTunes store will not validate bad Product IDs.
"com.anscamobile.NewExampleInAppPurchase.ConsumableTier1",
"com.anscamobile.NewExampleInAppPurchase.NonConsumableTier1",
"com.anscamobile.NewExampleInAppPurchase.SubscriptionTier1",
}