File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
iOS_SDK/OneSignalSDK/Source Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1287,9 +1287,10 @@ + (void)handleNotificationOpened:(NSDictionary*)messageDict
12871287}
12881288
12891289+ (void )launchWebURL : (NSString *)openUrl {
1290-
1291- if (openUrl && [OneSignalHelper verifyURL: openUrl]) {
1292- NSURL *url = [NSURL URLWithString: openUrl];
1290+ NSString * toOpenUrl = [OneSignalHelper trimURLSpacing: openUrl];
1291+
1292+ if (toOpenUrl && [OneSignalHelper verifyURL: toOpenUrl]) {
1293+ NSURL *url = [NSURL URLWithString: toOpenUrl];
12931294 // Give the app resume animation time to finish when tapping on a notification from the notification center.
12941295 // Isn't a requirement but improves visual flow.
12951296 [OneSignalHelper performSelector: @selector (displayWebView: ) withObject: url afterDelay: 0.5 ];
Original file line number Diff line number Diff line change 7878+ (NSString *)hashUsingMD5 : (NSString *)string ;
7979+ (void )addAttachments : (NSDictionary *)attachments toNotificationContent : (id )content ;
8080+ (void )addActionButtons : (NSArray *)buttonsPayloadList toNotificationContent : (id )content ;
81+ + (NSString *)trimURLSpacing : (NSString *)url ;
8182
8283#pragma clang diagnostic pop
8384@end
Original file line number Diff line number Diff line change @@ -813,9 +813,10 @@ + (void)addAttachments:(NSDictionary*)attachments toNotificationContent:(UNMutab
813813 NSMutableArray *unAttachments = [NSMutableArray new ];
814814
815815 for (id key in attachments) {
816- NSString * URI = [attachments valueForKey: key];
816+ NSString * URI = [OneSignalHelper trimURLSpacing: [attachments valueForKey: key]];
817+
817818 NSURL * nsURL = [NSURL URLWithString: URI];
818-
819+
819820 // Remote media attachment */
820821 if (nsURL && [self isWWWScheme: nsURL]) {
821822 // Synchroneously download file and chache it
@@ -1078,6 +1079,13 @@ + (NSString*)hashUsingMD5:(NSString*)string {
10781079 return output;
10791080}
10801081
1082+ + (NSString *)trimURLSpacing : (NSString *)url {
1083+ if (!url)
1084+ return url;
1085+
1086+ return [url stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet ]];
1087+ }
1088+
10811089#pragma clang diagnostic pop
10821090#pragma clang diagnostic pop
10831091#pragma clang diagnostic pop
You can’t perform that action at this time.
0 commit comments