--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/3846876c-e172-474b-8c26-55de08b88cd5%40googlegroups.com.
I use FCM without using a firebase DB, I just make the http calls in my app and use my MS SQL database for the backend. I can share code with you if you like it works well for us.
Sent from Mail for Windows 10
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/2d6c0b66-60c5-45f0-9c5d-a77dfff88445%40googlegroups.com.
I use FCM without using a firebase DB, I just make the http calls in my app and use my MS SQL database for the backend. I can share code with you if you like it works well for us.
Sent from Mail for Windows 10
From: Ian Perera
Sent: Thursday, November 7, 2019 9:31 AM
To: Flutter Development (flutter-dev)
Subject: Re: Flutter Push Notification Tutorial
thanks for this, I'll be sure to look at it, but is there away to use push notification without utilizing FCM. I already have my backend and would like to integrate there.
On Thursday, July 4, 2019 at 2:03:33 AM UTC-4, Sundaravel M wrote:Hello Everyone,
I have spent a few hours to explore Firebase Messaging with Flutter. & Finally integrated with success. I decided to share my knowledge & code about integrating FCM with Flutter with Video tutorial
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutt...@googlegroups.com.
Sorry for the late reply here it is:
This sends a push notification via FCM
import 'dart:async';
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<void> sendPushNotificationByToken(String body, String token, String title) async {
// TO DO - write token to DB
final response =
await http.post('https://fcm.googleapis.com/fcm/send',
headers: {"Content-Type": "application/json",
'Accept': 'application/json',
'Authorization': "key=AAAAja7qRO0:APA91bHjO6NMXTHlU-VDOE_g-8eIHULnvbKbpIOVwjwc7s7wyr3AOGxfm7ddtpDZL_2oJvSL6hrT9t6p-LdVWUpLGxS4stxUugsItQGv9aca0DbSDPiLZ_7HV5821Z0ypXcYZkD20vXd5-MWHBKVh1rddhDE-x6V7g"},
body: json.encode({'to' : token ,
"notification": {"body": body, "title": title},
}
));
if (response. statusCode == 200) {
// If the call to the server was successful, parse the JSON
print("success");
}
else {
// If that call was not successful, throw an error.
throw Exception('Send Failed');
}
}
Feel free to ask any questions you may have, I couldn’t find much on this so I threw it together.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/8d48830c-0f33-42f2-837e-5dcc14570203%40googlegroups.com.