大佬教程收集整理的这篇文章主要介绍了cordova – 为什么我收到消息“所有包含的玩家都没有订阅”?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在“所有用户”的Onesignal列表上,未接收通知的用户具有设置了预期纬度和长坐标的“位置点”,并且订阅了用户.我收到了没有位置发送的通知,因此发送和接收通知的过程有效.
我已将此行添加到我的@L_593_12@manifest.xml文件中:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
我的.run函数中也有这一行:
window.plugins.Onesignal.promptLOCATIOn();
$content = $_GET['content']; $lat = $_GET['lat']; $long = $_GET['long']; $radius = $_GET['radius']; $response = sendmessage($content,$lat,$long,$radius); function sendmessage($message,$radius){ $content = array( "en" => $message ); $fields = array( 'app_id' => "aaaaaa-eeee-yyyyy-xxxx-zzzz",'filters' => array(array("field" => "LOCATIOn","radius" => $radius,"lat" => $lat,"long" => $long)),//'filters' => array(array("field" => "LOCATIOn","radius" => "1000","lat" => "55.819329","long" => "-4.1696119")),'included_segments' => array('All'),'data' => array("foo" => "bar"),'contents' => $content ); $fields = json_encode($fields); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"https://onesignal.com/api/v1/notifications"); curl_setopt($ch,CURLOPT_httpHEADER,array('Content-Type: application/json; charset=utf-8','Authorization: Basic FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF')); curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($ch,CURLOPT_HEADER,falSE); curl_setopt($ch,CURLOPT_POST,CURLOPT_POSTFIELDS,$fields); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,falSE); $response = curl_exec($ch); curl_close($ch); return $response; }
请求:
{Content: "test",lat: "55.8653169",long: "-4.1696119",radius: "1000"}
响应:
{allresponses: "{"id":"","recipients":0,"errors":["All included players are not subscribed"]}"}
以上是大佬教程为你收集整理的cordova – 为什么我收到消息“所有包含的玩家都没有订阅”?全部内容,希望文章能够帮你解决cordova – 为什么我收到消息“所有包含的玩家都没有订阅”?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。