From f6183ccd0a677c5dc36aa99fe2f29a1b1bae97a9 Mon Sep 17 00:00:00 2001 From: Vivek Ayer Date: Fri, 19 Feb 2016 15:51:18 -0800 Subject: [PATCH] add two more constructors - adding two constructors that don't involve app id easing xamarin development. --- iOS_SDK/OneSignal/OneSignal.h | 4 ++++ iOS_SDK/OneSignal/OneSignal.m | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/iOS_SDK/OneSignal/OneSignal.h b/iOS_SDK/OneSignal/OneSignal.h index d4ff68fa8..aea54368f 100755 --- a/iOS_SDK/OneSignal/OneSignal.h +++ b/iOS_SDK/OneSignal/OneSignal.h @@ -67,6 +67,10 @@ typedef NS_ENUM(NSUInteger, ONE_S_LOG_LEVEL) { - (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotification:(OneSignalHandleNotificationBlock)callback; +- (id)initWithLaunchOptions:(NSDictionary*)launchOptions handleNotification:(OneSignalHandleNotificationBlock)callback autoRegister:(BOOL)autoRegister; + +- (id)initWithLaunchOptions:(NSDictionary*)launchOptions autoRegister:(BOOL)autoRegister; + - (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotification:(OneSignalHandleNotificationBlock)callback autoRegister:(BOOL)autoRegister; // Only use if you passed FALSE to autoRegister diff --git a/iOS_SDK/OneSignal/OneSignal.m b/iOS_SDK/OneSignal/OneSignal.m index fdfbe2190..e03f8ece7 100755 --- a/iOS_SDK/OneSignal/OneSignal.m +++ b/iOS_SDK/OneSignal/OneSignal.m @@ -114,6 +114,14 @@ - (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId return [self initWithLaunchOptions:launchOptions appId:appId handleNotification:callback autoRegister:true]; } +- (id)initWithLaunchOptions:(NSDictionary*)launchOptions handleNotification:(OneSignalHandleNotificationBlock)callback autoRegister:(BOOL)autoRegister { + return [self initWithLaunchOptions:launchOptions appId:nil handleNotification:callback autoRegister:autoRegister]; +} + +- (id)initWithLaunchOptions:(NSDictionary*)launchOptions autoRegister:(BOOL)autoRegister { + return [self initWithLaunchOptions:launchOptions appId:nil handleNotification:nil autoRegister:autoRegister]; +} + - (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId handleNotification:(OneSignalHandleNotificationBlock)callback autoRegister:(BOOL)autoRegister { self = [super init];