使用 Firebase Admin SDK 将转化事件添加到云消息

Sam*_*len 5 firebase firebase-cloud-messaging firebase-analytics firebase-admin

我可以使用下面的代码发送推送通知,但我还需要将“转化事件”与通知相关联。这可以通过控制台完成,但我找不到如何使用 SDK 来完成此操作。

var message = new Message()
            {
                Data = new Dictionary<string, string>()
                {
                    { "test1", "6165" },
                    { "test2", "161" },
                },
                Notification =
                {
                    Body = "",
                    Title = ""
                },
                Topic = topic,

            };
            // Send a message to the devices subscribed to the provided topic.
            Task<string> response =  FirebaseMessaging.DefaultInstance.SendAsync(message, true);
            // Response is a message ID string.
            response.Wait();
            Console.WriteLine("Successfully sent message: " + response);
Run Code Online (Sandbox Code Playgroud)