zoukankan      html  css  js  c++  java
  • JPush使用时问题注意

    1集成JPush后,能收到通知,但是收不到自定义消息。

    解决方案:

    AppDelegate中加入如下代码:

    //JPush推送

        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];

    并实现方法:

    - (void)networkDidReceiveMessage:(NSNotification *)notification {

        NSDictionary * userInfo = [notification userInfo];

        NSLog(@"userInfo:%@",userInfo);

    }

    在测试就能收到网站上发送的自定义消息了。

    2能收到网站收到的自定义消息,但是收不到后台服务器发送的自定义消息(后台往指定id发送的)

    解决问题,设置别名

    [APService setTags:nil  alias:[YRAccountTool account].ID  callbackSelector:nil  target:self];

     将用户的id设置为别名(按后台需求),就能正常收到自定义消息了

  • 相关阅读:
    mongodb数组操作
    tmux使用心得
    redis设置key总结
    gitbook构建文档命令
    js中for in,of区别
    redis清除缓存和连接远程服务器
    Postman使用记录
    asp.net中导出Execl的方法
    CASE WHEN 用法
    js 字符串转换数字
  • 原文地址:https://www.cnblogs.com/guatiantian/p/4286797.html
Copyright © 2011-2022 走看看