skip to Main Content

Flutter – Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval

void main() async{ WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform ); final _firebaseMessaing = FirebaseMessaging.instance; await _firebaseMessaing.requestPermission(); final fCMToken = await _firebaseMessaing.getToken(); print("This is token =========> ${fCMToken}"); runApp(MyApp()); } Here I want the token but some errors occurs and the Token does…

VIEW QUESTION

Firebase Cloud Messaging API (V1)

Trying to implement Firebase Cloud Messaging API (V1) as Cloud Messaging API (Legacy) is getting depreciated from 20/06/2024, I'm trying to generate API key for the new API v1, but there seems to be no way around it. The attached…

VIEW QUESTION

Php – Sending Push Notification to Multiple Selected Devices with FCM

public function send_fcm() { $project="some-project"; require_once 'vendor/autoload.php'; $client = new GoogleClient(); $client->setAuthConfig('../menicon_images/some-project-firebase-adminsdk-kgpuf-afs957ea.json'); $client->addScope('https://www.googleapis.com/auth/firebase.messaging'); $result = $client->fetchAccessTokenWithAssertion(); $accessToken=$result["access_token"]; $fcmUrl = 'https://fcm.googleapis.com/v1/projects/'.$project.'/messages:send'; $notification = [ 'title' =>"Some title", 'body' => "SOme message", ]; $fcmNotification =[ 'message' => [ 'token' => "some-token-device", 'notification'…

VIEW QUESTION
Back To Top
Search