gpt4 book ai didi

java - 如何使用 GCM 使用 notification_key?

转载 作者:行者123 更新时间:2023-11-29 08:52:29 24 4
gpt4 key购买 nike

是否有任何 GCM 客户端和服务器 php 示例描述了 notification_key 的使用。因为我的应用程序需要为具有多个设备的用户推送通知。但找不到任何合适的示例或方法来实现此 http://developer.android.com/google/gcm/notifications.html .

谢谢,请帮忙。

最佳答案

这个 PHP 库有一个通过通知键发送的选项:

https://github.com/CoreProc/gcm-php

$gcmClient = new GcmClient('your-gcm-api-key-here');
$message = new Message($gcmClient);
$message->setNotificationKey('xxxxxxxxxx');
$message->setData([
'title' => 'Sample Push Notification',
'message' => 'This is a test push notification using Google Cloud Messaging'
]);
$message->send()

关于java - 如何使用 GCM 使用 notification_key?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22042278/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com