I am using Azure Notification Hubs to deliver push notifications to an android/iPhone devices.
My general flow is:
1.Every time the user opens the mobile app, a call is made to the PNS
(APNS/GCM) and gets an updated device token.
2. The device token is then sent to the server.
3. The server executes the following code to register the token:
RegistrationDescription reg;
if (deviceType == DeviceType.Iphone)
{
reg = new AppleRegistrationDescription(deviceToken, new string[] { userId.ToString() });
}
else
{
reg = new GcmRegistrationDescription(deviceToken, new string[] { userId.ToString() });
}
reg = await hub.CreateRegistrationAsync(reg);
It works great, but my question is, should I be tracking those device tokens in my server for some reason? For example save them in a table for later use or other scenarios I could be facing, or it's intended to use that way(without saving them in a table).