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

Sometimes in an application developer required to implement some condition on the basis of some events and its associated actions.So on the basis of sucess and failure of these actions app has to generate some condition like informing the user via toast,prompt and push notiifcations and for increase more engagement in the app developer has to give some credits so that app user gives maximum enagement in the app.In any app there are varienty of customs events so to implement these events megoevent framework is very useful like giving credits when a user scored some score in the application.

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.

MegoEvents demo architecture

MegoEvents Demo app contains five main activities: SplashActivity handles the intializes logo delay which around 5 Second,MainActivity shows the effects catagories option whether is from camera and Gallery , PhotoActivity this activity apply different Effects on the images whether it is Capture from Camera or from Gallery,Help it is showing basic help content of app.

Aside from basic functinality we had integrate our MegoGrid Api in differnt section of application

Getting Started


To use the MegoEvents SDK first of all you need to authenticate your application/device with our server. So to authenticate your application/device use the Authentication-Layer SDK and call the below mentioned code in your app launcher Activity.

Integrating Authorization SDK in your IOS app

Inside the application:didFinishLaunchingWithOptions method of your appDelegate class configure MegoAuth SDK .

ActionSdkInitializer *actionSdkInitializer=[[ActionSdkInitializer alloc] init];
[actionSdkInitializer initializeSdkAction];

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


Events is an action which is trigger by an application could be completed a game level or acces any feature and many more.So in event is constitute following entities which makes an event

Tag Type:  Each tags has two types.

Tag Value:  Each tags have three type of value.


Event are nothing untill they associate with rules.Basically rule is combination of events and apply actions on it like push notiifcation and Rewards prompt.So each rule in sdk constitue of following properties :

Rules Actions

For any Rule developer will choose action on particular rule .As in MegoEvent CMS there are two types of events as below

Creating Event in SDK

As in this demo app we have created Events when a user capture images from camera and apply effect on it.

In this demo app we have two events

So we have create two events and for these events we have two events ids and we have two rules when user capture images from camera/gallery and applying effect on it.These are event ids which is generated by MegoEvent cms

public static final String CAMERA_EVENT=“PJYDOH1GJ”; public static final String GALLERY_EVENT=“EIV5FOOO0”;

For integrate rules in MegoEvent sdk we have three steps

1)Create ActionPerformer instance:-First we have to create ActionPerformer instnance for each event whose rules is constitutes.As we have done this in demo application.
In this demo app we have integrate in PhotoActivity applyEffect method as:

MAActionPerformer *mAActionPerformer=[MAActionPerformer sharedActionManager];

2)Next we have to create Event Builder instance.As in our demo we have two event ids and one action then we have to create below code

NSMutableDictionary *dictionary =[[NSMutableDictionary alloc] init];
[mAActionPerformer onActionPerformed:Constant.CAMERA_EFEECT status:@“Complete” Dictionary:dictionary];
NSMutableDictionary *dictionary =[[NSMutableDictionary alloc] init];
[mAActionPerformer onActionPerformed:Constants.GALLERY_EVENT status:@“Complete” Dictionary:dictionary];

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