zoukankan      html  css  js  c++  java
  • 推送消息,程序正在运行的时候弹出弹框问题解决

    在这个方法里面处理获取的远程推送消息

    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler

    {

     // 取得 APNs 标准信息内容

        NSDictionary *aps = [userInfo valueForKey:@"aps"];

        NSString *content = [aps valueForKey:@"alert"]; //推送显示的内容

           if (content.length != 0) {

             if ([userInfo valueForKey:@"webUrl"])

            {

                webUrl = [userInfo valueForKey:@"webUrl"];            

                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil

                                                                message:content

                                                               delegate:self

                                                      cancelButtonTitle:@"取消"

                                                      otherButtonTitles: @"去看看",nil];

                alert.tag = 10000;

                [alert show];

                

            }

            else

            {

                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil

                                                                message:content

                                                               delegate:nil

                                                      cancelButtonTitle:@"知道了"

                                                      otherButtonTitles: nil];

                [alert show];

            }

        }

     }

    注:有网页跳转带到网页

  • 相关阅读:
    gitment Error:validation failed错误解决办法
    Hexo博客yilia主题添加Gitment评论系统
    用DateTime的ParseExact方法解析特殊的日期时间
    C#中的日期处理函数
    SQL,Linq,Lambda之间的转换练习
    Windows Azure Platform 系列文章目录
    Linq查询表达式
    EF框架的三种工作方式
    jQuery UI 实现图片循环显示,常用于网站首页banner广告切换
    jQuery UI Datepicker
  • 原文地址:https://www.cnblogs.com/angongIT/p/5141786.html
Copyright © 2011-2022 走看看