Ok, we tried to reproduce this problem by setting a device to Chinese, however we could not, meaning that it probably only occurs on Chinese firmware.
So the current thinking is that you may be able to get around this problem by asking the user for specific permission to use the camera somewhere in your app before Vuforia starts.
So you need to write some code before the application starts along the lines posted at this link:
http://stackoverflow.com/questions/18930436/ios-7-uiimagepickercontroller-camera-no-image
...probably something like this:
NSString *mediaType = AVMediaTypeVideo;
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];
// This status is normally not visible—the AVCaptureDevice class methods for discovering devices do not return devices the user is restricted from accessing.
if(authStatus == AVAuthorizationStatusRestricted){
NSLog(@"Restricted");
}
// The user has explicitly denied permission for media capture.
else if(authStatus == AVAuthorizationStatusDenied){
NSLog(@"Denied");
}
// The user has explicitly granted permission for media capture, or explicit user permission is not necessary for the media type in question.
else if(authStatus == AVAuthorizationStatusAuthorized){
NSLog(@"Authorized");
// OK TO START VUFORIA APPLICATION
}
// Explicit user permission is required for media capture, but the user has not yet granted or denied such permission.
else if(authStatus == AVAuthorizationStatusNotDetermined){
[AVCaptureDevice requestAccessForMediaType:mediaType completionHandler:^(BOOL granted) {
if(granted){
NSLog(@"Granted access to %@", mediaType);
// OK TO START VUFORIA APPLICATION
}
else {
NSLog(@"Not granted access to %@", mediaType);
}
}];
}
else {
NSLog(@"Unknown authorization status");
}
You probably need to put this code somewhere in application startup:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
and this must happen before Vuforia gets initialised. So what you could do is set a flag if it is ok to start Vuforia, and then continue to run if this is the case, otherwise exit the application.
Let me know how you get on.
N
Thanks NalinS very much!
I will try this first.....