shortstopmin
shortstopmin

Reputation: 315

How to structure push token for multiple Apps in a single Firebase Database

Suppose I have 3 Apps sharing the same single Firebase database, and all Apps have Android/iOS version. How could I structure the JSON hierarchy in Firebase Database? The following image is my current push token JSON structures. Any better suggestion for pushing only one specified App, and other two Apps receive nothing? Thanks!

enter image description here

Upvotes: 0

Views: 163

Answers (1)

AL.
AL.

Reputation: 37768

For you scenario, I would probably just go ahead with storing the other tokens under the same (user) node. So just edit what you already have to something like this:

/pushTokens
  /$userId
    /appId1:token1
    /appId2:token2
    /appId3:token3

I don't know why you still need the userId node inside the actual node that uses it as a key though.

Upvotes: 1

Related Questions