在Firebase控制台中,我根据各种用户属性设置了受众群体,现在可以通过控制台向不同的用户群体发送通知.是否有办法通过http请求fcm服务器执行相同的操作?"to"字段应该有一个技巧,但我无法理解.
我正在使用FCM向Android设备发送通知.当应用程序处于后台时,如果我发送10个通知,则设备将在通知栏上显示10个条目.
我希望FCM在通知栏上只输入一个条目,即较新的条目将覆盖旧条目.我在https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream上找不到设置密钥的密钥.
有办法吗,或者不可能?谢谢.
android android-notifications firebase firebase-cloud-messaging firebase-notifications
我是Firebase以及iOS的新手.我正在尝试使用FCM发送推送通知.
我在FCM上注册了一个iOS应用程序.两个.p12证书都添加了 根据FCM开发的代码.
通过Firebase控制台发送通知时,我收到错误消息Invalid registration token. Check the token format..我不是我做错了什么.

ios firebase firebase-cloud-messaging firebase-notifications
我正在尝试在我的项目中集成FCM通知.我有云功能后端,应用程序在Android上运行.以下是发送通知的云代码:
exports.notificationTest = functions.database.ref(`/test/childA/childB/status`).onUpdate(event => {
const status = event.data.val();
console.info("Processing notificationTest cloud function")
console.info(`status : ${status}`)
const token = "EnterYourNotificationTokenHere"
const randomNum = Math.floor(Math.random() * 100)
var message = {
notification: { title : "My App", body : `Notification Test ${randomNum}`}
}
console.info(`Sending message on notification token`)
return admin.messaging().sendToDevice(token, message)
.then((response) => {
console.info("Successfully sent notification")
}).catch(function(error) {
console.warn("Error sending notification " , error)
})
})
Run Code Online (Sandbox Code Playgroud)
在原生Android应用上,我会多次收到通知,间隔时间为几分钟.在这里,我看到过这样的通知:
Notification Test 30
Run Code Online (Sandbox Code Playgroud)
然后在2,4,8,16,32分钟之前的通知时间后,我再次得到以下消息
Notification Test 30
Run Code Online (Sandbox Code Playgroud)
我不认为我需要在这里粘贴日志,因为代码肯定只执行一次(因为通知中的随机数保持不变).
那么,为什么会发生这种情况以及如何解决它?
以下是我的环境:
Native Android …Run Code Online (Sandbox Code Playgroud) android firebase firebase-cloud-messaging firebase-notifications
我正在测试Firebase推送通知,从Firebase作曲家面板发送通知,我注意到如果我从"应用信息"面板关闭应用进程,则发送的推送通知无法到达设备.即使我再次启动应用程序,通知也会丢失,并且永远不会收到.
我也试过这个:
关闭应用程序 - >关闭设备 - >打开设备电源 - >发送通知......并且没有收到通知!
似乎firebase只能在设备启动应用程序而不是100%关闭时接收通知,我的意思是,只需使用后退键关闭它,但不会终止应用程序进程.
这怎么可能?即使应用程序关闭,firebase仍应收到通知.
我正在使用Android 8.0 测试Nexus 5X,我正在使用最新版本的Firebase push Notifications.
我一直试图按ID对通知进行分组,以使通知显示为WhatsApp,例如,每行没有一个通知。
添加setGroup在任一onNotification或onNotificationDisplayed似乎有下面没有影响见的例子:
1个
componentDidMount() {
this.notificationListener = firebase.notifications().onNotification(async (notification) => {
// Process your notification as required
notification.android.setAutoCancel(true)
notification.android.setGroup(notification.data.channelId)
notification.android.setGroupSummary(true)
}
}
Run Code Online (Sandbox Code Playgroud)
2
componentDidMount() {
this.notificationDisplayedListener = firebase.notifications().onNotificationDisplayed((notification) => {
notification.android.setGroup(notification.data.channelId)
notification.android.setGroupSummary(true)
});
}
Run Code Online (Sandbox Code Playgroud)
知道如何按ID将它们分组吗?
android-notifications react-native firebase-cloud-messaging firebase-notifications react-native-firebase
我是 Firebase 云消息的新手。我构建了一个 IOS 应用程序来接收推送通知。该应用程序运行良好。我从 Firebase 控制台发送消息,并且它们显示正确。
现在我正在尝试构建一个 Web api 以允许我的客户发送推送消息(无需访问 firebase 控制台)。研究这里的文档我意识到我总是有一个“to”,意思是组、主题或设备 ID。
我的问题是:我可以向所有设备发送消息(就像我可以在控制台中执行的那样)吗?我是啊,怎么会这样呢?
提前致谢!
ios firebase firebase-cloud-messaging firebase-notifications
任何人都可以帮我发送这样的通知:
我正在使用Firebase通知.我发送通知时,我尝试将图片网址设置为高级选项和键1的值.图像URL显示在调试器中,但当我的设备中出现通知时,不会显示图像.
这是我的代码.
import UIKit
import UserNotifications
import Firebase
import FirebaseInstanceID
import FirebaseMessaging
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let gcmMessageIDKey = "gcm.message_id"
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Register for remote notifications. This shows a permission dialog on first run, to
// show the dialog at a more appropriate time move this registration accordingly.
// [START register_for_notifications]
if #available(iOS 10.0, *) {
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization( …Run Code Online (Sandbox Code Playgroud) ios firebase swift3 firebase-cloud-messaging firebase-notifications
我在我的应用中使用了Google Analytics(分析),而且工作正常.但是,如果我每天有100个活跃用户,然后我发送通知,则我将1000个连接用户的峰值计为"活动".
我不知道是否有一种简单的方法可以防止这些用户被视为活动用户.他们中的大多数人不会打开通知,我不希望他们算作活动.我想只计算打开应用程序的用户,而不是所有收到通知的用户.
我在发送的通知中使用"body"字段,并在应用程序中创建自定义通知.
是否可以删除这些"活跃"用户?
非常感谢你!