I know a popular app used to do this by saving an item to the keychain, which persisted between installations. I'm not sure if that's still possible but I would look into it.
However the Keychain should only be used for logins, not to store UUIDs. I never logged in to Tik Tok