You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pulling out extension logic from downloadMediaAndSaveInBundle into it's own method.
Cleaning up typos
Creating MAX_NOTIFICATION_MEDIA_SIZE_BYTES in OneSignalCommonDefines
Renaming supportedFileExtension to supportedFileExtensionFromQueryItems
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:[NSStringstringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
814
804
returnnil;
815
805
}
816
-
if (!extension) {
817
-
NSString *newExtension;
818
-
//Use the MIME type for the extension if one wasn't provided in the filename parameter
819
-
if (mimeType != nil && ![mimeType isEqualToString:@""]) {
820
-
newExtension = mimeType.fileExtensionForMimeType;
821
-
}
822
-
823
-
//Try using url.pathExtension
824
-
if (!newExtension || ![ONESIGNAL_SUPPORTED_ATTACHMENT_TYPES containsObject:newExtension]) {
825
-
newExtension = url.pathExtension;
826
-
}
827
-
828
-
//Try getting an extension from the query
829
-
if (!newExtension || ![ONESIGNAL_SUPPORTED_ATTACHMENT_TYPES containsObject:newExtension]) {
830
-
newExtension = url.supportedFileExtension;
831
-
if (!newExtension || [newExtension isEqualToString:@""])
832
-
returnnil;
833
-
}
834
-
835
-
name = [NSStringstringWithFormat:@"%@.%@", name, newExtension];
836
-
837
-
let newPath = [paths[0] stringByAppendingPathComponent:[NSStringstringWithFormat:@"%@", name]];
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:[NSStringstringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
0 commit comments