@@ -253,14 +253,31 @@ + (OnFailureHandler)defaultOnFailure:(NSString *)identifier
253253/* !
254254 @method
255255
256- @abstract Initializes Iterable with launchOptions
256+ @abstract creates an iterable session with launchOptions
257257
258- @param apiKey your Iterable apiKey
259- @param email the email of the user logged in
260258 @param launchOptions launchOptions from application:didFinishLaunchingWithOptions
261259
262260 @return an instance of IterableAPI
263261 */
262+ - (instancetype )createSession : (NSDictionary *)launchOptions
263+ {
264+ // the url session doesn't depend on any options/params, so we'll use a singleton that gets created whenever the class is instantiated
265+ // if it gets instantiated again that's fine; we don't need to reconfigure the session, just keep using the old singleton
266+ [self createUrlSession ];
267+
268+ if (launchOptions && launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {
269+ // Automatically try to track a pushOpen
270+ [self trackPushOpen: launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]];
271+ }
272+
273+ return self;
274+ }
275+
276+ // ////////////////////////////////////////////////////////////
277+ // / @name Implementations of things documents in IterableAPI.h
278+ // ////////////////////////////////////////////////////////////
279+
280+ // documented in IterableAPI.h
264281- (instancetype )initWithApiKey : (NSString *)apiKey andEmail : (NSString *)email launchOptions : (NSDictionary *)launchOptions
265282{
266283 if (self = [super init ]) {
@@ -271,17 +288,7 @@ - (instancetype)initWithApiKey:(NSString *)apiKey andEmail:(NSString *)email lau
271288 return [self createSession: launchOptions];
272289}
273290
274- /* !
275- @method
276-
277- @abstract Initializes Iterable with launchOptions
278-
279- @param apiKey your Iterable apiKey
280- @param userId the userId of the user logged in
281- @param launchOptions launchOptions from application:didFinishLaunchingWithOptions
282-
283- @return an instance of IterableAPI
284- */
291+ // documented in IterableAPI.h
285292- (instancetype )initWithApiKey : (NSString *)apiKey andUserId : (NSString *)userId launchOptions : (NSDictionary *)launchOptions
286293{
287294 if (self = [super init ]) {
@@ -291,32 +298,17 @@ - (instancetype)initWithApiKey:(NSString *)apiKey andUserId:(NSString *)userId l
291298 return [self createSession: launchOptions];
292299}
293300
294- /* !
295- @method
296-
297- @abstract creates an iterable session with launchOptions
298-
299- @param launchOptions launchOptions from application:didFinishLaunchingWithOptions
300-
301- @return an instance of IterableAPI
302- */
303- - (instancetype )createSession : (NSDictionary *)launchOptions
301+ // documented in IterableAPI.h
302+ - (instancetype )initWithApiKey : (NSString *)apiKey andEmail : (NSString *)email
304303{
305- // the url session doesn't depend on any options/params, so we'll use a singleton that gets created whenever the class is instantiated
306- // if it gets instantiated again that's fine; we don't need to reconfigure the session, just keep using the old singleton
307- [self createUrlSession ];
308-
309- if (launchOptions && launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {
310- // Automatically try to track a pushOpen
311- [self trackPushOpen: launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]];
312- }
313-
314- return self;
304+ return [self initWithApiKey: apiKey andEmail: email launchOptions: nil ];
315305}
316306
317- // ////////////////////////////////////////////////////////////
318- // / @name Implementations of things documents in IterableAPI.h
319- // ////////////////////////////////////////////////////////////
307+ // documented in IterableAPI.h
308+ - (instancetype )initWithApiKey : (NSString *)apiKey andUserId : (NSString *)userId
309+ {
310+ return [self initWithApiKey: apiKey andUserId: userId launchOptions: nil ];
311+ }
320312
321313// documented in IterableAPI.h
322314+ (IterableAPI *)sharedInstance
0 commit comments