Comments (12)
Thanks for the great library. Is it possible to add a feature to allow the sort order for album images (either ascending or descending) when pre-fetching images in albums using the previewAssets property?
from react-native-photos-framework.
@iamgbsmith I actually think you already can do that. Have you tried adding a assetFetchOptions
to your getAlbums
query?
Search for this text : Fetch options used when loading assets from album returned. You can choose to pass these fetchOptions here to affect previewAssets
in the README.md and you'll find docs about it.
Let me know if there is something here that does not work, or if there is anything else needed regarding this. Or if you need help applying it.
Haven't tried it, but his should work:
RNPhotosFramework.getAlbums({
assetFetchOptions: {
sortDescriptors: [
{
key: 'creationDate',
ascending: true
}
]
}
}).then..
from react-native-photos-framework.
I have a somewhat "interesting" use case. I'm making a photo picker where photos are grouped by days and the user needs to be able to select all photos in a day. So ideally I'd like to be able to query by day / between a start and end time. Most of the time if the user has a reasonable amount of photos per day this isn't an issue because I'd already have loaded them when the user clicks select all. Sort of an edge case.
from react-native-photos-framework.
Is it possible to load certain albums on the device if they exist like Instagram or Snapchat? If not, I think it would be useful to select these albums if they exist on the users device.
from react-native-photos-framework.
@justinsherwood I do not really follow what you mean? Expand please.
from react-native-photos-framework.
I'm currently using the getAlbumsMany method to return a list of albums by passing an array containing smartAlbumUserLibrary, smartAlbumFavorites, smartAlbumSelfPortraits, etc. I think it would be nice to also query custom albums created by the user that are not "system specific" albums if they exist. An example of this would be including the Instagram or Snapchat albums on a users device.
For example, including specific "My Albums" albums
from react-native-photos-framework.
@justinsherwood They should already be included if you just:
RNPhotosFramework.getAlbums().then...
Does that not work?
You could also use:
return RNPhotosFramework.getAlbumsCommon({
trackInsertsAndDeletes: true,
trackChanges: true,
assetCount: 'exact',
includeMetaData: false,
previewAssets: 2
}, true).then((queryResult) => {
return queryResult.instagramAppAlbumSort();
});
If you like the albums in the exact order the instagram app shows them.
You can also use: queryResult.photoAppAlbumSort() if you want the same order as apple's photos app.
You should not have to use getAlbumsMany. And by passing that array with smartAlbum-values you´re actively excluding user created albums. That's why you do not get them in your result.
from react-native-photos-framework.
I understand that, but the issue is deciding which specific system albums to include, as well as specific user albums. I do not want to include all user created albums, only specific ones like albums titled Instagram or Snapchat. Basically, I want to be able to choose which user albums to include in my query if they exist in addition to the specific smartAlbums I am interested in displaying.
For example, when I run the code you mentioned I receive 100's of user created albums that I am not interested in displaying to users. (albums with specific dates, etc)
The mean reason I think this feature would be useful is to limit the number of displayed custom user created albums to increase performance and to avoid loading 100's of random albums.
from react-native-photos-framework.
I'm struggling at the moment to find a simple / elegant way of sharing a photo fetched with RNPhotosFramework
. At the moment I'm trying to write an ObjC lib to return me a base64
version of the image from the photos://
uri; but if that feature was in this library it would be lovely.
from react-native-photos-framework.
Does this library work with Android as well? I tried including it in an android project, but get the error: Could not find react-native-photos-framework's native module.
from react-native-photos-framework.
Thank you for the great library!
-
One interesting case would be to return a boolean, if the asset is currently stored on the device or in the cloud! The native Photos app let users know which assets are stored in the cloud by showing a cloud icon mark over the asset.
-
Another issue that I have (somewhat related to 1. ) is that, when assets are returned e.g. by calling getAssets(), all the assets which are not stored on the device, are being downloaded from the cloud. It would be nice to have some thumbnails for each asset, and a triggering function for the asset to be downloaded from the cloud, as soon as the user clicks on that specific asset.
from react-native-photos-framework.
+1 for moving a photo to another album
from react-native-photos-framework.
Related Issues (20)
- How to create asset of local image ? HOT 1
- Copy and Move assets from one album to another albums. HOT 1
- How to get the path of the videos ?
- Photos -[PHCompositeMediaResult isPlaceholder]
- A problem occurred configuring project ':react-native-fetch-blob'
- Not getting any media in android from this library , IOS working HOT 1
- Sometimes getting crashed in iOS and taking too much time to get albums
- Installation Error in react native 0.61.4
- ndefined symbols for architecture x86_64: HOT 3
- Sporadic Crash HOT 1
- How to get MimeType? HOT 2
- How to get video associated with live photo? HOT 1
- Error: Cannot find module 'plist' HOT 1
- XCTest/XCTest.h not found HOT 7
- Error on install: Attempt to change mapping for "otf" extension from "font/otf" to "font/opentype". HOT 1
- [ios] Categorizing Assets
- App crashes on start in production build
- RCTCameraRollRNPhotosFrameworkManager is undef
- Undefined symbols for architecture arm64
- album.getAssets() is returning all device assets HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-photos-framework.