用極光推送,如果不透過點擊推播的通知進入app,而是透過點擊app圖示進入app, 那麼怎麼取得它已經推播過的訊息?
淡淡烟草味2017-04-26 09:04:16
已經找到答案,這個在行動端,我們要加入 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];
然後實作方法- (void)networkDidReceiveMessage:(NSNotification *)notification;接著在伺服器端需要在極光推播提供的sdk中填入發給app的訊息,並不是給apns的
進而就可以在 networkDidReceiveMessage方法中透過notification.userInfo取得到