swift - CoreMotion authorization problems -


i developing app use combination of 3 libraries: corelocation, coremotion , healthkit.

my issue when initialize corelocation , healthkit, the dialog allow authorization. however, coremotion, don't dialog asking authorization, error "cmerrordomain=105" (ie. access denied). privacy settings "motion & fitness" not show entry app. nor privacy settings app show entry related motion. have wiped testing device several times eliminate pre-existing setting.

app built ios 9.2 using swift 2.1. tested on 5s , 6s+, identical results (no authorization dialog)

here code used test whether pedometer available , whether can gather data (ie. allowed). "pedometer" declared @ class scope. function (currently) attached button user triggered.

func checkcm() {         pedometer.querypedometerdatafromdate(nsdate(), todate: nsdate()) {             (data, error) -> void in             if error != nil {                //error handler                print(error?.description)              } else {                 // no errors!             }         }  } 

the confusing part function has been tested on bare-bones app, , works correctly (ie. dialog allow "motion & fitness" displayed), on same devices. relevant system settings configured expected, , other pedometer\cm apps work.

so issues app preventing coremotion authorization dialog displayed. there known "gotchas" or issues related working coremotion , authorization?

i had issue during week. during first launch of app dialog not showing up... error 105. me due info.plist somehow delete app bundle name... make sure have correct name in 1 ;)


Comments