小编vkj*_*vkj的帖子

从GCM获得多个通知

我正在使用PHP一次在多个Android设备上发送通知.所有注册ID都是唯一的,以下是我发送的CURL请求.

$url='https://android.googleapis.com/gcm/send';
$headers = array(
                'Authorization: key=' . ANDROID_KEY,
                'Content-Type: application/json'
            );
$registration_ids = [];//with multiple registration ids
$notification = array(
                'registration_ids' => $registration_ids,
                'data'             => array('notification_id' => $data['notification_id'],
                                            'title'           => $data['title'],
                                            'message'         => $data['message'])
            );
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($notification));           
$res = curl_exec($ch);
Run Code Online (Sandbox Code Playgroud)

多次调试后,我在同一台设备上找不到任何多次通知的原因(超过10次).

有没有办法检查GCM收到的请求的日志.任何领导将不胜感激.

php android curl google-cloud-messaging

28
推荐指数
1
解决办法
623
查看次数

在文件夹操作上运行applescript

我已经附加了一个文件夹的脚本,只要有什么内容添加到该文件夹​​就可以运行.问题是如果一个接一个地添加多个文件,则进程排队.即使脚本已经在运行另一个文件,如何使脚本运行.

macos applescript

5
推荐指数
1
解决办法
251
查看次数

删除查询 MySQL:列计数与第 1 行的值计数不匹配

我正在尝试从具有特定 ID 的表中删除所有行。我的查询是:

DELETE FROM table_name WHERE x_id='46';
Run Code Online (Sandbox Code Playgroud)

返回的错误是:

#1136 - 列数与第 1 行的值数不匹配

我的表有一个复合主键x_id是主键中的列之一。

请帮忙!

mysql

1
推荐指数
1
解决办法
2674
查看次数

标签 统计

android ×1

applescript ×1

curl ×1

google-cloud-messaging ×1

macos ×1

mysql ×1

php ×1