How to handle storage of expo push token for multiple and unregistered uses, should I deprecate them after N failures?

I want to use expo SDK36 to send push notification every day at 8am Europe/Paris.

My application is having tho types of users:

  • Registered merchant (with a userId)
  • Unregistered visitor (without any id)

Since my app does not require user registration for the majority of them, how should I:

  • store the token server side and recognize my users?
  • handle if they use mutliple devices to access my application?
  • remove unused token, is that even necessary?

So far, I am thinking of storing all of them in my database using:



CREATE TABLE "expo_push_token"
(
    "id"         BIGSERIAL    NOT NULL,
    "note"       VARCHAR(256) NOT NULL,
    "um_user_id" BIGINT DEFAULT NULL,
    "token"      VARCHAR      NOT NULL,
    UNIQUE ("token"),
    CONSTRAINT um_user_fk FOREIGN KEY ("um_user_id") REFERENCES "um_user" ("id"),
    PRIMARY KEY ("id")
);