Skip to content

Commit

Permalink
updated readme; reorganized imports
Browse files Browse the repository at this point in the history
  • Loading branch information
benmarten committed Mar 16, 2016
1 parent a5116e0 commit 445e5aa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions Pod/Classes/SEGLeanplumIntegration.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#import <Analytics/SEGAnalytics.h>
#import <Foundation/Foundation.h>
#import <Leanplum/Leanplum.h>

@interface SEGLeanplumIntegration : NSObject <SEGIntegration>

Expand Down
1 change: 0 additions & 1 deletion Pod/Classes/SEGLeanplumIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

#import "SEGLeanplumIntegration.h"
#import <Leanplum/Leanplum.h>

@implementation SEGLeanplumIntegration

Expand Down
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <LeanplumSegment/SEGLeanplumIntegrationFactory.h>

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
Expand Down

0 comments on commit 445e5aa

Please sign in to comment.