Open Jared-Gross opened 3 years ago
device token is the unique id for every registered device. To get that unique id for flutter you need to call FirebaseMessaging instance and getToken() method
import 'package:firebase_messaging/firebase_messaging.dart'; final _firebaseMessaging = FirebaseMessaging.instance; await _firebaseMessaging.requestPermission(); String? fCMToken = await _firebaseMessaging.getToken(); print('Token: $fCMToken');
you can copy paste it or in realworld application you need to add this in database for unique users and can be used to send notification to that particular user. Hope this clear your doubt. :)
Where exactly do we get this Device Token????
It's really unclear.