|
1 | 1 | // |
2 | 2 | // Leanplum.h |
3 | | -// Leanplum iOS SDK Version 1.3.0 |
| 3 | +// Leanplum iOS SDK Version 1.2.8 |
4 | 4 | // |
5 | 5 | // Copyright (c) 2014 Leanplum. All rights reserved. |
6 | 6 | // |
@@ -60,12 +60,19 @@ name = [LPVar define:[@#name stringByReplacingOccurrencesOfString:@"_" withStrin |
60 | 60 | } \ |
61 | 61 | } |
62 | 62 |
|
| 63 | +// Use this code in development mode (or in production), to use the advertising ID. |
| 64 | +// It's useful in development mode so that we remember your device even if you reinstall your app. |
| 65 | +// Since it's a MACRO, this won't get compiled into your app in production, and will be safe |
| 66 | +// to submit to Apple. |
| 67 | +#define LEANPLUM_USE_ADVERTISING_ID [Leanplum setDeviceId:[[[NSClassFromString(@"ASIdentifierManager") \ |
| 68 | + performSelector:NSSelectorFromString(@"sharedManager")] \ |
| 69 | + performSelector:NSSelectorFromString(@"advertisingIdentifier")] \ |
| 70 | + performSelector:NSSelectorFromString(@"UUIDString")]] |
| 71 | + |
63 | 72 | @class LPActionContext; |
64 | 73 |
|
65 | 74 | typedef void (^LeanplumStartBlock)(BOOL success); |
66 | 75 | typedef void (^LeanplumVariablesChangedBlock)(); |
67 | | -typedef void (^LeanplumInterfaceChangedBlock)(); |
68 | | -typedef void (^LeanplumEventsChangedBlock)(); |
69 | 76 | // Returns whether the action was handled. |
70 | 77 | typedef BOOL (^LeanplumActionBlock)(LPActionContext* context); |
71 | 78 | typedef void (^LeanplumRegisterDeviceResponseBlock)(NSString *email); |
@@ -93,18 +100,6 @@ typedef enum { |
93 | 100 | kLeanplumActionKindAction = 0b10, |
94 | 101 | } LeanplumActionKind; |
95 | 102 |
|
96 | | -// What type of device ID to use. |
97 | | -// By default, we use the identifier for vendor. |
98 | | -// However, if you need to link to some third-party attribution frameworks, switch to the |
99 | | -// identifier for advertisers. |
100 | | -typedef enum { |
101 | | - kLeanplumDeviceIdModeAdvertisingIdentifier = 2, |
102 | | - kLeanplumDeviceIdModeVendorIdentifier = 3, |
103 | | - // Default. This is useful if you frequently uninstall the app on your test devices, as |
104 | | - // the device ID doesn't change. |
105 | | - kLeanplumDeviceIdModeVendorIdentifierInProdAndAdvertisingIdentifierInDev = 4 |
106 | | -} LeanplumDeviceIdMode; |
107 | | - |
108 | 103 | @interface Leanplum : NSObject |
109 | 104 |
|
110 | 105 | // Optional. Use these methods to configure Leanplum. |
@@ -137,41 +132,9 @@ typedef enum { |
137 | 132 | + (void)setAppId:(NSString *)appId withDevelopmentKey:(NSString *)accessKey; |
138 | 133 | + (void)setAppId:(NSString *)appId withProductionKey:(NSString *)accessKey; |
139 | 134 |
|
140 | | -// Call this before start if you want to update the UI on the fly with the WYSIWYG editor. |
141 | | -// This would update your UIViewController interfaces and events on viewWillAppear: automatically |
142 | | -// Alternatively, you can do it manually with the two update methods below. |
143 | | -+ (void)syncViews; |
144 | | -// Call this to manually update the UI of your ViewController |
145 | | -// Typically this would be inside the viewWillAppear method of your UIViewController, |
146 | | -// if you didn't call [Leanplum syncViews]. |
147 | | -+ (void)updateViewControllerInterface:(UIViewController *)viewController; |
148 | | -// Call this to manually update the cells of your ViewController tables. |
149 | | -// Typically this would be inside the tableView:cellForRowAtIndexPath: method of your |
150 | | -// UITableViewDataSource, if you didn't call [Leanplum syncViews]. |
151 | | -+ (void)updateInterfaceForViewController:(UIViewController *)viewController |
152 | | - tableView:(UITableView *)tableView |
153 | | - cell:(UITableViewCell *)cell |
154 | | - atIndexPath:(NSIndexPath *)indexPath; |
155 | | -// Call this to manually update the events of your ViewController. |
156 | | -// Typically this would be inside the viewWillAppear method of your UIViewController, |
157 | | -// if you didn't call [Leanplum syncViews]. |
158 | | -+ (void)updateViewControllerEvents:(UIViewController *)viewController; |
159 | | - |
160 | | -// Call this to manually show a view controller interface preview. |
161 | | -// Use this only in a selector passed to [Leanplum addInterfaceChangedResponder:withSelector:] |
162 | | -// or in the block passed to [Leanplum onInterfaceChanged:] |
163 | | -+ (void)showViewControllerInterfacePreview:(UIViewController *)viewController; |
164 | | -// Call this to manually show a preview of updated cells of your ViewController tables. |
165 | | -// Typically this would be inside the tableView:cellForRowAtIndexPath: method of your |
166 | | -// UITableViewDataSource, if you didn't call [Leanplum syncViews]. |
167 | | -+ (void)showInterfacePreviewForViewController:(UIViewController *)viewController |
168 | | - tableView:(UITableView *)tableView |
169 | | - cell:(UITableViewCell *)cell |
170 | | - atIndexPath:(NSIndexPath *)indexPath; |
171 | | - |
172 | | -// Sets what type of device ID to use. |
173 | | -// By default, we use kLeanplumDeviceIdModeVendorIdentifier. |
174 | | -+ (void)setDeviceIdMode:(LeanplumDeviceIdMode)mode; |
| 135 | +// Sets a custom device ID. For example, you may want to pass the advertising ID to do attribution. |
| 136 | +// By default, the device ID is the identifier for vendor. |
| 137 | ++ (void)setDeviceId:(NSString *)deviceId; |
175 | 138 |
|
176 | 139 | // Syncs resources between Leanplum and the current app. |
177 | 140 | // You should only call one of these methods once, and before [Leanplum start]. |
@@ -213,16 +176,6 @@ typedef enum { |
213 | 176 | // that can update in realtime. |
214 | 177 | + (void)onVariablesChanged:(LeanplumVariablesChangedBlock)block; |
215 | 178 |
|
216 | | -// Block to call when the interface receive new values from the server. |
217 | | -// This will be called on start, and also later on if the user is in an experiment |
218 | | -// that can update in realtime. |
219 | | -+ (void)onInterfaceChanged:(LeanplumInterfaceChangedBlock)block; |
220 | | - |
221 | | -// Block to call when the events receive new values from the server. |
222 | | -// This will be called on start, and also later on if the user is in an experiment |
223 | | -// that can update in realtime. |
224 | | -+ (void)onEventsChanged:(LeanplumEventsChangedBlock)block; |
225 | | - |
226 | 179 | // Block to call when no more file downloads are pending (either when |
227 | 180 | // no files needed to be downloaded or all downloads have been completed). |
228 | 181 | + (void)onVariablesChangedAndNoDownloadsPending:(LeanplumVariablesChangedBlock)block; |
@@ -263,14 +216,10 @@ typedef enum { |
263 | 216 | // Similar to the methods above but uses NSInvocations instead of blocks. |
264 | 217 | + (void)addStartResponseResponder:(id)responder withSelector:(SEL)selector; |
265 | 218 | + (void)addVariablesChangedResponder:(id)responder withSelector:(SEL)selector; |
266 | | -+ (void)addInterfaceChangedResponder:(id)responder withSelector:(SEL)selector; |
267 | | -+ (void)addEventsChangedResponder:(id)responder withSelector:(SEL)selector; |
268 | 219 | + (void)addVariablesChangedAndNoDownloadsPendingResponder:(id)responder withSelector:(SEL)selector; |
269 | 220 | + (void)addResponder:(id)responder withSelector:(SEL)selector forActionNamed:(NSString *)actionName; |
270 | 221 | + (void)removeStartResponseResponder:(id)responder withSelector:(SEL)selector; |
271 | 222 | + (void)removeVariablesChangedResponder:(id)responder withSelector:(SEL)selector; |
272 | | -+ (void)removeInterfaceChangedResponder:(id)responder withSelector:(SEL)selector; |
273 | | -+ (void)removeEventsChangedResponder:(id)responder withSelector:(SEL)selector; |
274 | 223 | + (void)removeVariablesChangedAndNoDownloadsPendingResponder:(id)responder withSelector:(SEL)selector; |
275 | 224 | + (void)removeResponder:(id)responder withSelector:(SEL)selector forActionNamed:(NSString *)actionName; |
276 | 225 |
|
|
0 commit comments