Commit 58b8a57d by Rene Floor

Implement macro for bluetooth

parent 43df33ca
......@@ -101,6 +101,9 @@ You can remove permissions you don't use:
## dart: PermissionGroup.sensors
# 'PERMISSION_SENSORS=0'
## dart: PermissionGroup.bluetooth
# 'PERMISSION_BLUETOOTH=0'
]
end
......@@ -128,6 +131,7 @@ You can remove permissions you don't use:
| PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS |
| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMediaLibrary | PERMISSION_MEDIA_LIBRARY |
| PermissionGroup.sensors | NSMotionUsageDescription | PERMISSION_SENSORS |
| PermissionGroup.bluetooth | NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription | PERMISSION_BLUETOOTH |
4. Clean & Rebuild
</details>
......
......@@ -88,6 +88,13 @@
#define PERMISSION_SENSORS 1
#endif
// ios: PermissionGroupBluetooth
// Info.plist: [NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription]
// dart: PermissionGroup.bluetooth
#ifndef PERMISSION_BLUETOOTH
#define PERMISSION_BLUETOOTH 1
#endif
typedef NS_ENUM(int, PermissionGroup) {
PermissionGroupCalendar = 0,
PermissionGroupCamera,
......
......@@ -6,9 +6,20 @@
//
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "PermissionStrategy.h"
#if PERMISSION_BLUETOOTH
#import <CoreBluetooth/CoreBluetooth.h>
@interface BluetoothPermissionStrategy : NSObject <PermissionStrategy>
@end
#else
#import "UnknownPermissionStrategy.h"
@interface BluetoothPermissionStrategy : UnknownPermissionStrategy
@end
#endif
......@@ -7,6 +7,7 @@
#import "BluetoothPermissionStrategy.h"
#if PERMISSION_BLUETOOTH
@implementation BluetoothPermissionStrategy
......@@ -48,3 +49,10 @@
}
}
@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