Legacy iOS Authentication
Deprecated — do not use for new games
Legacy iOS SDK is in maintenance-only mode and will be removed. New games must use SDK v2 Authentication.
The legacy iOS SDK uses OEGManager as the public entry point for account and profile flows.
Show login
#import <OEGFramework/OEGManager.h>
[[OEGManager sharedManager] showLoginWithViewController:self callback:^(OEGActionType type, id response, BOOL success, NSError *error) {
if (success) {
NSLog(@"Action: %ld", (long)type);
NSLog(@"Token: %@", [OEGManager getAPIToken]);
NSLog(@"UUID: %@", [OEGManager getAPIUUID]);
} else {
NSLog(@"Login failed: %@", error.localizedDescription);
}
}];
If you do not want to pass an explicit presenter:
[[OEGManager sharedManager] showLoginWithCallback:callback];
Read current session
NSString *token = [OEGManager getAPIToken];
NSString *uuid = [OEGManager getAPIUUID];
BOOL isPlayNow = [OEGManager isPlayNow];
Show profile
[[OEGManager sharedManager] showProfileWithViewController:self callback:^(OEGActionType type, id response, BOOL success, NSError *error) {
if (success) {
NSLog(@"Profile updated");
}
}];
Change password
[[OEGManager sharedManager] showChangePasswordWithViewController:self callback:^(OEGActionType type, id response, BOOL success, NSError *error) {
if (success) {
NSLog(@"Password changed");
}
}];
Logout
[[OEGManager sharedManager] logout];
Refresh remote config
[OEGManager fetchRemoteConfig];
The framework also posts OEG_REMOTE_CONFIG_UPDATED when remote config changes affect the SDK UI.
Notes
showLogin...can return immediately with success if the SDK already has a cached token and UUID.isPlayNowindicates whether the active account is a guest account.- Existing games should continue using
OEGManagerrather than mixing this flow with the v2 Swift API.