Commit 58b8a57d by Rene Floor

Implement macro for bluetooth

parent 43df33ca
...@@ -101,6 +101,9 @@ You can remove permissions you don't use: ...@@ -101,6 +101,9 @@ You can remove permissions you don't use:
## dart: PermissionGroup.sensors ## dart: PermissionGroup.sensors
# 'PERMISSION_SENSORS=0' # 'PERMISSION_SENSORS=0'
## dart: PermissionGroup.bluetooth
# 'PERMISSION_BLUETOOTH=0'
] ]
end end
...@@ -128,6 +131,7 @@ You can remove permissions you don't use: ...@@ -128,6 +131,7 @@ You can remove permissions you don't use:
| PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS | | PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS |
| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMediaLibrary | PERMISSION_MEDIA_LIBRARY | | PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMediaLibrary | PERMISSION_MEDIA_LIBRARY |
| PermissionGroup.sensors | NSMotionUsageDescription | PERMISSION_SENSORS | | PermissionGroup.sensors | NSMotionUsageDescription | PERMISSION_SENSORS |
| PermissionGroup.bluetooth | NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription | PERMISSION_BLUETOOTH |
4. Clean & Rebuild 4. Clean & Rebuild
</details> </details>
......
...@@ -88,6 +88,13 @@ ...@@ -88,6 +88,13 @@
#define PERMISSION_SENSORS 1 #define PERMISSION_SENSORS 1
#endif #endif
// ios: PermissionGroupBluetooth
// Info.plist: [NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription]
// dart: PermissionGroup.bluetooth
#ifndef PERMISSION_BLUETOOTH
#define PERMISSION_BLUETOOTH 1
#endif
typedef NS_ENUM(int, PermissionGroup) { typedef NS_ENUM(int, PermissionGroup) {
PermissionGroupCalendar = 0, PermissionGroupCalendar = 0,
PermissionGroupCamera, PermissionGroupCamera,
......
...@@ -6,9 +6,20 @@ ...@@ -6,9 +6,20 @@
// //
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "PermissionStrategy.h" #import "PermissionStrategy.h"
#if PERMISSION_BLUETOOTH
#import <CoreBluetooth/CoreBluetooth.h>
@interface BluetoothPermissionStrategy : NSObject <PermissionStrategy> @interface BluetoothPermissionStrategy : NSObject <PermissionStrategy>
@end @end
#else
#import "UnknownPermissionStrategy.h"
@interface BluetoothPermissionStrategy : UnknownPermissionStrategy
@end
#endif
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#import "BluetoothPermissionStrategy.h" #import "BluetoothPermissionStrategy.h"
#if PERMISSION_BLUETOOTH
@implementation BluetoothPermissionStrategy @implementation BluetoothPermissionStrategy
...@@ -48,3 +49,10 @@ ...@@ -48,3 +49,10 @@
} }
} }
@end @end
#else
@implementation BluetoothPermissionStrategy
@end
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment