00ea140280
The Files folder is the app's own copy — it powers offline playback and Manage
storage — but Files is not where anyone looks for photos and videos. The Photos app
is, and only PhotoKit can write there; @capacitor/filesystem cannot, because an
app sandbox and the photo library are separate stores. So this adds a small native
plugin, mirroring the existing audio-route one.
- mobile/plugins/media-library: saveToAlbum({path, album, kind}) finds or creates
the album and adds the asset. Uses addResource(with:fileURL:), which is uniform
for photo and video and non-optional, unlike creationRequestForAssetFrom*, which
can silently no-op.
- Requests .readWrite, NOT .addOnly: addOnly can add an asset but cannot look up or
create an ALBUM, which is the whole point here. Both photo-library usage strings
are already set by ios-patch.sh.
- If the album can't be resolved (e.g. "limited" access), the asset is still saved
to the camera roll — landing somewhere beats failing outright. A racing create
from two simultaneous downloads re-looks-up instead of erroring.
- Podspec named MediaLibrary.podspec with s.name = 'MediaLibrary' to match
PascalCase of the package name — the same trap that broke the AudioRoute build.
Checked by a script: pod name, jsName and declared-vs-implemented methods.
Entirely best-effort from the web side: a denied permission or an older app build
never fails a download that is already safe in the app folder. Added a Settings
toggle since this does keep a second copy of the file.
Needs a new iOS build — new native plugin.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
33 lines
1022 B
JSON
33 lines
1022 B
JSON
{
|
|
"name": "biz-connect-mobile",
|
|
"version": "0.1.0",
|
|
"description": "Biz Connect mobile app — Capacitor shell loading the Connect web UI",
|
|
"scripts": {
|
|
"sync": "cap sync",
|
|
"assets": "capacitor-assets generate --android",
|
|
"assets:all": "capacitor-assets generate",
|
|
"android": "cap open android",
|
|
"ios": "cap open ios"
|
|
},
|
|
"dependencies": {
|
|
"audio-route": "file:plugins/audio-route",
|
|
"media-library": "file:plugins/media-library",
|
|
"@capacitor-community/safe-area": "^7.0.0",
|
|
"@capacitor/android": "^7.0.0",
|
|
"@capacitor/app": "^7.0.0",
|
|
"@capacitor/camera": "^7.0.0",
|
|
"@capacitor/core": "^7.0.0",
|
|
"@capacitor/filesystem": "^7.0.0",
|
|
"@capacitor/ios": "^7.0.0",
|
|
"@capacitor/keyboard": "^7.0.0",
|
|
"@capacitor/share": "^7.0.0",
|
|
"@capacitor/push-notifications": "^7.0.0",
|
|
"@capacitor/splash-screen": "^7.0.0",
|
|
"@capacitor/status-bar": "^7.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@capacitor/assets": "^3.0.5",
|
|
"@capacitor/cli": "^7.0.0"
|
|
}
|
|
}
|