|
@@ -58,23 +58,20 @@
|
58
|
58
|
toDate:[NSDate date]
|
59
|
59
|
toQueue:_operationQueue
|
60
|
60
|
withHandler:^(NSArray<CMMotionActivity *> * _Nullable activities, NSError * _Nullable error) {
|
61
|
|
- if (error != nil) {
|
62
|
|
- if (error.code != CMErrorNotAuthorized &&
|
63
|
|
- error.code != CMErrorMotionActivityNotAuthorized) {
|
64
|
|
- reject(error);
|
65
|
|
- } else {
|
66
|
|
- resolve(RNPermissionStatusDenied);
|
67
|
|
- }
|
68
|
|
- } else if (activities) {
|
69
|
|
- resolve(RNPermissionStatusAuthorized);
|
70
|
|
- } else {
|
71
|
|
- resolve(RNPermissionStatusNotDetermined);
|
|
61
|
+ if (error != nil && error.code != CMErrorNotAuthorized && error.code != CMErrorMotionActivityNotAuthorized) {
|
|
62
|
+ return reject(error);
|
72
|
63
|
}
|
73
|
64
|
|
74
|
|
- self->_operationQueue = nil;
|
75
|
|
- self->_activityManager = nil;
|
76
|
|
-
|
77
|
65
|
[RNPermissions flagAsRequested:[[self class] handlerUniqueId]];
|
|
66
|
+
|
|
67
|
+ if (error != nil) {
|
|
68
|
+ return resolve(RNPermissionStatusDenied);
|
|
69
|
+ }
|
|
70
|
+ if (activities) {
|
|
71
|
+ return resolve(RNPermissionStatusAuthorized);
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+ return resolve(RNPermissionStatusNotDetermined);
|
78
|
75
|
}];
|
79
|
76
|
}
|
80
|
77
|
|