gpt4 book ai didi

macos - 如何使用notificationconf?

转载 作者:行者123 更新时间:2023-12-03 16:15:11 27 4
gpt4 key购买 nike

我已阅读THIS有关创建推送节点和发布/订阅通知的教程。我遇到的唯一问题是 notificationconf 似乎无法创建该节点...

我的第一个问题:nodename(notificationconf工具的参数)和notificationName(我从应用程序中使用的NSString)是否相同?

第二:

notificationconf createnode push.example.com BFMyTestPushhNotification beefon
Enter password: // password from Open Directory for user beefon - it is Admin of the 10.6 server
2010-01-24 13:24:58.916 notificationconf[15221:903] created XMPP session
2010-01-24 13:24:58.931 notificationconf[15221:903] Connecting to push.example.com:5222 with user com.apple.notificationuser@push.example.com/TestPubsub, security = 2 ...
2010-01-24 13:24:59.130 notificationconf[15221:903] sessionCallback (event 1)
2010-01-24 13:24:59.130 notificationconf[15221:903] Session stopped (event 1)

我做错了什么?从应用程序发布通知不会执行任何操作...

感谢您的帮助!

最佳答案

我一直在尝试将 Snow Leopard Server 的推送通知服务与基于 XMPP 发布-订阅的自定义应用程序结合使用。我努力创建一个节点,但终于弄清楚了。

  1. 追踪服务帐户com.apple.notificationuser的密码。例如,您可以在 /private/etc/dovecot/notify/notify.plist 中找到它。

  2. 使用 JID com.apple.notificationuser@your-chat-server-hostname.com 和该密码连接到您的推送通知服务器。

  3. 以正常方式创建节点。在XMPPFramework中是这样的:

    XMPPJID *serviceJID =
    [XMPPJID jidWithString:@"pubsub.your-chat-server-hostname.com"];
    XMPPPubSub *xmppPubSub = [[XMPPPubSub alloc] initWithServiceJID:serviceJID];
    [xmppPubSub createNode:@"pubsub.your-chat-server-hostname.com`
    withOptions:nil];
  4. 服务器创建节点。它以 iq 进行响应,但不是规范要求的。如果节点已经存在,它会发送一个合规错误。

    <iq xmlns="jabber:client"
    to="com.apple.notificationuser@your-chat-server-hostname.com/..."
    from="pubsub.your-chat-server-hostname.com"
    id="...:create_node" type="result"/>
  5. 使用同一用户进行连接以发布您的更新。

我始终无法让 notificationconf 正常工作。

关于macos - 如何使用notificationconf?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2126719/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com