Closed MarcoFilosi closed 1 year ago
Hi!
I feel like the album you want to check is empty bc that's related of pagination errors... I'll check it later.
Is nice to know how much images had the album and what device are you using
Hi, I've tested on iOS simulator and it has just 6 pictures. There is only just one album. It is called "Recents". By the way the exception is thrown immediately if I set "noAlbums" option.
See the attached picture regarding album selection
I have some idea, i'll check it after work.
Thanks
Hey @mdjfs, I have the same problem. Did you get anything done? Cause you had some ideas, I have none 😁
@MrSinaRJ @MarcoFilosi hey guys! Sorry for the delay, I was really busy at work... I'm trying replicate that but I have a problem. I'm not a mac user (bad news for testing)... Then @MrSinaRJ yes i have some idea, the bug is inside of this function:
Probably, the picker try to fetch an unexistent page. Maybe we need ensure if this page exists before fetch.
Can you do a console.log
of this.state.page
before MediaLibrary.getAssetsAsync
? After that probably I have an answer for the bug
Hey @mdjfs, Thanks for looking it up. The fact we're here is to help each other and improve what we achieve.
here is what I get from console.log
before and after the said line:
before MediaLibrary.getAssetsAsync::: undefined
error in catch after MediaLibrary.getAssetsAsync::: [Error: Couldn't find cursor]
[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'page.endCursor')]
I attach a screenshot of the code so you can trace better
Additional useful data:
In WhatsAppAlbum which you have provided in Readme, there is props
variable, which the console.log()
return the following object:
Object {
"album": Object {
"approximateLocation": null,
"assetCount": 6,
"endTime": null,
"folderName": null,
"id": "87574209-EE20-4693-832B-4CBB661F48F9",
"locationNames": Array [],
"startTime": null,
"title": "Recents",
"type": "smartAlbum",
},
"goToGallery": [Function bound dispatchSetState],
"thumb": Object {
"creationTime": 1522437259365,
"duration": 0,
"filename": "IMG_0006.HEIC",
"height": 3024,
"id": "CC95F08C-88C3-4012-9D6D-64A413D254B3/L0/001",
"mediaSubtypes": Array [
"hdr",
],
"mediaType": "photo",
"modificationTime": 1663867701019,
"uri": "ph://CC95F08C-88C3-4012-9D6D-64A413D254B3",
"width": 4032,
},
}
Object {
"album": Object {
"approximateLocation": null,
"assetCount": 1,
"endTime": null,
"folderName": null,
"id": "1EE116F5-89F5-471C-8A85-FDED3F67E081",
"locationNames": Array [],
"startTime": null,
"title": "Favorites",
"type": "smartAlbum",
},
"goToGallery": [Function bound dispatchSetState],
"thumb": Object {
"creationTime": 1522437259365,
"duration": 0,
"filename": "IMG_0006.HEIC",
"height": 3024,
"id": "CC95F08C-88C3-4012-9D6D-64A413D254B3/L0/001",
"mediaSubtypes": Array [
"hdr",
],
"mediaType": "photo",
"modificationTime": 1663867701019,
"uri": "ph://CC95F08C-88C3-4012-9D6D-64A413D254B3",
"width": 4032,
},
}
I have 1 Recents Album, and 1 Favorites
I think cause the album path is virtual in this case, this happens and it may only happen on iOS simulator.
I'll have access to physical iOS next week and will test that and will upload data from props
to see if it changes.
Hi! I think is a detail related with expo-media-library, when try fetch assets with after: '0'
. That in android works, returns the first assets for the album. But in iOS that didn't work because iOS only expect an asset ID. Not a position. And in android, the after
option can be an Asset ID or a position.
Read more about that in this thread:
https://github.com/expo/expo/issues/15513
Then. I upload a new release of the library 4.3.1
. @MrSinaRJ when you can test it and let me know if its ok to close the issue!
Thanks for all!
Hey @mdjfs , Updated to 4.3.1 and it's okay Thanks for the awesome library
I know it's not the place, but is it possible to open imagePicker with all the selected items as a prop so user can edit his/her choice? (yes/no would be enough, if no I'll open a feature request issue, if yes I'm gonna need some documentation about how to use)
Glad to know the bug is fixed now for iOS 👍
No, actually there is no way to open ImagePicker with selected assets. Can be a feature request issue, i checked and is possible, just I need some time, and do some tests
Then, with the update bug is fixed. I'm gonna close the issue
Thanks!
It seems the library doesn't work using the simple example shown in the home page:
Basically the album selection works but when user goes to pictures selection screen an exception is thrown. This is the output on console:
This is my current expo versions:
You can reproduce it easily. Let me know if you need more information. Note: app has already permissions set properly