Skip to content

Commit 77099e7

Browse files
committed
Fixed initialization issue with xib files
* Fixed bug where the app would not initialize with a xib screen.
1 parent 4023fe2 commit 77099e7

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed
2.45 KB
Binary file not shown.

iOS_SDK/OneSignal/OneSignal.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#define DEFAULT_PUSH_HOST @"https://onesignal.com/api/v1/"
3737

38-
NSString* const VERSION = @"010900";
38+
NSString* const VERSION = @"010901";
3939

4040
#define NOTIFICATION_TYPE_BADGE 1
4141
#define NOTIFICATION_TYPE_SOUND 2
@@ -80,7 +80,6 @@ @implementation OneSignal
8080

8181
OneSignalTrackIAP* trackIAPPurchase;
8282

83-
8483
bool registeredWithApple = false; // Has attempted to register for push notifications with Apple.
8584
bool oneSignalReg = false;
8685
bool waitingForOneSReg = false;
@@ -89,7 +88,11 @@ @implementation OneSignal
8988
NSNumber* timeToPingWith;
9089
int mNotificationTypes = -1;
9190
bool mSubscriptionSet = true;
92-
NSString* mSDKType = @"native";
91+
static NSString* mSDKType = @"native";
92+
93+
+ (void)setMSDKType:(NSString*)str {
94+
mSDKType = str;
95+
}
9396

9497
- (id)initWithLaunchOptions:(NSDictionary*)launchOptions {
9598
return [self initWithLaunchOptions:launchOptions appId:nil handleNotification:nil autoRegister:true];
@@ -1229,11 +1232,15 @@ + (void)load {
12291232
static Class delegateClass = nil;
12301233

12311234
- (void) setOneSignalDelegate:(id<UIApplicationDelegate>)delegate {
1232-
if(delegateClass != nil)
1233-
return;
1235+
if (delegateClass != nil) {
1236+
[self setOneSignalDelegate:delegate];
1237+
return;
1238+
}
1239+
12341240

12351241
delegateClass = getClassWithProtocolInHierarchy([delegate class], @protocol(UIApplicationDelegate));
12361242

1243+
12371244
injectSelector(self.class, @selector(oneSignalRemoteSilentNotification:UserInfo:fetchCompletionHandler:),
12381245
delegateClass, @selector(application:didReceiveRemoteNotification:fetchCompletionHandler:));
12391246

0 commit comments

Comments
 (0)