代码之家  ›  专栏  ›  技术社区  ›  beefon

如何使用notificationconf?

  •  4
  • beefon  · 技术社区  · 16 年前

    THIS 有关创建推送节点和发布/订阅通知的教程。 我遇到的唯一问题是 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)
    

    我做错了什么? 从应用程序发布通知并没有任何作用。。。

    谢谢你的帮助!

    2 回复  |  直到 13 年前
        1
  •  1
  •   paulmelnikow    13 年前

    我一直在尝试将雪豹服务器的推送通知服务与基于XMPP PublishSubscribe的定制应用程序结合使用。我努力创建一个节点,但最终找到了它。

    1. com.apple.notificationuser . 例如,你可以在 /private/etc/dovecot/notify/notify.plist .

    2. 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。如果节点已经存在,它会发送一个兼容错误。

      <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

        2
  •  1
  •   F'x    16 年前

    对于1: 是的,你需要有匹配的 nodename notificationName . 手册页上这样说(虽然不是非常清楚):

     createnode hostname nodename username
             Creates a node on the server to send notifications using.  Before
             a client can subscribe to notifications with a given name, the
             server must be configured with a node with a matching name.
    

    因此,首先必须创建节点,然后才能侦听给定名称的通知。否则,您不会收到通知。

    当没有XMMP守护进程运行时(即端口5222关闭),我会收到此错误。那个港口对你开放吗(检查输出 nmap -p 5222 push.example.com