Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
objects = {

/* Begin PBXBuildFile section */
460FF309299AAEEC00635FF9 /* Segment in Frameworks */ = {isa = PBXBuildFile; productRef = 460FF308299AAEEC00635FF9 /* Segment */; };
464247BC26C6D7A700CAD301 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 464247BB26C6D7A700CAD301 /* AppDelegate.m */; };
464247BF26C6D7A700CAD301 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 464247BE26C6D7A700CAD301 /* SceneDelegate.m */; };
464247C226C6D7A700CAD301 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 464247C126C6D7A700CAD301 /* ViewController.m */; };
464247C526C6D7A700CAD301 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 464247C326C6D7A700CAD301 /* Main.storyboard */; };
464247C726C6D7A800CAD301 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 464247C626C6D7A800CAD301 /* Assets.xcassets */; };
464247CA26C6D7A800CAD301 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 464247C826C6D7A800CAD301 /* LaunchScreen.storyboard */; };
464247CD26C6D7A800CAD301 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 464247CC26C6D7A800CAD301 /* main.m */; };
464247D526C6D7DC00CAD301 /* Segment in Frameworks */ = {isa = PBXBuildFile; productRef = 464247D426C6D7DC00CAD301 /* Segment */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -37,7 +37,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
464247D526C6D7DC00CAD301 /* Segment in Frameworks */,
460FF309299AAEEC00635FF9 /* Segment in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -103,7 +103,7 @@
);
name = ObjCExample;
packageProductDependencies = (
464247D426C6D7DC00CAD301 /* Segment */,
460FF308299AAEEC00635FF9 /* Segment */,
);
productName = ObjCExample;
productReference = 464247B726C6D7A700CAD301 /* ObjCExample.app */;
Expand Down Expand Up @@ -357,7 +357,7 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
464247D426C6D7DC00CAD301 /* Segment */ = {
460FF308299AAEEC00635FF9 /* Segment */ = {
isa = XCSwiftPackageProductDependency;
productName = Segment;
};
Expand Down
2 changes: 2 additions & 0 deletions Examples/apps/ObjCExample/ObjCExample/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
//

#import <UIKit/UIKit.h>
@import Segment;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (nonatomic, retain, nullable) SEGAnalytics *analytics;

@end

10 changes: 6 additions & 4 deletions Examples/apps/ObjCExample/ObjCExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
SEGConfiguration *config = [[SEGConfiguration alloc] initWithWriteKey:@"WRITE_KEY"];
SEGConfiguration *config = [[SEGConfiguration alloc] initWithWriteKey:@"<writekey>"];
config.trackApplicationLifecycleEvents = YES;

SEGAnalytics *analytics = [[SEGAnalytics alloc] initWithConfiguration: config];
_analytics = [[SEGAnalytics alloc] initWithConfiguration: config];

[analytics track:@"test"];
[analytics track:@"testProps" properties:@{@"email": @"[email protected]"}];
[self.analytics track:@"test"];
[self.analytics track:@"testProps" properties:@{@"email": @"[email protected]"}];

[self.analytics flush];

return YES;
}
Expand Down