Skip to content

Commit 3b7fbdc

Browse files
authored
Update README.md
1 parent 1af68d8 commit 3b7fbdc

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ After adding the dependency, you must register the integration with our SDK. To
2222
#import <Segment-Amplitude/SEGAmplitudeIntegrationFactory.h>
2323
```
2424

25-
And add the following lines:
25+
And add the following lines if IDFA and/or Location Services are *NOT* needed:
2626

2727
```
2828
NSString *const SEGMENT_WRITE_KEY = @" ... ";
@@ -33,6 +33,29 @@ SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWith
3333
[SEGAnalytics setupWithConfiguration:config];
3434
3535
```
36+
If IDFA or Location Services *ARE* needed:
37+
38+
```
39+
NSString *const SEGMENT_WRITE_KEY = @" ... ";
40+
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY];
41+
42+
SEGAmplitudeIntegrationFactory *factory = [SEGAmplitudeIntegrationFactory instanceWithSetupBlock:^{
43+
amplitude.adSupportBlock = ^{
44+
return [[ASIdentifierManager sharedManager] advertisingIdentifier];
45+
};
46+
amplitude.locationInfoBlock = ^{
47+
return @{
48+
@"lat" : @37.7,
49+
@"lng" : @122.4
50+
};
51+
};
52+
}];
53+
[config use:factory];
54+
55+
[SEGAnalytics setupWithConfiguration:config];
56+
57+
```
58+
3659

3760

3861
## License

0 commit comments

Comments
 (0)