官术网_书友最值得收藏!

Cloud Messaging

Any Realtime app needs to send Realtime notifications. Firebase Cloud Messaging (FCM) provides a platform that helps you send the messages and notifications to the app user in Realtime. You can send hundreds of billions of messages per day for free across different platforms: Android, iOS, and web. We can also schedule the message delivery—immediately or in future. Notification messages are integrated with Firebase Analytics, so no coding is required to monitor user engagement.

Service Workers are supported on the following browsers:

  • Chrome: 50+
  • Firefox: 44+
  • Opera Mobile: 37+
// Retrieve Firebase Messaging object.
const messaging = firebase.messaging();
messaging.requestPermission()
.then(function() {
console.log('Notification permission granted.');
// Retrieve the Instance ID token for use with FCM.
// ...
})
.catch(function(err) {
console.log('Unable to get permission to notify.', err);
});
The FCM SDK is supported only in HTTPS pages because of service workers, which are available only on HTTPS sites.
主站蜘蛛池模板: 河东区| 花垣县| 秦皇岛市| 兰溪市| 德格县| 三江| 依安县| 武穴市| 宜丰县| 勃利县| 盐城市| 界首市| 龙岩市| 锡林浩特市| 长垣县| 息烽县| 汶上县| 洪湖市| 宜城市| 二连浩特市| 山丹县| 乌拉特中旗| 林芝县| 蓬溪县| 嵊州市| 独山县| 绍兴县| 会理县| 乌什县| 峡江县| 兰州市| 淄博市| 庆阳市| 赤城县| 安乡县| 桑日县| 客服| 嘉祥县| 钟祥市| 揭阳市| 康定县|