From 445e5aa04b1e302f7bfb5a524bba6ed52ace23ad Mon Sep 17 00:00:00 2001 From: Ben Marten Date: Wed, 16 Mar 2016 10:52:49 -0700 Subject: [PATCH] updated readme; reorganized imports --- Pod/Classes/SEGLeanplumIntegration.h | 1 + Pod/Classes/SEGLeanplumIntegration.m | 1 - README.md | 28 +++++++++++++++++++++------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Pod/Classes/SEGLeanplumIntegration.h b/Pod/Classes/SEGLeanplumIntegration.h index de1ba6d..108bc3f 100644 --- a/Pod/Classes/SEGLeanplumIntegration.h +++ b/Pod/Classes/SEGLeanplumIntegration.h @@ -7,6 +7,7 @@ #import #import +#import @interface SEGLeanplumIntegration : NSObject diff --git a/Pod/Classes/SEGLeanplumIntegration.m b/Pod/Classes/SEGLeanplumIntegration.m index 930c062..89f3979 100644 --- a/Pod/Classes/SEGLeanplumIntegration.m +++ b/Pod/Classes/SEGLeanplumIntegration.m @@ -6,7 +6,6 @@ // #import "SEGLeanplumIntegration.h" -#import @implementation SEGLeanplumIntegration diff --git a/README.md b/README.md index c2efe85..8f97ebb 100644 --- a/README.md +++ b/README.md @@ -13,24 +13,38 @@ To install the Leanplum Segment integration, simply add this line to your Add the following lines to your AppDelegate or Controller: ```objc - NSString *const SEGMENT_WRITE_KEY = @" ... "; +#import - SEGAnalyticsConfiguration *config = - [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY]; - [config use:[SEGLeanplumIntegrationFactory instance]]; - [SEGAnalytics setupWithConfiguration:config]; +[...] + +@implementation AppDelegate + +NSString *const SEGMENT_WRITE_KEY = @" ... "; + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + SEGAnalyticsConfiguration *config = + [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY]; + [config use:[SEGLeanplumIntegrationFactory instance]]; + [SEGAnalytics setupWithConfiguration:config]; + + return YES; +} ``` Now you can use Segment as you are used to, e.g.: ```objc - [[SEGAnalytics sharedAnalytics] track:@" ... " properties:@{ ... }]; +[[SEGAnalytics sharedAnalytics] track:@" ... "]; ``` In addition to that you can also use the advanced features of Leanplum, e.g.: ```objc - [Leanplum onVariablesChanged: ... ] +[Leanplum onVariablesChanged:^{ + ... +}]; ``` ## Example