Created
January 14, 2017 00:46
-
-
Save mauerbac/8243dce3884b460271a0ca9673f84fae to your computer and use it in GitHub Desktop.
Code snippet for iOS getting started (Objective-C)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.m | |
// iOS Getting Started Guide (Objective C) | |
#import "AppDelegate.h" | |
#import <OptimizelySDKiOS/OptimizelySDKiOS.h> | |
@interface AppDelegate () | |
@end | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
OPTLYManager *manager = [OPTLYManager init:^(OPTLYManagerBuilder * _Nullable builder) { | |
builder.projectId = @"project_id"; | |
}]; | |
[manager initializeWithCallback:^(NSError * _Nullable error, OPTLYClient * _Nullable client) { | |
OPTLYVariation *variation = [client activate:@"my_experiment" userId:@"currentUser"]; | |
[client track:@"my_conversion" userId:@"currentUser"]; | |
}]; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment