Skip to content

Instantly share code, notes, and snippets.

@aogden
Last active August 29, 2015 14:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aogden/cc28cadfb5ff7dfb3a1a to your computer and use it in GitHub Desktop.
Integration steps for AppMixable iOS SDK

#Appmixable Overview Appmixable creates customized user app experiences through creating and sharing mixes.

#CocoaPods Library AppMixable is available via CocoaPods. Just add this line to your Podfile to install.

pod "AppMixable"

#App Setup Register your new app at www.appmixable.com

Set your new app's ID, public key, private secret, url scheme and name in you info.plist like so: ![Image of info.plist] (http://i.imgur.com/2SRyZlb.png)

Determine a url scheme for your app and add it to your info.plist if you haven't already.

#Code Integration ####In your AppDelegate add:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    //AppMixable will determine if a url is openable and load the mix for that url if it is valid
    return [[APMLifeCycle sharedInstance] openURL:url sourceApplication:sourceApplication annotation:annotation];
}

###Register for our notifications

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleMixLoad:) name:APMMixLoadedNotification object:nil];

###Handle notification

- (void) handleMixLoad:(NSNotification*)notification
{
    APMMixRecord* mixRecord = (APMMixRecord*)[[notification userInfo] objectForKey:APMMixLoadedMixRecordKey];
    if(mixRecord)
    {
        //Customize app with mix object data
    }
}

#Mixes A mix is a shareable Appmixable unit that customizes a user's app experience when loaded.

Mixes are often referred to by their token (i.e. “7k”,”AN”) and a mix url would look like http://www.appm.co/m/7k.

#Lineages A lineage describes the history of iteration for a certain mix. If mix 1b is cast from mix 1a then the mix lineage would be 1a->1b.

The APMLineageTracker will determine if any newer mixes exist in the current loaded mix’s lineage and will try to sync to the latest mix. This process can be interrupted through assigning an APMLineageTrackerDelegate to the APMLineageTracker and returning false for shouldSyncLineageForMix:(APMMixRecord*)mixRecord

#Sample Application Please refer to our sample Hello World application at https://github.com/mosojo/HelloAppMixable for an example of a basic AppMixable integration and mix driven hello world label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment