dongyi6195 2018-07-10 12:13
浏览 58

APN“提取推送通知包失败”

I followed the manual https://developer.apple.com/notifications/safari-push-notifications/. I use the PHP script to generate the required archive. It is created and downloaded (the structure of the elements is the same as in the manual).

  • all my 'Web Service Endpoints' processing results give the code 200'
  • webServiceURL/version/pushPackages/websitePushID' generates the necessary archive on the download (application/zip for the Content-type header is present)
  • safari downloads it already unzipped folder (meaning the installed header is correct and the file is unzipped normally)
  • the resource(website) that requests "the right to send notifications" is missing in the settings of Safari (Websites-> Notifications), since it has never successfully requested

website.json have correct structure and valid JSON-file...

{
    "websiteName": "Safari Push Demo",
    "websitePushID": "web...",
    "allowedDomains": ["https://..."],
    "urlFormatString": "https://...",
    "authenticationToken": "19f8d7a...be957043",
    "webServiceURL": "https://..."
}

manifest.json have correct structure and valid JSON-file...

{
    "icon.iconset\/icon_16x16.png": "e675cb16...9a38ce0",
    "icon.iconset\/icon_16x16@2x.png": "920249e14c...067305bd0",
    "icon.iconset\/icon_32x32.png": "920249e14c2...305bd0",
    "icon.iconset\/icon_32x32@2x.png": "067fed2988...1b7e5578c21",
    "icon.iconset\/icon_128x128.png": "f4260435....7efeb5fde9",
    "icon.iconset\/icon_128x128@2x.png": "5fe1cd6488...3ebc14654f627",
    "website.json": "eeb81434deab....3bf2d9bd2265"
}

All icons and signature-file presents. The certificate has the appropriate access rights 0644.

For generating and downloading .zip file used this manual Passed simply header as advises the manual from Apple:

header("Content-type: application/zip");
echo file_get_contents($packagePath);#my path to .zip file

Tried and such options: 1)

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-type: application/zip");
// header("Content-type: application/octet-stream");#tried and so, too
header("Content-Disposition: attachment; filename=\"pushPackage.zip\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($packagePath));
ob_end_flush();
readfile($packagePath);#my path to .zip file

2)

header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=pushPackage.zip");
header("Content-length: " . filesize($packagePath));
header("Pragma: no-cache");
header("Expires: 0");
readfile($packagePath);

The archive is downloaded and opened, but APNs do not want to accept them and on 'webServiceURL/version/log' I always have {"logs":["Extracting push notification package failed"]}

There is a question with a similar problem, but without solution. I can not write comments because of my reputation, so I decided to ask again with more detailed information about what I tried.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥15 可见光定位matlab仿真