You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.
let users = MeteorCollection<User>(name: "users")
Meteor.subscribe("users") , callback: {
var id = Meteor.client.userId()
self.navigationController!.performSegue(withIdentifier: "LoginSuccess", sender: nil)
let json = JSON(users.findOne(id!)?.services)
print(json["facebook"]["id"])
})
The following code above is supposed to retrieve the user's information when I subscribe to "users". The problem is sometimes I get null for user information. I'm really not sure why?
this is my server code:
Meteor.publish("users", function () {
if (this.userId) {
return Meteor.users.find({_id: this.userId}
{fields: {'services.resume': 0}});
} else {
this.ready();
}
});
How can I make sure that the closure is only triggered once I am ready to receive everything.
The text was updated successfully, but these errors were encountered:
very annoying issue, when I subscribe to my messages, sometimes i get info, sometimes i dont. my guess is somehow it thinks that there is nothing to load, i'm not sure why. you should try and look at meteor-ios,never happened to me there.
I can't tell what you're doing from the code you've provided. But I see a number of potential problems. First, you shouldn't put your navigation logic inside subscription callback. That's opening up a number of potential problems and is going to make this harder to reason about. Second, you shouldn't define your collections inside your view controllers. When you navigate away users is going to disappear.
What do your DDP logs look like on the client. They'll show you exactly what is being transmitted from the server.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following code above is supposed to retrieve the user's information when I subscribe to "users". The problem is sometimes I get null for user information. I'm really not sure why?
this is my server code:
How can I make sure that the closure is only triggered once I am ready to receive everything.
The text was updated successfully, but these errors were encountered: