iOS推送通知获取不到deviceToken

2019-11-02  本文已影响0人  迷路的小小

1. 确保证书没有问题

2. 确保推送已经注册

UIUserNotificationType myType = UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge;
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:myType categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
    [[UIApplication sharedApplication] registerForRemoteNotifications];

3. 删除所有证书

  1. 命令行 cd ~/Library/MobileDevice/Provisioning\ Profiles/
    命令行 rm *
  2. 注意一定要选择好描述文件,选对了就能对消息证书
上一篇 下一篇

猜你喜欢

热点阅读