Hello
Environment
- NativePHP Mobile Camera:
1.0.3
- Laravel:
12
- Android APK build
Problem
After taking a photo, the PhotoTaken event returns an Android private cache path:
/data/user/0/com.domain.app/cache/captured_1783458827316.jpg
But this path is not accessible from PHP:
file_exists($path); // false
is_dir(dirname($path)); // false
The PHP runtime cannot read the file because this path belongs to the Android native layer.
Expected behavior
The plugin should provide a way to access the captured image from PHP.
Possible solutions:
Send the image content (Base64/blob) with the PhotoTaken event.
or
Copy the file to a location accessible by the PHP runtime before dispatching the event.
Example:
#[OnNative(PhotoTaken::class)]
public function photoTaken(string $path)
{
Storage::put(
'photos/photo.jpg',
file_get_contents($path) // or base64_decode($path)
);
}
should work after the fix.
Thank you.
Hello
Environment
1.0.312Problem
After taking a photo, the
PhotoTakenevent returns an Android private cache path:/data/user/0/com.domain.app/cache/captured_1783458827316.jpg
But this path is not accessible from PHP:
The PHP runtime cannot read the file because this path belongs to the Android native layer.
Expected behavior
The plugin should provide a way to access the captured image from PHP.
Possible solutions:
Send the image content (Base64/blob) with the PhotoTaken event.
or
Copy the file to a location accessible by the PHP runtime before dispatching the event.
Example:
should work after the fix.
Thank you.