Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (29 sloc) 2.725 kb
16701ee5 »
2010-03-27 Added license and readme.
1 # Simulated StoreKit
2
3 The sources in this repository simulate Apple's StoreKit framework.
4
5 First of all, this code is available under the CC0 license (which, to be blunt, means it's public domain). Legalities:
6
7 <p xmlns:dct="http://purl.org/dc/terms/" xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#" style="border: 1px solid black; text-align: center">
8 <a rel="license" href="http://creativecommons.org/publicdomain/zero/1.0/">
9 <img src="http://i.creativecommons.org/l/zero/1.0/88x31.png" style="border-style: none;" alt="CC0" />
10 </a>
11 <br />
12 To the extent possible under law, <a href="http://infinite-labs.net/me/" rel="dct:publisher"><span property="dct:title">Emanuele Vulcano</span></a>
13 has waived all copyright and related or neighboring rights to
14 <span property="dct:title">Simulated StoreKit</span>.
15 This work is published from
16 <span about="http://infinite-labs.net/me/" property="vcard:Country" datatype="dct:ISO3166" content="IT">Italy</span>.
17 </p>
18
19 There. Legalities are done. Let's get to it.
20
21 ## What does this do
22
23 This code reimplements the contract of Apple's StoreKit framework exactly, except that it prefixes all classes, protocols and constants with `ILSim` or `kILSim` (constants only). This can be used to test a IAP app in the simulator, for example, or to provide beta testers a IAP-based app without requiring them to have IAP test accounts or make purchases. Sky's the limit.
24
25 Additionally, the ILSimStoreKit.h header includes a set of preprocessor definitions that can be used to switch an app written for StoreKit (using `SK…` symbols) to SimStoreKit transparently.
26
27 ## How to use it
28
29 Write an app that uses StoreKit.
30
31 Where you would import StoreKit, replace:
32
33 #import <StoreKit/StoreKit.h>
34
35 with
36
37 #define ILSimReplaceRealStoreKit 1
38 #import "ILSimStoreKit.h"
39
40 Also make sure you compile all the `.m` files of SimStoreKit in your app, and that all `.h` files are on the headers path. (The easiest way is to simply drag them all into your project, but see the next section for caveats.)
41
42 The library needs to simulate the IAP server using a property list of products, which is set using environment variables (in Xcode, use Project > Edit Active Executable and look in the second tab to set them up). Env variables you can use and the expected format for the products list are documented at the top of `ILSimSKPaymentQueue.h`.
43
44 ## This is for testing only!
45
46 Do not ship apps containing this code! (Duh!) Currently, SimStoreKit does not have a way to remove itself from the build for release builds, so you'll have to make up something on your own (editing the implementation files to have a `#if AllowSimStoreKit` or other preprocessor tricks are probably the way to go).
Something went wrong with that request. Please try again.