Giter Site home page Giter Site logo

rpstro02 / mkstorekit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mugunthkumar/mkstorekit

0.0 2.0 0.0 136 KB

In-App Purchases StoreKit for iOS devices

Home Page: http://blog.mugunthkumar.com/coding/mkstorekit-4-0-supporting-auto-renewable-subscriptions

mkstorekit's Introduction

#MKStoreKit

This is version 5 of MKStoreKit. iOS 5+ only and requires zeroing weak referencing environment. No support for non-ARC compilers. MKStoreKit 5 is not API compatible with MKStoreKit 4. Dont' expect it to work out of the box if you are updating from a previous version. Refactoring should however be a simple 5 minute work. I'm working on In App Purchase hosted content support on iOS 6. It's implemented, but for some apparent reason, download doesn't happen. I've raised a support ticket to Apple.

JSONKit is removed in favour of NSJSONSerialization (Removes 20+ warnings)

The MKStoreObserver class is removed as a part of refactoring. MKStoreKit 5 is the leanest release ever after 1.0

The source code, MKStoreKit, contains several new objective c files notably MKStoreKitConfigs.h among others like, MKStoreManager.h/m and MKStoreObserver.h/m and five server side files. The MKStoreManager is a singleton class that takes care of everything. Just include StoreKit.Framework and Security.Framework into your product and drag these four files into the project. You then have to initialize it by calling [MKStoreManager sharedManager] in your applicationDidFinishLaunching. From then on, it does the magic. The MKStoreKit automatically activates/deactivates features using your userDefaults. When a feature is purchased, it automagically records it into NSUserDefaults. For checking whether the user has purchased the feature, you can call a function like,

if([MKStoreManager isFeaturePurchased:kFeatureID])
{
//unlock it
}
if([MKStoreManager isSubscriptionActive:kFeatureID])
{
//unlock it
}

To purchase a feature, just call

[[MKStoreManager sharedManager] buyFeature:kFeatureAId 
                                onComplete:^(NSString* purchasedFeature, 
                                             NSData* purchasedReceipt, 
                                             NSArray* availableDownloads)
 {
     NSLog(@"Purchased: %@", purchasedFeature);
 }
                               onCancelled:^
 {
     NSLog(@"User Cancelled Transaction");
 }];

It’s that simple with my MKStoreKit.

License

MKStoreKit uses MIT Licensing And so all of my source code can be used royalty-free into your app. Just make sure that you don’t remove the copyright notice from the source code if you make your app open source and in the about page.

Server Side

The database required can be created from the sql file attached.

The code that you need for setting up your server is present in the ServerCode folder.

Copy all the files to some location like http://api.mycompany.com/inapp/

The URL which you should copy to "ownServer" variable in MKStoreManager.m is http://api.mycompany.com/inapp/featureCheck.php Copy this URL to ownServer parameter in MKStoreManager.m

mkstorekit's People

Contributors

bmateus avatar bobbypage avatar darktable avatar dfabulich avatar eric-sofisoftwarellc avatar iosdeveloper avatar jyap808 avatar l4u avatar macarse avatar marzapower avatar mugunthkumar avatar pluton8 avatar yas375 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.