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设置为别名(按后台需求),就能正常收到自定义消息了

  • 相关阅读:
    Difference between sendRedirect, include, forward
    Selenium Study Notes
    Java基础知识2
    JSP上的JavaBeans
    Java Socket 7部曲
    Javascript版本排序1
    Java基础知识1
    JavaBean的属性
    测试基础
    annotation本质
  • 原文地址:https://www.cnblogs.com/guatiantian/p/4286797.html
Copyright © 2011-2022 走看看