NSInternalInconsistencyException: 'Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient)'

前端 未结 9 763
终归单人心
终归单人心 2020-12-15 02:42

I\'m trying to get my app working in Xcode 7 beta but I\'m hitting this exception:

NSInternalInconsistencyException: \'Invalid parameter not satisfying: !sta         


        
相关标签:
9条回答
  • 2020-12-15 03:40

    We have iOS App & Notification Widget + Watch App. Following code does not reside in Watchkit Extension just anywhere else:

    #if !EXTENSION self.startUpdatingLocationAllowingBackground() #endif

    We don't need to to query location or other business requirements, that are base for this app's overall setup in all domains (not just ADP/iTC).

    0 讨论(0)
  • 2020-12-15 03:47

    Other option: If you have selected background modes in targets -> Capabilities, make sure you have any of the backgound options selected. You tell Xcode that you're going to use something in the background, but then you do not tell it what you're going to use

    0 讨论(0)
  • 2020-12-15 03:48

    I've managed to solve this by doing these two things:

    • added UIBackgroundModes 'location' to Info.plist
    • added NSLocationAlwaysUsageDescription to Info.plist

    As of iOS 11, keys are named:

    • NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription
    0 讨论(0)
提交回复
热议问题