What is the purpose or meaning of installationId?

I’m curious about this one.

Checkout my last PR https://github.com/parse-community/Parse-SDK-JS/pull/1031

I agree that it should be documented because I had to figure it out myself.

Every instance of Parse SDK has an installationId. It is a unique identifier. For example iOS or web client if I log in, that user it tied to an installationId from there we know what device it was logged in from.

Push notifications use it to determine where we send push’s too.

LiveQuery can do the same

If a user logIn with an installationId and another user logs in with the same installationId. The first user would be automatically logged out and session deleted. Because it’s the same device.

If you are like me and you login in through cloud code you have to pass in the installationId. What is the cloud code installationId? It’s always set to “cloud”. Since every installation is the same, every account would have an invalid session token.

I hope it helps

1 Like

Based on what you said, every device I logged in has different installationId plus it will create it’s own session.

If you are like me and you login in through cloud code you have to pass in the installationId. What is the cloud code installationId? It’s always set to “cloud”. Since every installation is the same, every account would have an invalid session token.

I don’t quite get the last part. Sorry.

Forget that last part. I’ll update the docs and do more research

Anyway, Thanks. I was just curious for installationId use case :slight_smile: as it was not stated anywhere else in the doc

No problem. It’s mainly used to clean up sessiomTokens. A single user logged into multiple devices, if that user logs out of one device all devices would get an invalid session token error in the past.

1 Like