 import UIKit
 import UserNotifications
 
-class StoreViewController: UIViewController {
+class StoreViewController: UIViewController, UNUserNotificationCenterDelegate {
     var timer: Timer!
     var request: UNNotificationRequest!
 

        content.sound = UNNotificationSound.default()

        request = UNNotificationRequest(identifier: "normal", content: content, trigger: trigger)
    }

    override func didReceiveMemoryWarning() {


        let center = UNUserNotificationCenter.current()
        center.requestAuthorization(options: [.alert, .sound], completionHandler: { (granted, error) in })
        center.delegate = self // userNotificationCenter が呼ばれるようにするため
        createNotification()
    }

