杂谈

利用通知实现App从推送消息启动的页面跳转

2015-08-06  本文已影响1015人  952625a28d0d
@property (nonatomic) BOOL isLaunchedByNotification;```
- 在启动页注册接收消息的通知

// 订阅展示视图消息,将直接打开某个分支视图
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pushMessageVC:) name:@"pushMessageNotification" object:nil];```

- 在收到消息时给首页发送通知

pragma mark - iOS 7收到推送消息的系统回调方法

/**
 *  收到通知跳转页面
 *
 *  @param text 通知消息内容
 */
- (void)pushMessageVC:(NSNotification *)text{
    DLog(@"通知消息%@", text);
}```
上一篇 下一篇

猜你喜欢

热点阅读