点击推送消息跳转指定app里面的界面

pragma mark - 推送消息处理

  • (void)pushMessageHandleWithUserInfo:(NSDictionary *)userInfo {
    //角标清除
    [UMessage setBadgeClear:YES];
    UIApplication * application = [UIApplication sharedApplication];
    if (application.applicationIconBadgeNumber > 0) {
    application.applicationIconBadgeNumber -= 1;
    }
    //判断消息类型
    NSString *messageType = userInfo[@"type"];
    if ([messageType isEqualToString:@"commodityBackShelveNotify"]) {
    //跳转到商品详情界面
    //commodityId和后台返回定义的字段
    if (!kStringIsEmpty(userInfo[@"commodityId"])) {
    //跳转的界面
    YSCommodityDetailsVC *shopDetail = [[YSCommodityDetailsVC alloc]init];
    shopDetail.shopDetailID = userInfo[@"commodityId"];
    [self.tabBarController.selectedViewController pushViewController:shopDetail animated:YES];
    }
    }
    }

你可能感兴趣的:(点击推送消息跳转指定app里面的界面)