How to use notificationconf?

I read the IT tutorial on creating push nodes and publishing / subscribing to notifications. The only problem I ran into is that it seems that notificationconf unable to create this node ...

My first question is: nodename ( notificationconf tool parameter) and notificationName ( NSString , which I use from the application) are the same things?

The second:

 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) 

How am I wrong? And sending notifications from the application does nothing ...

Thanks for any help!

+4
source share
2 answers

I am trying to use the Snow Leopard Server release notification service using a special application based on the XMPP Publish-Subscribe. I struggled to create a node, but finally figured it out.

  • Track the password for the com.apple.notificationuser service account. You can find it, for example, in /private/etc/dovecot/notify/notify.plist .

  • Connect to your push notification server with a JID com.apple.notificationuser@your-chat-server-hostname.com and this password.

  • Create nodes in the usual way. In XMPPFramework, it looks like this:

     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]; 
  • The server creates a node. It answers iq, but not the one that the specification requires. It sends a compatible error if node already exists.

     <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"/> 
  • Connect to the same user to post your updates.

I never managed to work notificationconf .

+1
source

Notifications are easy to use on the same node, but harder on the network. In particular, I donโ€™t think that too many people actually use it, because Googleโ€™s search results are limited :) Now, regarding your questions:

For 1: yes, you need to have nodename and notificationName matching. This page says this (though not crystal clear):

  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. 

So, first you need to create a node, after which you can listen to notifications with the given name. Otherwise, you will not receive a notification.

For 2: I get this error when the XMMP daemon is not working (i.e. port 5222 is closed). Is this port open to you? (check the output of nmap -p 5222 push.example.com ).

+1
source

Source: https://habr.com/ru/post/1299235/


All Articles