Skip to content

Commit f43ae88

Browse files
committed
2 parents f557824 + 2c038c3 commit f43ae88

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

iOS_SDK/OneSignal/OneSignal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ typedef OSNotificationDisplayType OSInFocusDisplayOption;
150150
requires remote-notification within UIBackgroundModes array of the Info.plist */
151151
@property(readonly, getter=isSilentNotification)BOOL silentNotification;
152152

153-
/* iOS 10+: Indicates wether or not the received notification has mutableContent : 1 assigned to its payload
153+
/* iOS 10+: Indicates whether or not the received notification has mutableContent : 1 assigned to its payload
154154
Used for UNNotificationServiceExtension to launch extension.
155155
*/
156156
#if XC8_AVAILABLE
@@ -177,7 +177,7 @@ typedef OSNotificationDisplayType OSInFocusDisplayOption;
177177
typedef void (^OSResultSuccessBlock)(NSDictionary* result);
178178
typedef void (^OSFailureBlock)(NSError* error);
179179

180-
/*Block for notifying avalability of the User's ID and push token*/
180+
/*Block for notifying availability of the User's ID and push token*/
181181
typedef void (^OSIdsAvailableBlock)(NSString* userId, NSString* pushToken);
182182

183183
/*Block for handling the reception of a remote notification */
@@ -186,9 +186,9 @@ typedef void (^OSHandleNotificationReceivedBlock)(OSNotification* notification);
186186
/*Block for handling a user reaction to a notification*/
187187
typedef void (^OSHandleNotificationActionBlock)(OSNotificationOpenedResult * result);
188188

189-
/*Dictionary of keys to pass alongside the init serttings*/
189+
/*Dictionary of keys to pass alongside the init settings*/
190190

191-
/*Let OneSignal directly promt for push notifications on init*/
191+
/*Let OneSignal directly prompt for push notifications on init*/
192192
extern NSString * const kOSSettingsKeyAutoPrompt;
193193

194194
/*Enable the default in-app alerts*/
@@ -198,7 +198,7 @@ extern NSString * const kOSSettingsKeyInAppAlerts;
198198
extern NSString * const kOSSettingsKeyInAppLaunchURL;
199199

200200
/* iOS10+ -
201-
Set notificaion's in-focus display option.
201+
Set notification's in-focus display option.
202202
Value must be an OSNotificationDisplayType enum
203203
*/
204204
extern NSString * const kOSSettingsKeyInFocusDisplayOption;

iOS_SDK/OneSignal/OneSignal.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ + (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId
240240

241241
if (mUserId != nil)
242242
[self registerUser];
243-
else // Fall back incase Apple does not responsed in time.
243+
else // Fall back in case Apple does not responds in time.
244244
[self performSelector:@selector(registerUser) withObject:nil afterDelay:30.0f];
245245

246246
[OneSignalTracker onFocus:NO];
247247
}
248248

249249
/*
250-
* No need to call the handleNotificationOpened:userInfo as it will be called from one of the folloing selectors
250+
* No need to call the handleNotificationOpened:userInfo as it will be called from one of the following selectors
251251
* - application:didReceiveRemoteNotification:fetchCompletionHandler
252252
* - userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler (iOS10)
253253
*/
@@ -627,8 +627,8 @@ + (void)updateDeviceToken:(NSString*)deviceToken onSuccess:(OSResultSuccessBlock
627627
tokenUpdateSuccessBlock = successBlock;
628628
tokenUpdateFailureBlock = failureBlock;
629629

630-
// iOS 8 - We get a token right away but give the user 30 sec to responsed to the system prompt.
631-
// Also check notifiation types so there is no waiting if user has already answered the system prompt.
630+
// iOS 8 - We get a token right away but give the user 30 sec to respond to the system prompt.
631+
// Also check notification types so there is no waiting if user has already answered the system prompt.
632632
// The goal is to only have 1 server call.
633633
if ([OneSignalHelper isCapableOfGettingNotificationTypes] && [[UIApplication sharedApplication] currentUserNotificationSettings].types == 0) {
634634
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(registerUser) object:nil];
@@ -819,7 +819,7 @@ + (void)registerUser {
819819
waitingForOneSReg = false;
820820
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:[NSString stringWithFormat: @"Error registering with OneSignal: %@", error]];
821821

822-
//If the failed regiatration is priority, force the next one to be a high priority
822+
//If the failed registration is priority, force the next one to be a high priority
823823
nextRegistrationIsHighPriority = YES;
824824
}];
825825
}
@@ -945,7 +945,7 @@ + (void)notificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isActive {
945945
// Call Received Block
946946
[OneSignalHelper handleNotificationReceived:iaaoption];
947947

948-
// Notify backend that user opened the notifiation
948+
// Notify backend that user opened the notification
949949
NSString* messageId = [customDict objectForKey:@"i"];
950950
[OneSignal submitNotificationOpened:messageId];
951951
}
@@ -994,7 +994,7 @@ + (void) handleNotificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isAc
994994
if (customDict == nil)
995995
customDict = [messageDict objectForKey:@"custom"];
996996

