storage putFile() ignores custom metadata. Standard metadata such as contentType works.
import firebase from 'react-native-firebase';
firebase.storage()
.ref().child(storageName)
.putFile(data.path, { contentType: 'video', uid: this.props.user.uid, "okok": "okok"})
Expected: metadata "contentType", "uid", and "okok" listed in firebase storage ui for the uploaded file
Actual: contentType is correctly set, but no other custom metadata is present
Android
Application Target Platform: macOS Sierra
Development Operating System: react-native run-android, Nexus P6 API 26.
Build Tools: ?
React Native version: ^0.52.1
RNFirebase Version: ^3.2.2
Firebase Module: storage
@jonaseck2 Can you try putting the custom data into a customMetadata
object:
firebase.storage()
.ref().child(storageName)
.putFile(data.path, { contentType: 'video', customMetadata: { uid: this.props.user.uid, "okok": "okok"}})
Storage is another area that we need to take a look at after FCM as it's not had much attention, but I'm fairly sure this may be an undocumented feature
Closing due to lack of response - Please let us know if this doesn't work.
Yeah, it works. Good to know is the key is omitted if the value is null
Most helpful comment
@jonaseck2 Can you try putting the custom data into a
customMetadata
object:Storage is another area that we need to take a look at after FCM as it's not had much attention, but I'm fairly sure this may be an undocumented
feature