Detecting user settings for Background App Refresh in iOS 7

前端 未结 3 779
南旧
南旧 2020-12-12 16:12

Starting with iOS 7, Apple\'s Multitasking APIs allow apps to run in three new Background Modes: Background fetch, Remote notification content, and Background transfer servi

3条回答
  •  忘掉有多难
    2020-12-12 16:56

    Updated for Swift 3 and iOS10:

    switch UIApplication.shared.backgroundRefreshStatus {
    case .available:
        print("Refresh available")
    case .denied:
        print("Refresh denied")
    case .restricted:
        print("Refresh restricted")
    }
    

提交回复
热议问题