Overview
Now a day to make app more popular developer has to generate virtual money management in the app in various events of application so that various features of app becomes popular by giving coins for the various events.Using this money developer gives right to convert this virtual money into real money of user can make purcheasing in various app features.Instead of this mecahnism developer can promote various third party apps in his application with the help of this powerful framework and user of his application is able to install,share and refer to these third part applications
MegoUser Demo is app which apply photo effects of camera images and Gallery images.This app is avalable in Play store and its source code avalable on Github.You can take all refrence of source code and how we integrate a power platform of Mego Reward as for the reward generation for various application custom events as well promotion of third party via install,share and referral.In this i represent i will guide you how we can integrate MegoUsers to a App and how this power framework makes virtual currency managment so simple whether
This tutorial is divided into several parts, each focusing on a different aspect of our Mego Grid Demo App. 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.
MegoRewards demo architecture
MegoUser contains some of the helper class for photo editing effect: slideView show all the option in slide view DownloadimageHistoryViewController shows the saved images history, FlipRotate this controller apply rotate images in different direction, UIImage+Filtering and ALAssetsLibrary+CustomPhotoAlbum this two Catagories apply different Effects on the images help content of app.
Getting Started
Authorization
Megogrid uses Authorization Layer for authenticating your application’s user from within the Authorization SDK. You must add Authorization SDK before using any of the Megogrid module. Integrating Authorization SDK in your iOS app
First, we import the following classes in our Appdelegate.m class and to register your app for remote push notification.
#import <MegoAuth/MegoAuthenticate.h> #import <MegoRewards/MRServerModel.h> |
We create an object of above instialize classes.
MegoAuthenticate *megoAuthenticate; MRServerModel *serverModel; |
We initialize the following code with in didFinishWithLaunch.
if( [[NSUserDefaults standardUserDefaults] objectForKey:@“MegoCredentials”] ==nil)
{
serverModel=[[MRServerModel alloc]init];
[serverModel intializeSDK];
megoAuthenticate = [[MegoAuthenticate alloc]init];
[megoAuthenticate Intialize] } else { NSLog(@“MewardAuthenticate user”); } |
ViewController
Firstly use the following code
import <MegoRewards/MRNavgationController.h> @property (strong, nonatomic) MRNavgationController *mRNavgationController; |
To call the following function for use MegoRewards.
_mRNavgationController=[[MRNavgationController alloc]init]; if(indexPath==0) { [ _mRNavgationController campaign:self.navigationController]; } else if(indexPath==1) { [_mRNavgationController history:self.navigationController]; } else if(indexPath==2) { [_mRNavgationController sendGift:self.navigationController]; } else if(indexPath==3) { [_mRNavgationController receiveGift]; } |
Show Campaign
Campaign is third party application promotions which is set on MegoUser CMS panel.It consist of these parameters.In MegoUsers these are following parameter which constitute a Compaign.
- Compaign Banner: Shows the listed compaigns which is configure by devloper on CMS.
- Title: A big banner of third party apps which is going to promote through MegoUser.
- Subtitle: Third party application Name.
- Rewards Points: Total Earning points which a user is going to earn by performing actions on Compaign.
- Actions: It is user behaviour on a particular compaign.Each Compaign is locked with pre defined Actions which a developer set while creation of Comapign on MegoUser CMS.These are below predefined actions which this powerfull framework offered.
- Install: These are promotion type for third party app which performed when user install that particular application on his phone and once the user install that application then user is rewarded.
- Share: These are promotion type for third party app which performed when user share that particular application on his phone and once the user install that application then user is rewarded.
- Two Way Share: These are promotion type for third party app which performed when a friend prmote application to his other friend and when that friend install that application then both sender and receiver earns coins.
- LandingPage: It is page which perform on clicking on compaigns and redirected to a page which acts as a landing page which is constitute by developer on CMS.
SendGift
Send Gifts is mechanism through a user is able to transfer his earned coins to other user. In send gift mechanism there is requirement of mail address to the entity which is going to receive gifts. A referal code will be sent to the email address that you have entered.
ReceiveGift
Receive Gift is a mechanism in which you can earn the coins that another user has transfered to you. You will get the referal code on your email address.Copy the referal code and paste it on the receive gift box shown by the API function.
Custom Actions
Overview
More making more user engagment MegoReward provides reward generation on app through different activity perform by user and by using different features.So every action in the app constitute of following components like
- Events: It is an action or occurrence of an event recognised by megoReward Sdk and performed by user on different-2 places in an app.Each event is bind with a unique id which is generated by MegoReward CMS and use by sdk to identify events uniquely
- Properties: Each event is associated with properties which as two type of values as
- Manual: These values is predefined and unique to every user so these value is set manually while creation of events eg we have to generate a reward on a particular game score then this value is contant to every user
- Dynamic: These value is not predefined and unique to every user so these value is set manually by developer runtime in application and vary with users eg we have to generate reward on user specific target and this target vary with user then these type of value is set to be dynamic
Each property value has following types
- String
- Integer
- Boolean
- Event Actions: These are predefined event action which are fixed on MegoRewards CMS like complete,not complete etc
Triggering Actions
When any event is going to fired we have to trigger the same event in sdk for evalauting whether the rule which is configure on server is matched or not so for this we have trigger action when an camera image is taken by user and apply effects on it and any pic captured from gallery and apply efects on the same as below
EventManager eventManagerObj=[[EventManager allock] init]; NSMutableDictionary *dict = [[NSMutableDictionary alloc]init]; [eventManagerObj handlingOfEventRules:EventIDKey status:“Complete” Dictionary:dict]; MewardActionServerModel *mASM=[[MewardActionServerModel alloc] init]; [mASM processEventSuccess:EventIDKey eventstatus:“Complete” ruleids:eventManagerObj.ruleIdsArray]; |