Skip to content

Commit 72c1437

Browse files
committed
Consolidate helper method into one place
* The method `trimURLSpacing` is defined in both OneSignalCoreHelper and OneSignalAttachmentHandler * Let's just use it in one place, the OneSignalCoreHelper, as this method is also used elsewhere.
1 parent 8f859e5 commit 72c1437

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

iOS_SDK/OneSignalSDK/OneSignalExtension/OneSignalAttachmentHandler.m

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ + (void)addAttachments:(OSNotification*)notification
209209
let unAttachments = [NSMutableArray new];
210210

211211
for(NSString* key in notification.attachments) {
212-
let URI = [OneSignalAttachmentHandler trimURLSpacing:[notification.attachments valueForKey:key]];
212+
let URI = [OneSignalCoreHelper trimURLSpacing:[notification.attachments valueForKey:key]];
213213

214214
let nsURL = [NSURL URLWithString:URI];
215215

@@ -306,14 +306,6 @@ + (UNNotificationAction *)createActionForButton:(NSDictionary *)button {
306306
}
307307
}
308308

309-
+ (NSString*)trimURLSpacing:(NSString*)url {
310-
if (!url)
311-
return url;
312-
313-
return [url stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
314-
}
315-
316-
317309
/*
318310
Synchroneously downloads an attachment
319311
On success returns bundle resource name, otherwise returns nil

0 commit comments

Comments
 (0)