I would like to debug my following code under NotificationContentExtension
. It's not working. Even print statement is not working. I tried to also add blur effect for my custom view. This is not working. I also put a break point on the specific line, it's also not working.
Please check the following code.
import UIKit
import UserNotifications
import UserNotificationsUI
class NotificationViewController: UIViewController, UNNotificationContentExtension {
@IBOutlet var label: UILabel?
override func viewDidLoad() {
super.viewDidLoad()
let blurEffect = UIBlurEffect(style: .extraLight)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = self.view.frame
print("blurEffect") // Can't see this on my console
self.view.insertSubview(blurEffectView, at: 0) //not working blur effect
}
func didReceive(_ notification: UNNotification) {
if let number = notification.request.content.userInfo["customNumber"] as? Int {
label?.text = "\(number)"
print("didReceive") // Can't see this on my console
}
}
}