Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

fetch() doesn't work with nativescript-plugin-firebase #42

Closed
a-v-zheng opened this issue Jun 4, 2016 · 6 comments
Closed

fetch() doesn't work with nativescript-plugin-firebase #42

a-v-zheng opened this issue Jun 4, 2016 · 6 comments

Comments

@a-v-zheng
Copy link

a-v-zheng commented Jun 4, 2016

Hi Guys! Thank you for excellent plugin - it's really useful. But I've got a problem:

I'm using fetch() in my project for make requests to some geo services. (google places, google geocoder, nominatim). And this method doesn't work with firebase plugin. For example, this code (url from nominatim wiki) must show me in console json response:

fetch("http://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1")
    .then(function(response) {
      return response.json();
    }).then(function(data) {
      console.log("##############################")
      console.log("###=" + JSON.stringify(data))
      console.log("##############################")
    });

and I've got nothing if I add firebase in my project or if I add this code in firebase demo project. Need help! Thanks.

P.S.
With http.getJSON() the same situation.

var http = require("http");
http.getJSON("http://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1").then(function (data) {
    console.log("##############################")
    console.log("###=" + JSON.stringify(data))
    console.log("##############################")
}, function (e) {
    console.log(e);
});
@a-v-zheng a-v-zheng changed the title fetch() don't work with firebase plugin fetch() doesn't work with firebase plugin Jun 4, 2016
@a-v-zheng a-v-zheng changed the title fetch() doesn't work with firebase plugin fetch() doesn't work with nativescript-flugin-firebase Jun 4, 2016
@a-v-zheng a-v-zheng changed the title fetch() doesn't work with nativescript-flugin-firebase fetch() doesn't work with nativescript-plugin-firebase Jun 4, 2016
@a-v-zheng
Copy link
Author

a-v-zheng commented Jun 6, 2016

It works fine if I use old version (2.1.8)
But with google-services I've got promblems

@EddyVerbruggen
Copy link
Owner

Do you see anything in the log?

@a-v-zheng
Copy link
Author

When I use fetch() I see nothing in console.

@EddyVerbruggen
Copy link
Owner

And this is on iOS, Android, or both?

@a-v-zheng
Copy link
Author

didn't test iOS. I work at the moment only with Android.

@EddyVerbruggen
Copy link
Owner

I just tested this again on Android without problems. I'm running init after the app started and added your fetch code in its success callback function. Then I logged in via Firebase Auth and queried the database. No problems.

Perhaps something was fixed in 3.5.0.

I'm closing this, but feel free to send me your project if you want me to take a deeper look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants