-
Notifications
You must be signed in to change notification settings - Fork 439
Push fails to write from Android device #58
Comments
I just deployed my proof of concept from a few weeks ago to my phone again, and that has no trouble writing to firebase. I believe the only difference in my setup between then and now was that I had to add multiDex to the build.grade in the most recent project. |
Can add a bit of loggin to the |
@EddyVerbruggen I added some basic logging to |
I'll give it a shot with the sample app linked from the readme and see if that gives me any trouble. |
Reproduced trying the demo for this repo against the same firebase I've been using. Same behavior, the console says a key was created but no new data appears. |
I'm refactoring things as we speak so I'll definitely check it out. Thanks for your efforts. |
Awesome, thanks @EddyVerbruggen Collected a little more data–I tried the demo against another Firebase instance as a sanity check, same behavior. The only way I'm deviating from the setup in the readme is setting the I tried creating a new
but still no luck. |
@EddyVerbruggen indeed, free-for-all on the permissions: Note: I updated those strings to booleans, still no luck |
It's a bit weird that you don't have |
Are you 100% sure your Android device can reach your DB? WiFi connection OK? |
OK, asked because if you disable WiFi you can still store data if |
Hmm, I'll flip that bit and see if that affects anything. I do have it set to persist currently |
I guess if your Android browser can reach the FB URL you should be fine. |
No luck with setting persist to false. |
Puzzled.. the weird this is, the demo app you just tried is using an older version of the plugin (with the Firebase 2.x SDK). Can you just keep it connected to the demo Firebase db and see if that makes a difference? Just clone it without modifications.. |
More data, just tried my prototype of the advanced-seed in a genymotion emulator, same behavior. |
I'm confused what you mean by just clone it without modifications? Don't I need to add the google-services.json and do the rest of the setup for it to work? |
You said "Reproduced trying the demo for this repo against the same firebase I've been using. Same behavior, the console says a key was created but no new data appears." so I guess you cloned this repo and followed the instructions in the readme. Since that's using Firebase 2.x you don't need to add google-services.json etc because that's a Firebase 3.x requirement. |
Can I clone you repo and run it on my Android device? |
Well most of the config is in files that aren't tracked by version control (stuff in platforms/android), so I can't easily pass my project. However, I wrote up pretty detailed instructions on my setup here. |
I cloned the demo repo and ran without any config/setup. The push appears to be working from the console, but I don't have access to the firebase admin, so I can't tell if it's actually writing. |
Can you run 'store by push' in the demo again and report back the key that's echo'd in the console? |
Just did a few:
|
Disconnected from wifi and sent a few more:
I really don't think it's a generic network thing because it works fine from web & an iOS emulator. |
Oh shoot, that's not the correct firebase instance sorry. You're connecting to That old instance turned up in some kind of limbo state after migrating my account to Firebase 3. |
Updated the ref:
|
I'm happy to try, but the setup is different for 2.x and 3.x and my app is using the latest version of this plugin. Is there a specific version you want me to hop back to and try? |
I'd say just use the latest with what you already have (your app, not the demo) and connect your app to my Firebase instance. The instances are backward compatible and I can clean it up afterwards with one click. |
"connect your app to my Firebase instance" => Please excuse my ignorance here, but I only know how to do that with the google-services.json file Is it as simple as adding the url to the init call? |
That's hardly ignorant :) Let me update the demo app first so you can simply clone that. |
Thanks for all your help! |
More data: I have one instance on my machine of the angular2-advanced-seed from a few weeks ago where this plugin was working fine, iOS & Android. I was looking at the difference in npm dependencies across the projects and noticed this plugin differed by a minor update (3.0.0 in my project that's working, 3.1.0 in my latest). Unfortunately, I got the same behavior when explicitly using 3.0.0 in my latest: the push promise still resolves, but no data is stored. :[ |
Can you make sure your Google Play services stuff is up to date by running |
I installed the versions in the SO post linked from the readme. Currently on Google Play Services (rev 30) and Google Repository (rev 26). Currently updating Google Repository to rev 28 |
In other news: I've just pushed 3.1.0 to npm and update the demo app so please clone it, follow the steps in the README of that repo (!) and don't change google-services.json so you connect to my Firebase instance. (off to bed) |
Installed and configured with your
|
Amazing, that's working for me. I'll keep you posted on whether or not |
Sorry just to chime in here. Could the issue not have something to do with the fact that new projects created in the new firebase console are not backward compatible with the javascript firebase 2.x.x SDK? IE Old projects there were migrated would work with 2.x.x and 3.x.x firebase SDK but new projects are only able to use 3.x.x. |
I ran into a similar experience with web @matdehaast. I couldn't authenticate from the 2.X SDK to a new firebase instance created from the google console, but their customer support verified the claim in the migration guide that the 2.X SDK should still work if you migrate from firebase.com. I'm yet to verify their claim. |
@EddyVerbruggen so the demo is working when I swap your google-services.json for mine, but when I start a fresh angular2-advanced-seed and follow these instructions, I'm still getting the same behavior from before: the call to push resolves, but no data is stored in firebase:
|
@lowe0292 Is it incorrect for me to say that if the plugin works in the demo app and not in some other app the problem is not with the plugin but with the other app? |
That sounds like solid logic to me. |
@lowe0292 did you ever find a solution here? Reading through the comments, very curious indeed. |
@NathanWalker nope, never solved it with your seed. In fact, this was the Achilles heel that killed our NativeScript project. 😢 |
@lowe0292 sry to hear, completely understand though. Lot of interesting details above. |
This is my service that consumes the nativescript-plugin-firebase API (that's what's on the other side of the
FIREBASE
token), and thepush
insideaddChild
resolves, but no data is written in firebase.Note that it works on the iOS emulator.
The text was updated successfully, but these errors were encountered: