我们正在通过服务器发送推送通知。
我想跟踪这个事件,在iOS和安卓系统上收到了多少通知。
。
发布于 2022-09-11 12:22:04
在iOS中,您可以使用
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)若要调用服务器并通知服务器已收到通知,请执行以下操作。
另一种解决方案是使用FCM Rest发送通知。
POST /v1/{parent=projects/*}/messages:send
https://firebase.google.com/docs/reference/fcm/rest
如果您包括谷歌分析,云消息仪表板将拥有所有的信息,如果用户提供了权限,如IDFA。
发布于 2022-09-14 12:55:10
在android中,有一种拦截FCM通知的方法,您可以在这个线程中找到实现。
每个设备通知都由此回调接收,因此您可以创建一些API或一些逻辑来获得确认。
override fun onMessageReceived(remoteMessage: RemoteMessage) {
// TODO(developer): Handle FCM messages here.
Log.d(TAG, "From: ${remoteMessage.from}")
// do the logic here.
}https://stackoverflow.com/questions/73467193
复制相似问题