OGeek|极客世界-中国程序员成长平台

标题: c# - 单点触控 : getting NSDictionary value [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 21:50
标题: c# - 单点触控 : getting NSDictionary value

我有远程通知字典,但如何取出 AlertBody?

NSDictionary remoteNotification = options 
     [UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary;

来自远程通知?



Best Answer-推荐答案


这对我有用:

发送推送通知:

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....  }

希望对你有帮助!

阿曼多

关于c# - 单点触控 : getting NSDictionary value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11336527/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4