小编use*_*176的帖子

Apple推送通知服务 - 设备上没有通知

这个问题让我抓狂.我正在实施APNS.我已经谷歌并遵循了几个教程.我实现了服务器似乎工作找到这里是代码:

<?php

$deviceToken = 'XXXX';
// Passphrase for the private key (ck.pem file)
// $pass = '';
// Get the parameters from http get or from command line
$message = $_GET['message'] or $message = $argv[1] or $message = 'Message received from javacom';
$badge = (int)$_GET['badge'] or $badge = (int)$argv[2];
$sound = $_GET['sound'] or $sound = $argv[3];

// Construct the notification payload
$body = array();
$body['aps'] = array('alert' => $message);
if ($badge)
    $body['aps']['badge'] = $badge;

if ($sound)
    $body['aps']['sound'] = $sound;

/* …
Run Code Online (Sandbox Code Playgroud)

iphone apple-push-notifications

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

标签 统计

apple-push-notifications ×1

iphone ×1