首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有Windows的Safari推送通知

带有Windows的Safari推送通知
EN

Stack Overflow用户
提问于 2013-11-12 23:15:29
回答 1查看 786关注 0票数 3

我试图使用Windows作为后端的Safari推送通知。我能够将Website Push ID: web.com...证书上传到Azure Mobile Services,并且在apple push notification settings中没有任何错误消息就被接受了。

为了处理working (webServiceURL/version/pushPackages/websitePushIDwebServiceURL/version/devices/deviceToken/registrations/websitePushID等),我在Mobile中创建了一个运行良好的API。

但我无法发送推送通知或收到错误消息。

我的测试代码如下所示:

代码语言:javascript
复制
function send(req, res) {
    var push = req.service.push;
    var devicesTable = req.service.tables.getTable('devices');
    devicesTable.read({
        success: function(devices) {
            devices.forEach(function(device) {

                console.log("send to deviceToken " + device.deviceToken);

                push.apns.send(device.deviceToken, {
                    alert: 'Toast: A new Mobile Services task.',
                    payload: {
                        inAppMessage: "Hey, a new item arrived: '"
                    }
                });

                push.apns.send(device.deviceToken, {
                        alert: {
                            "title": "Test 123 ",
                            "body": "Test 123 ",
                            "action": "View"
                        },
                        "url-args": ["boarding"]
                    },
                    {
                        error : function(err) {
                            console.log("send error " + err);
                        }
                    }
                );

            });
        }
    });

    res.send(200, "");
}

我的问题是字典格式还是Azure由于某种原因不支持?

据我所知,iOS、Mac和Safari通知的APNS都是相同的。

更新:,我用SimplePush测试了它,所以证书很好,就像注册SimplePush一样。我的有效载荷是这样的:

代码语言:javascript
复制
// Create the payload body
$body['aps'] = array(
    'alert' => array(
        'title' => 'test',
        'body' => $message
    ),
    'url-args'  => array('test'),
);
EN

回答 1

Stack Overflow用户

发布于 2013-11-19 03:03:04

我假设您已经按照Apple的指导正确注册了Safari客户端--您在非Azure实现上测试了您的客户端吗?从苹果的实现指南看,似乎有很多移动的部分,即使没有考虑到Azure作为您的推送信息来源。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19941948

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档