ds753947 2019-04-07 08:11
浏览 88
已采纳

如何使用Azure通知中心使用PHP发送通知?

I am trying to send the notification to my azure notification hub using PHP. I am using these 2 classes to send out the notifications. When I try to send the notifications, I see this error

{ "message": "Error sending notificaiton: 400 msg: 




Bad Request



HTTP Error 400. The request is badly formed.

My function is

public function sendNotificationHub() {


        $hub    =   new \App\Helpers\NotificationHub('connection string', 'central US');
        $message = '{"data":{"message":"Hello from PHP!"}}';

        $notification   =   new \App\Helpers\Notfication("gcm", $message);

        $hub->sendNotification($notification, null);
    }
  • 写回答

1条回答 默认 最新

  • duanqun7761 2019-04-08 06:39
    关注

    400 clearly indicate that the request is malformed (for example, not valid routing headers, not valid content-type, message exceeds size, bad message format).

    Is your hub name is "Central US"? Please check this blog for reference

    https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-php-push-notification-tutorial

    See if it helps.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?