iOS-specific storage locations and media library integration.
Locations
All locations from Mob.Storage plus:
:icloud— iCloud Drive container for this app;nilif iCloud isunavailable or the user has not signed in
File sharing
Documents/ is user-visible in the Files app only when
UIFileSharingEnabled is set in your Info.plist. Run:
mix mob.enable file_sharingto add that key. Without it, dir(:documents) still works but the
directory is invisible outside the app.
Photo library
save_to_photo_library/2 saves any image or video file to the user's
Camera Roll. It is asynchronous — the result arrives via handle_info:
handle_info({:storage, :saved_to_library, path}, socket)
handle_info({:storage, :error, :save_to_library, reason}, socket)Requires NSPhotoLibraryAddUsageDescription in Info.plist:
mix mob.enable photo_library
Summary
Functions
Resolve a location atom to its absolute path.
Save a file to the user's Camera Roll (photo library).
Functions
Resolve a location atom to its absolute path.
Returns nil for :icloud when iCloud is unavailable.
@spec save_to_photo_library(Mob.Socket.t(), String.t()) :: Mob.Socket.t()
Save a file to the user's Camera Roll (photo library).
Type (:image or :video) is inferred from the file extension.