Skip to content

Commit fc36c48

Browse files
committed
cleanup
1 parent 3a5f82e commit fc36c48

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

DemoObjCApp/AppDelegate.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ @interface AppDelegate ()
3939
@implementation AppDelegate
4040

4141
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
42-
43-
// most of the third-party integrations only support iOS, so the sample code is only targeted for iOS builds
44-
#if TARGET_OS_IOS
45-
46-
#endif
4742

4843
self.userId = [NSString stringWithFormat:@"%d", arc4random_uniform(300000)];
4944
self.attributes = @{ @"browser_type": @"safari" };
@@ -134,8 +129,13 @@ -(void)initializeOptimizelySDKWithCustomization {
134129
NSDictionary<NSString *,id> *attributes, NSDictionary<NSString *,id> *eventTags, NSDictionary<NSString *,id> *event) {
135130
NSLog(@"Received track notification: %@ %@ %@ %@ %@", eventKey, userId, attributes, eventTags, event);
136131

132+
137133
#if TARGET_OS_IOS
134+
// most of the third-party integrations only support iOS, so the sample code is only targeted for iOS builds
135+
138136
// Amplitude example
137+
[Amplitude.instance initializeApiKey:@"YOUR_API_KEY_HERE"];
138+
139139
NSString *propertyKey = [NSString stringWithFormat:@"[Optimizely] %@", eventKey];
140140
AMPIdentify *identify = [[AMPIdentify alloc] init];
141141
[identify set:propertyKey value:userId];

DemoSwiftApp/AppDelegate.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4242
}
4343

4444
func applicationDidFinishLaunching(_ application: UIApplication) {
45-
// most of the third-party integrations only support iOS, so the sample code is only targeted for iOS builds
46-
#if os(iOS)
47-
Amplitude.instance().initializeApiKey("YOUR_API_KEY_HERE")
48-
#endif
4945

5046
// initialize SDK in one of these two ways:
5147
// (1) asynchronous SDK initialization (RECOMMENDED)
@@ -118,9 +114,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
118114
_ = optimizely.notificationCenter.addTrackNotificationListener(trackListener: { (eventKey, userId, attributes, eventTags, event) in
119115
print("Received track notification: \(eventKey) \(userId) \(String(describing: attributes)) \(String(describing: eventTags)) \(event)")
120116

117+
// most of the third-party integrations only support iOS, so the sample code is only targeted for iOS builds
121118
#if os(iOS)
122-
119+
123120
// Amplitude example
121+
Amplitude.instance().initializeApiKey("YOUR_API_KEY_HERE")
122+
124123
let propertyKey = "[Optimizely] " + eventKey
125124
let identify = AMPIdentify()
126125
identify.set(propertyKey, value: userId as NSObject?)

0 commit comments

Comments
 (0)