October 2017
Intermediate to advanced
302 pages
7h 27m
English
Let's write out the steps we need to take:
The last step is to keep things clean by periodically removing invalid tokens from our database.
Okay, sounds like fun. Remember that this is all within the event listener of onWrite. Here's the first step:
return admin .database() .ref('fcmTokens') .once('value') .then(allTokens => { if (allTokens.val()) { } });
This uses the database .once method to grab a one-time look at the token ...
Read now
Unlock full access