997-
// Notify backend that user opened the notifiation
997+
// Notify backend that user opened the notification
998998
NSString* messageId = [customDict objectForKey:@"i"];
999999
[OneSignal submitNotificationOpened:messageId];
10001000

@@ -1019,8 +1019,8 @@ + (void)launchWebURL:(NSString*)openUrl {
10191019

10201020
if (openUrl && [OneSignalHelper verifyURL:openUrl]) {
10211021
NSURL *url = [NSURL URLWithString:openUrl];
1022-
// Give the app resume animation time to finish when tapping on a notificaion from the notificaiton center.
1023-
// Isn't a requiremnt but improves visual flow.
1022+
// Give the app resume animation time to finish when tapping on a notification from the notification center.
1023+
// Isn't a requirement but improves visual flow.
10241024
[OneSignalHelper performSelector:@selector(displayWebView:) withObject:url afterDelay:0.5];
10251025
}
10261026

@@ -1063,9 +1063,9 @@ + (BOOL) clearBadgeCount:(BOOL)fromNotifOpened {
10631063
bool wasBadgeSet = [UIApplication sharedApplication].applicationIconBadgeNumber > 0;
10641064

10651065
if ((!(NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) && fromNotifOpened) || wasBadgeSet) {
1066-
// Clear badges and nofiications from this app.
1066+
// Clear badges and notifications from this app.
10671067
// Setting to 1 then 0 was needed to clear the notifications on iOS 6 & 7. (Otherwise you can click the notification multiple times.)
1068-
// iOS 8+ auto dismisses the notificaiton you tap on so only clear the badge (and notifications [side-effect]) if it was set.
1068+
// iOS 8+ auto dismisses the notification you tap on so only clear the badge (and notifications [side-effect]) if it was set.
10691069
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
10701070
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
10711071
}
@@ -1133,7 +1133,7 @@ + (BOOL) remoteSilentNotification:(UIApplication*)application UserInfo:(NSDictio
11331133
if (userInfo[@"os_data"][@"buttons"] || userInfo[@"at"] || userInfo[@"o"])
11341134
data = userInfo;
11351135

1136-
// Genergate local notification for action button and/or attachments.
1136+
// Generate local notification for action button and/or attachments.
11371137
if (data) {
11381138
if (NSClassFromString(@"UNUserNotificationCenter")) {
11391139
startedBackgroundJob = true;
@@ -1166,7 +1166,7 @@ + (BOOL) remoteSilentNotification:(UIApplication*)application UserInfo:(NSDictio
11661166
return startedBackgroundJob;
11671167
}
11681168

1169-
// iOS 8-9 - Entry point when OneSignal action button notifiation is displayed or opened.
1169+
// iOS 8-9 - Entry point when OneSignal action button notification is displayed or opened.
11701170
+ (void)processLocalActionBasedNotification:(UILocalNotification*) notification identifier:(NSString*)identifier {
11711171
if (notification.userInfo) {
11721172

@@ -1232,9 +1232,9 @@ + (void)syncHashedEmail:(NSString *)email {
12321232
// - For iOS 10 only, swizzle all UNUserNotificationCenterDelegate selectors on the passed in class.
12331233
// - This may or may not be set so we set our own now in registerAsUNNotificationCenterDelegate to an empty class.
12341234
//
1235-
// Note1: Do NOT move this category to it's own file. This is requried so when the app developer calls OneSignal.initWithLaunchOptions this load+
1235+
// Note1: Do NOT move this category to it's own file. This is required so when the app developer calls OneSignal.initWithLaunchOptions this load+
12361236
// will fire along with it. This is due to how iOS loads .m files into memory instead of classes.
1237-
// Note2: Do NOT directly add swizzled selectors to this category as if this class is loaded into the runtime twice unexpected results will orcur.
1237+
// Note2: Do NOT directly add swizzled selectors to this category as if this class is loaded into the runtime twice unexpected results will occur.
12381238
// The oneSignalLoadedTagSelector: selector is used a flag to prevent double swizzling if this library is loaded twice.
12391239
@implementation UIApplication (OneSignal)
12401240
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

iOS_SDK/OneSignal/OneSignalTrackIAP.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ - (id)init {
5757
return self;
5858
}
5959

60+
- (void)dealloc {
61+
if (skPaymentQueue) {
62+
[[skPaymentQueue performSelector:@selector(defaultQueue)] performSelector:@selector(removeTransactionObserver:) withObject:self];
63+
}
64+
}
65+
6066
- (void)paymentQueue:(id)queue updatedTransactions:(NSArray*)transactions {
6167
skusToTrack = [NSMutableDictionary new];
6268
id skPayment;

0 commit comments

Comments
 (0)