0
푸시 알림을 위해 Swift 2.2에서 Swift 3.0으로 소스 코드를 업데이트했습니다. 그러나 나는 userinfo를 얻을 수 없다. nil을 반환합니다. 아무도 도와 줄 수 있습니까?알림 센터의 푸시 알림은 userinfo에서 nil을 반환합니다. - Swift3
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
NotificationCenter.default.addObserver(self, selector: #selector(MenuViewController.remoteNotificationReceived(_:)), name: NSNotification.Name(rawValue: "PushNotificationMessageReceivedNotification"), object: nil)
}
func remoteNotificationReceived(_ notification: Notification)
{
print("Notification:\(notification.userinfo)");
}
한번보기 http://stackoverflow.com/q 39382852/didreceiveremotenotification-not-called-ios-10/39383027 # 39383027 –
사용자 정보를 보내려는 경우 NotificationCenter.default.post (이름 : notificationName, object : nil)에 아무 정보도 보내지 않습니다. – AleyRobotics
이 NotificationCenter.default.post (이름 : notificationName, 개체 : SOME_USER_INFO_OBJ) – AleyRobotics