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];

            }

        }

     }

    注:有网页跳转带到网页

  • 相关阅读:
    强关联二维材料1T—TaS2晶体
    超薄二维Mo2C晶体
    稀有的二维狄拉克材料
    大自然中的几何植物
    字符串的内建函数
    python数据模型(特殊方法)
    插入排序
    下载谷歌浏览器(Chrome)扩展离线安装包crx文件最简单的方法
    33. 高精度练习之乘法
    32. 整数加法
  • 原文地址:https://www.cnblogs.com/angongIT/p/5141786.html
Copyright © 2011-2022 走看看