EMMA iOS SDK Integration with UNITY

To install EMMA iOS SDK in a UNITY project, please follow this steps:

  1. Insert the eMMaLibs.zip files into the Unity Plugins / iOS folder, (if no such folders exist, you must create them)

  2. Build the App like a XCode project.

  3. Look for in XCode and open UnityAppController.mm (use the file finder to find it)

  4. Include eMMa.h at first position with the rest of includes:

    #include "eMMa.h"

  5. Find this lines:


    Comment the #if UNITY_USES_REMOTE_NOTIFICATIONS and the #endif. Additionally add the next code lines:

    NSLog(@"my data token is: %@", deviceToken);
    NSString *deviceTokenString = [[[[deviceToken description]
       stringByReplacingOccurrencesOfString: @"<" withString: @""]
       stringByReplacingOccurrencesOfString: @">" withString: @""]
       stringByReplacingOccurrencesOfString: @" " withString: @""];
    NSLog(@"my string token is: %@", deviceTokenString);
    [eMMa registerToken:deviceToken];

    It looks something like this:

  6. Finally look for this function:

    And add the next lines just before the YES return:

    [eMMa setDebuggerOutput:TRUE];
    [eMMa starteMMaSession:@"losjuegosdelaguaOYxHJAQsD"];
    [eMMa startPushSystem:launchOptions];

    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge|UIUserNotificationTypeAlert | UIUserNotificationTypeSound) categories:nil];

    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
    [[UIApplication sharedApplication] registerForRemoteNotifications];

  7. Perfect. Your project is ready to use EMMA
Have more questions? Submit a request


Article is closed for comments.