我正在使用GCM服务从服务器推送信息.如果我使用浏览器密钥,则显示成功的表格:{"multicast_id":4849013215736515938,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0: 1348742583011905%2adac3a0f9fd7ecd"}]} 但我没有在设备上收到任何通知.如果我使用服务器密钥,它会显示Unauthorized Error 401.我的代码如下所示:
$apiKey = "xxxxx";
$registrationIDs = array("xxxxxxxx");
$message = "testing Process";
$url = 'https://android.googleapis.com/gcm/send';
$fields = array(
'registration_ids' => $registrationIDs,
'data' => array("message"=>$message),
);
$headers = array(
'Authorization: key=' . $apiKey,
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode($fields) );
$result = …Run Code Online (Sandbox Code Playgroud) 我正在使用open-inviter技术从gmail,yahoo和hot-mail导入联系人.
所有这些都在上个月运作良好,但现在这个应用程序无法从hotmail导入联系人,可能是热门邮件改变了它的条款和条件.
即使我在使用雅虎导入联系人时遇到一些问题,仅针对某些特定的电子邮件ID.
即使我尝试从http://svetlozar.net/address-book-importer-demo.html导入,使用这些相同的电子邮件ID并显示相同的错误消息"登录失败.请检查您的电子邮件ID和密码你提供了".
提前致谢.
我正在使用Iconv函数将字符串转换为请求的字符编码.看下面的代码
$sms_text = 'A:'f3*'F'; // Output received from SMPP
$result = iconv('UTF-16BE' ,'UTF-8//IGNORE' , $sms_text);
echo 'Ignore: ' .$result;
echo $sms_text = iconv('UTF-16BE' ,'UTF-8' , $sms_text);
$result1 = iconv('UTF-16BE' ,'UTF-8//TRANSLIT' , $sms_text); //line no (53)
echo 'Transilt: '.$result1;
Run Code Online (Sandbox Code Playgroud)
我收到了以下输出
如果我有一个dari和pashto语言字符串,那么它只显示第一个单词,并且在空格后不返回剩余的字符串.甚至// IGNORE也提供相同的输出.
我应该在其他角色的帮助下替换这些空格,以便我可以获得完整的字符串吗?
注意:我正在传递从SMPP(接收方)收到的字符串.
SMS Sent to SMPP : ????????? ????
Outpur Received from SMPP : 'A:'f3*'F
String back converted by iconv : ?????????
Run Code Online (Sandbox Code Playgroud)
英文字符串运作良好.
提前致谢.