我有远程通知字典,但如何取出 AlertBody?
NSDictionary remoteNotification = options
[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary;
从远程通知?
我有远程通知字典,但如何取出 AlertBody?
NSDictionary remoteNotification = options
[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary;
从远程通知?
var k = new Object[] {"key"};
var v = new Object[] {"value"};
NSDictionary a = NSDictionary.FromObjectsAndKeys(v,k);
NSObject value = a[NSObject.FromObject("key")];
你可以试试这个它对我有用....
这对我有用:
发送推送通知:
oPushService.QueueNotification(NotificationFactory.Apple()
.ForDeviceToken("YourDeviceTokenASDASD!@#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.... }
希望能帮助到你!
阿曼多
这取决于您发送给应用程序的内容。基本上,它是您发送的转换为 NSDictionary 形式的 JSON 请求。