Registration details contain all of the properties that are related to the SDK registration. The registration details properties are not available until the device is registered.

Registration initially happens within seconds of first launching your mobile app; however, you can obtain MCE registration details in the AppDelegate class by using the following methods.

-(void) aquireIdentification: (NSNotification*)note
{
    NSString * userId = [MCERegistrationDetails userId];
    NSString * channelId = [MCERegistrationDetails channelId];
    MCEConfig * config = [[MCESdk sharedInstance] config];
    NSString * appkey = config.appKey;
}


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(aquireIdentification:) name: @"MCERegisteredNotification" object: nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(aquireIdentification:) name: @"MCERegistrationChangedNotification" object: nil];
}

NSNotification is required if you want to know immediately when the device registers with the MCE servers. You can also query the user ID and channel ID from the registration details.

Tip: The registration details properties are not available until the device is registered. If you want to obtain the registration details and send them to your server, use the observer pattern described.

If you enable file sharing, the user ID and channel ID can be saved to iTunes in a file that is named mce-details.txt. mce-details.txt includes all the information about your environment and configuration, such as the log level, app key, base URL, and session timeout. This information is helpful when you try to debug problems. You can enable file sharing by setting the UIFileSharingEnabled flag to YES in info.plist.

Go Back to the Mobile App Messaging home page.

Join The Discussion

Your email address will not be published. Required fields are marked *