Skip to content
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

How to clear all your local data and subscribe again ? #35

Closed
LeNiglo opened this issue Nov 10, 2015 · 2 comments
Closed

How to clear all your local data and subscribe again ? #35

LeNiglo opened this issue Nov 10, 2015 · 2 comments
Labels

Comments

@LeNiglo
Copy link

LeNiglo commented Nov 10, 2015

Hey,

I have an app with 3 activities (Login, List, Detail of item).
I need to be able to completely clean my List activity when I move back to login.
At the moment, I unsubscribe during the onStop() and subscribe during the onStart() but the second time I log in, I receive nothing.

Do you have an idea ?
Thanks (awesome library !)

@ocram ocram added the question label Nov 11, 2015
@ocram
Copy link
Contributor

ocram commented Nov 11, 2015

Thanks for your question and your appreciation :)

So if you're subscribing in onStart() and unsubscribing in onStop(), you're basically toggling the subscription status whenever the app is opened/closed (e.g. via the "Home" key), right?

Can you check if this is working? Are there any things happening when the app is "minimized" and then "maximized" again?

Are you using the unsubscribe method correctly? What did you do? Keep the ID returned from the subscribe method and use that ID to unsubscribe again, later?

Can you pass an UnsubscribeListener as the second parameter, as shown in the examples? This way you should be able to see if unsubscribing works correctly or fails with an error message.

Apart from that, what about logging the user out? Does that help? You were talking about the second time you log in, so did you properly log out the user before?

If neither of those suggestions work, I'm afraid it might be a question concerning the Meteor project itself (and its DDP protocol sub-project). This library does not cache any resources, so far. So if Meteor is not sending the resources again after you've properly unsubscribed and/or logged out, you may get better help there.

@LeNiglo
Copy link
Author

LeNiglo commented Nov 11, 2015

Thanks for you answer, I will look at it ASAP and give you a feedback ! :)

@ocram ocram closed this as completed Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants