頭のメモリが少ない

プログラミングと日々の生活

File URL not reachable

File URL not reachable

iOS13から発生。ギャラリーから選択したVideoをアップロードしようとしたらエラーが発生した。

解決方法

  • 1.一時ファイルにコピーをする(ImagePickerControllerのdismissを呼ぶ前にやること、下記のエラーがが発生するため)

iOS 13 SDK consider photo app as an another app, so when we dismiss the image picker controller video url will be invalidate.

  • 2.NSData型にしてからアップロード(ファイルサイズでかいと問題になるので注意)

参考

https://stackoverflow.com/questions/57798968/didfinishpickingmediawithinfo-returns-different-url-in-ios-13/58099385#58099385 https://stackoverflow.com/questions/58104572/cant-upload-video-to-firebase-storage-on-ios-13 https://stackoverflow.com/questions/58081267/nscocoaerrordomain-code-257-file-couldn-t-be-opened-because-you-don-t-have-permi