开发者

NSServerNotificationCenter and a Linux server

In one of my Mac apps, I have the need of having PUSH notifications. Instead of using some custom solution, I thought I might as well give NSServerNotificationCenter a try. Apple's docs mention a notificationconf command, which my Ubuntu server does not have. The docs also mention that NSS开发者_如何学JAVAerverNotificationCenter uses XMPP.

My question is basically this - I have ejabberd running on my server, could I just connect to that from my code? How would I post a notification to a user using this? I also need a way to let my NSServerNotificationCenter know my user's credentials - I presume I would do this using an NSTask and run notificationconf setpass hostname username.

Does anyone know how I should go about setting this up? I also need to find a way to create a new ejabberd user when a user is registered through PHP, but that should be no problem.

Then again, if this isn't possible too easily, is there another way of doing push notifications on the Mac with an Ubuntu server running the server part?

Thanks for any responses, this topic is seriously confusing me.


My experience with this class suggests that it is really only meant to communicate with an OS X Server (i.e. Mac running the server package/version of the OS) and only meant to do push notifications for Mail and iCal. Very limited!

But XMPP is definitely the way to do push notifications here! I suggest you check out the XMPPframework project from the Deusty guys. It's a Cocoa implementation of XMPP and should work nicely with ejabberd (though I use OpenFire).

There are also a handful of PHP-XMPP frameworks. Check out xmpphp on Google Code.

Lot's more information for other frameworks and languages here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