Home  >  Q&A  >  body text

objective-c - 用极光推送,如果不通过点击推送的通知进入app,而是通过点击app图标进入app, 那么怎么获取它已经推送过的消息?

用极光推送,如果不通过点击推送的通知进入app,而是通过点击app图标进入app, 那么怎么获取它已经推送过的消息?

黄舟黄舟2704 days ago503

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-04-26 09:04:16

    The answer has been found. This is on the mobile side. We need to add [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];

    Then implement the method - (void)networkDidReceiveMessage:(NSNotification *)notification;

    Then on the server side, you need to fill in the message sent to the app in the SDK provided by Aurora Push, not to apns

    Then you can get it through notification.userInfo in the networkDidReceiveMessage method

    reply
    0
  • Cancelreply