New Posts New Posts RSS Feed: Push Notifications
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Push Notifications

 Post Reply Post Reply
Author
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Topic: Push Notifications
    Posted: 17-Mar-2010 at 1:07pm
Hi Mike,
 
You can pass client-specific arguments (in the last parameter clientArgs shown below) when registering the callback:
 
        public void RegisterCallback(ServerNotifyDelegate serverDelegate, ClientNotifyDelegate clientDelegate,
                                                     Object userToken, params Object[] clientArgs)
 
These clientArgs are stored with the NotificationSubscriber, which is available to the service.  So for that sample, you could do something like this to get the arguments for each subscriber:

        foreach (var subscriber in __notificationManager.GetSubscribers(__serviceKey)) {
          var args = subscriber.ClientArguments;
        }
Hope this helps!
 
Back to Top
mbevins1 View Drop Down
Newbie
Newbie


Joined: 16-Jan-2009
Posts: 27
Post Options Post Options   Quote mbevins1 Quote  Post ReplyReply Direct Link To This Post Posted: 15-Mar-2010 at 10:52am
I am testing Push Notifications using your 300WNF_ServerPushNotification example and have a question.  In this example, how can I pass unique arguments to the order watcher?  Mainly, what I need to due is create unique services for each operation, so if someone from operation 1 is logged in and subscribes to the NewOrderService, the CheckForNewOrders only looks for operation 1 orders, then if someone from operation 2 is logged in also, they only get operation 2 orders.
 
What I thought about doing, is creating a unique service key for each operation and then passing it to the neworderservice so it knows which orders to look for but I haven't been able to figure out how to pass a unique key to it.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down