-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'debug' of undefined #10
Comments
Ah interesting you're handling it with a model like that... But ANYWAY, the latest version only works on iOS and I just pushed a fix for the bug you're seeing. That's because you're not passing an object (even an empty object) in to the constructor of Firestack. Try it again with the latest master branch, if you would. |
@auser Hi thanks for the response! The previous problem has been resolved but there is a new one. |
Ah! The docs need to be updated. If you pass a Right now it's exposed through a different "object" and you can call firestack.storage.setStorageUrl()` Do you think it makes sense to expose the |
Hi, thank you for the clarification. I figured that all functions related to storage should have a Nevertheless, the uploadFile function throws an err Any idea on this? |
Ah... I don't think that is your error. Actually, this is a bug in the Give me a few minutes to update the class. |
Okay, can you try now from the You can call |
Hi, Just in case May I double check if firestack does upload image from path? According to this, react native doesn't support file or blob types, so uploading images might not be straightforward yet. |
Yep, I just tested it here... want to try one more time? (I just pushed one more update) Also, if you're interested, I'm in the gutter room https://gitter.im/fullstackreact/react-native-firestack |
may I see your example please? |
Of course. // The takePicture function
takePicture() {
this.camera.capture()
.then(({path}) => {
const filename = 'photo.jpg'
firestack.uploadFile(`photos/${filename}`, path, {
contentType: 'image/jpeg',
contentEncoding: 'base64',
})
.then((res) => {
console.log('result from upload file: ', res);
})
.catch((err) => {
console.log('error happened with uploadFile', err);
})
})
.catch(err => console.error(err));
} and the render view <Camera
ref={(cam) => {
this.camera = cam;
}}
captureTarget={Camera.constants.CaptureTarget.temp}
style={styles.preview}
aspect={Camera.constants.Aspect.fill}>
<Text style={styles.capture} onPress={this.takePicture.bind(this)}>[CAPTURE]</Text>
</Camera> |
Thank you! I will try again later and tell you the result. |
Great. I also updated the README with the example. |
Hi, I try the example and it throws I think it's the issue with facebook fetching function. |
Hm... did your file get uploaded? Do you see anything in the Xcode console?
|
Hi, I'm in the middle of an lecture now so I'm afraid I can't talk rn. |
(Ah, well... gittr is a text-based chat room if you change your mind). I'm working on the Java side right now anyway... Perhaps you can gist me the Xcode logs stack, when you get a chance. I'd love to see what we can figure out. |
Yup I will create a gist of Xcode logs if the problem still persists after re-installing. |
@auser Hi, thank you very much for your help. I believe it's my silly mistake to not config firebase properly (ie adding firebase to the project). Please mark the issue as resolved. With that said, this is such an awesome module! Can't wait to try it on android when full support comes out. |
Hi, I'm trying to use firestack mainly to upload picture onto firebase storage.
My model firestack file:
import Firestack from 'react-native-firestack' const firestack = new Firestack(); firestack.setStorageUrl(someUrl).then(() => console.log("Project configured and ready to boot")); module.exports = firestack;
and in my main file i just require it as normal:
var firestack = require('../../Model/firestack');
But when i run, it keep throwing this error:
dependencies i use:
"react-native-firestack": "^2.1.0", "firebase": "^3.3.0", "react": "^15.2.1", "react-native": "0.31.0",
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: