Somewhat similar to When is didRegisterForRemoteNotificationsWithDeviceToken called?.
When the user first installed the app and it prompts whether t
Check the Application State inside the function didReceiveRegistrationToken
didReceiveRegistrationToken
let state = UIApplication.shared.applicationState if state == .background || state == .inactive { print("Background") } else if state == .active { print("foreground") }