olofd / react-native-photos-framework

A modern and comprehensive CameraRoll/iCloud-library-API for React Native 📸 📹
MIT License
220 stars 99 forks source link

How to create asset of local image ? #101

Closed kishanbharda closed 5 years ago

kishanbharda commented 5 years ago

Hiii,

I want to create an asset of local image which is in my project directory.

Here is my directory structure : Screen Shot 2019-04-23 at 6 50 35 PM

I want to create asset of that logo.png.

However I write some code as following :

RCTCameraRollRNPhotosFrameworkManager.createAssets({
        images : [require('../assets/logo.png')],
        album : album,
        includeMetadata : true 
}).then((result)=>{
        alert(JSON.stringify(result));
}).catch((error)=>{
        alert("Error in creating assets.\n"+JSON.stringify(error));
});

But that creating issue for me. I explained issue here

Please tell me how can I solve this issue.

kishanbharda commented 5 years ago

I have solved. Here is the solution.