2012-07-05 30 views

回答

2

這個工作對我來說:

發送推送通知:

oPushService.QueueNotification(NotificationFactory.Apple() 
    .ForDeviceToken("[email protected]#SDF") 
    .WithCustomItem("MyCustomItem","Item 3") 
    .WithAlert("Alert pop message") 
    .WithSound("default") 
    .WithBadge(7))); 

在客戶端:

void processNotification(NSDictionary options, bool fromFinishedLaunching) {     
(options != null && options.ContainsKey(new NSString("aps"))) {  
    NSDictionary alertMsg = options; 
    NSObject codeCustomValue = alertMsg[NSObject.FromObject("MyCustomItem")]; 
    // .... and continue your code.... } 

何它有幫助!

阿曼多

0

這取決於您發送給應用程序的內容。基本上,這是您發送的JSON請求轉換爲NSDictionary表單。

2
 var k = new Object[] {"key"}; 
     var v = new Object[] {"value"}; 
     NSDictionary a = NSDictionary.FromObjectsAndKeys(v,k); 
     NSObject value = a[NSObject.FromObject("key")]; 

U可以試試這個,它的工作對我來說....