Unity iOS - Asking for bluetooth permission

Viewed 246

I want to ask for bluetooth permission in my Unity application on iOS. I've set up permissions for camera/location so i know i got the plugin part working, but i've so far not found a good way to ask for bluetooth.

For example, this is how the camera permission looks:

NSString *mediaType = AVMediaTypeVideo;
// ask for permission
[AVCaptureDevice requestAccessForMediaType:mediaType completionHandler:^(BOOL granted) {
        if(granted)
        {
            UnitySendMessage(([NSGameObject cStringUsingEncoding:NSUTF8StringEncoding]), ([NSCallback cStringUsingEncoding:NSUTF8StringEncoding]), "allowed");
        } 
        else 
        {
            UnitySendMessage(([NSGameObject cStringUsingEncoding:NSUTF8StringEncoding]), ([NSCallback cStringUsingEncoding:NSUTF8StringEncoding]), "denied");
        }
}];

Is there a similar way to ask for bluetooth?

0 Answers
Related