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
8181OneSignalTrackIAP* trackIAPPurchase;
8282
83-
8483bool registeredWithApple = false ; // Has attempted to register for push notifications with Apple.
8584bool oneSignalReg = false ;
8685bool waitingForOneSReg = false ;
@@ -89,7 +88,11 @@ @implementation OneSignal
8988NSNumber * timeToPingWith;
9089int mNotificationTypes = -1 ;
9190bool 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 {
12291232static 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