I think this part of FCM is still the same as GCM. Therefore, you should refer to this answer by @TrevorJohns:
The documentation doesn't specify any pattern, therefore any valid string is allowed. The format may change in the future; please do not validate this input against any pattern, as this may cause your app to break if this happens.
As with the "registration_id" field, the upper bound on size is the max size for a cookie, which is 4K (4096 bytes).
Emphasizing on the The format may change in the future part, I would suggest to stay safe and have a beyond the usual max (mentioned above) length. Since the format and length of a registration token may also vary.
For the usual length and characters, you can refer to these two answers the latter being much more definitive:
I hasn't seen any official information about format of GCM registrationId, but I've analyzed our database of such IDs and can make following conclusions:
- in most cases length of a registrationID equals 162 symbols, but can be variations to 119 symbols, maybe other lengths too;
- it consists only from this chars:
[0-9a-zA-Z-\_]*
- every regID contains one or both of "delimiters": - (minus) or _ (underline)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…