SLProject  4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SENSiOSPermissions.mm
Go to the documentation of this file.
1 #include "SENSiOSPermissions.h"
2 
4 {
5  _gps = gps;
6 }
7 
9 {
10  // cannot ask for permissions a second time,
11  // so only here to complete the interface
12 
13  if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined)
14  {
16  }
17 }
18 
20 {
21  bool result = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] ==
22  AVAuthorizationStatusAuthorized;
23 
24  return result;
25 }
26 
28 {
29  bool result =
30  [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedAlways ||
31  [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse;
32 
33  return result;
34 }
35 
37 {
38  // no special permissions required (as far as I could tell...)
39 
40  return true;
41 }
42 
44 {
45  // no special permissions required
46 
47  return true;
48 }
49 
51 {
52  // iOS will only prompt users for permissions once. After they have to manually
53  // change permissions in the settings.
54  bool result = false;
55 
56  return result;
57 }
58 
60 {
61  // iOS will only prompt users for permissions once. After they have to manually
62  // change permissions in the settings.
63  bool result = false;
64 
65  if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined)
66  {
67  result = true;
68  }
69 
70  return result;
71 }
72 
74 {
75  // iOS will only prompt users for permissions once. After they have to manually
76  // change permissions in the settings.
77  bool result = false;
78 
79  return result;
80 }
81 
83 {
84  // iOS will only prompt users for permissions once. After they have to manually
85  // change permissions in the settings.
86  bool result = false;
87 
88  return result;
89 }
90 
92 {
93  bool result =
94  [CLLocationManager locationServicesEnabled];
95 
96  return result;
97 }
98 
100 {
101  UIApplication* application = [UIApplication sharedApplication];
102  NSURL* url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
103 
104  if ([application canOpenURL:url])
105  {
106  [application openURL:url options:@{} completionHandler:^(BOOL sucess){}];
107  }
108 }
void askPermission()
Definition: SENSiOSGps.mm:37
SENSiOSPermissions(SENSiOSGps *gps)
bool canShowInternetPermissionDialog()