didRegisterForRemoteNotificationsWithDeviceToken called twice?

后端 未结 3 1916
南方客
南方客 2021-01-04 03:36

Somewhat similar to When is didRegisterForRemoteNotificationsWithDeviceToken called?.

When the user first installed the app and it prompts whether t

3条回答
  •  甜味超标
    2021-01-04 04:20

    Check the Application State inside the function didReceiveRegistrationToken

    let state = UIApplication.shared.applicationState
            if state == .background || state == .inactive {
                print("Background")
            } else if state == .active {
                print("foreground")
            }
    

提交回复
热议问题