NAV

Getting Started

MegoCoin is one of the module of MegoPurchase. So here I am explaining what MegoCoin is and how it works for an IOS App Developer.

Now a days , Mobile Technology is becoming too vast for the ease of the world, keeping the KISS principle (Keep It Short and Simple), Developers are doing their best to make the world Techno Freak. As their time is too precious, Frameworks are being developed to save their time. So while developing application they have certian featuers in thier application for which they want to be only accessible via unlocking or buying it first.

Now I am sure, everybody have some questions in their mind, So lets start knowing What, Why and How? about MegoCoin.

MegoCoinDemo is an app which shows how we have used our MegoCoin module that helps developer to just concentrate on their main application development and makes them free from making such module which will restrict user to access such features before unlocking or buying them. By restricting users we mean they can only access a features only by unlocking or buying it by some means of credit system which is integrated with the application.

This tutorial is divided into several parts, each focusing on a different aspect of our MegoCoin module used in this MegoCoinDemo application. Feel free to read them in any order, but we recommend that you download the source code and refer to it while reading. Some parts of the code were omitted or changed in this tutorial in order to keep it clear and concise, so you may find it useful to keep the full version close at hand.

Overview

As a mobile application developer we all know that while developing app there are certain features for which we want to give only access to the user once they purchased it first. For example if we use any gaming application it has certain free levels to play and certian paid levels. If you already played the free levels and want to play some higher levels which is paid then you must have to unlock/purcase it first.

I know you must be thinking you can make your own such module by your own. But think how much time you have to spend for such module as you have to maintain all the track of your app user, thier application usage details, which feature is unlocked for which user, how many days has been passed since a particular feature was unlock etc. Don’t you think its an headache and time cousuming way to maintain such things along with maintining your own app data.

Keeping all this in mind we have introduce our MegoCoin module which helps and rescue developer to save their time for developing such functionality and let them concentrate on thier app development only.

This module has three types of feature purchase system which have been integared in this demo application. This Demo app will show you how such purchase system works. All the purchase types are desribed below:

Before explaining the details of above mentioned validation types we have to do some configuration settings in applicaitons AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method.The below two code snippets shows how we have configure our Demo app. First code snippet is used to Authenticate user application which is mendatory to call first.

MegoGridServerManager* megoGridServerManager=[[MegoGridServerManager alloc]init];
[megoGridServerManager initialize];

MegoAuthenticate class send notification to MegoGridServerManager that Authentication successful or not. thats why we call first MegoGridServerManager for define Notification Observer.

MegoAuthenticate* megoAuthenticate=[[MegoAuthenticate alloc] init];
[megoAuthenticate initializeMego];

After making these configurations you are ready to call our MegoCoin module API in your app at any part of code that you want to be executed if users already owned that product or feature otherwise they will get the specific purchase prompt and ask them to unlock it by buying it through our built-in credit system. In this demo application we have shown that how we have integrated this module.Below are the detials of purchase types a user will see while unlocking the product.

Permanent

When user click on a feature which is paid he will get a prompt which states “This is a premimum feature. Unlock to explore it!”. Once he clicks the Buy button he will be redirect to the feature purchase screen. On this screen detatils of that feature is metioned like name, credits requires to purchase, child and subchild features (if any it contains) etc. When he clicks on the credit buttons a prompt appears which indicates its a permanent purchase type which means after unlocking it you can use it forever. To integrate such purchae module you just have to call the MegoGridInAppModel’s getFeatureIdStatus() method at the point of your code which allow the access of that feature. This method takes three parameters which are as follows:

Please note you have to inherit the MegoGridInAppModelDelegate in particular class, where you want such validations in your application. Below is the code snippet that shows how I integrated such validation in this demo application:

-(void)megoInAppPro:(NSString*)boxId{
megoGridInAppModel=[[MegoGridInAppModel alloc]initWithNibName:nil bundle:nil];
megoGridInAppModel.customNavigationController=self.navigationController;
megoGridInAppModel.delegate=self;
[megoGridInAppModel getFeatureIdStatus:boxId item:0];
}
-(void)cameraViewClick
{
fromWhere=[@“camera” mutableCopy];
boxid=@“DYZRY1J6W”;
[self megoInAppPro:boxid];
[[NSUserDefaults standardUserDefaults]setValue:@“gallery” forKey:@“ImageType”];
[[NSUserDefaults standardUserDefaults]synchronize];
}
-(void)galleryImageViewClick
{
fromWhere=[@“gallery” mutableCopy];
boxid=@“DYZRY1J6W”;
[self megoInAppPro:boxid];
[[NSUserDefaults standardUserDefaults]setValue:@“gallery” forKey:@“ImageType”];
[[NSUserDefaults standardUserDefaults]synchronize];
}

It is delegate method where you get callback if feature is accessable or in under trail period.

you need to maintain record ,when isAccessGiven delegate give call back to Developer, that particular feature name or type as you can differentiate

as we shown in below code.

-(void)isAccessGiven:(MegoGridInAppModel *)megoGridInAppModel didFinishWithStuff:(NSString *)status
{
if ([fromWhere isEqualToString:@“camera”]) {
[self CameraCalling];
}
else
[self GalleryCalling];
}

Partial

Partial purchase means a feature will be active for a certain period like for a week, month, year etc. once user unlock or purchase it. Once this specified period is over that feature will again get locked. For the implementation part please refer the Permanent purchase section described above.

Subscription

As the heading “subscription” signifies a feature which is based on subscription. Like we subscribe newspaper, paying monthly bill of our cable TV etc. So subscription means paying a fixed amount on some regular intervals. Exactly same concept we have introduced in this module as our third type of purchase.

Once user unlock a feature which is subscription based he will be charged on regualr basis like weeky, monthly, yearly etc. and will continue using that feature until he doesn’t send andy unsubscribe request to us.

Once he sends the unsubscribe request he will not be further charged and will continue to use that feature till his current subscription last. For the implementation part please refer the Permanent purchase section described above.





© 2015-2016 Megogrid Inc. / Term of service / Licenses / Privacy Policy 913 N Market Street Suite 200 Wilmington DE 19801 USA