Log in or register to post comments

IOS7 problem

October 8, 2013 - 7:06pm #1

Hi ,

   My app is basic on the videoplayback sample, it could run normal in IOS6, but when run in IOS7,  it will show the warning(as attachment). So I should choose "ok" for "UsrDefTarget" using the camera, then close the app( and also close the app in background too)  and run it again,  it is normal . How could I solve the problem, pls help~~~~~~

tks a lot

 

AttachmentSize
Image icon IMG_0452.PNG26.89 KB

IOS7 problem

October 10, 2013 - 8:45pm #10

Thanks NalinS very much!

      I will try this first.....

IOS7 problem

October 10, 2013 - 8:00am #9

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

IOS7 problem

October 9, 2013 - 7:05pm #8

[EDIT - when it runs the first time, does it show a black screen?]

------> no, only stop in the first screen . The problem only occur in the first install ,but it make  my app was rejected by APPLE .

 

I think the reason is : when the app run, the SDK will initialize the environment ( include camera), but in the meanwhile,

IOS alert the message in the other session, the SDK will not get the result from the message, so  the problem was occured.

 how could solve it?

 

 

 

 

 

IOS7 problem

October 9, 2013 - 7:39am #7

If you check the Apple release notes for iOS7:

https://developer.apple.com/library/ios/releasenotes/General/RN-iOSSDK-7.0/

...it states:

 For devices sold in China, iOS will also request user consent for apps to use the camera hardware

 

This should answer your question, though why it does not run the first time I am not sure.

[EDIT - when it runs the first time, does it show a black screen?]

 

N

IOS7 problem

October 9, 2013 - 7:27am #6

Thanks for your reply. My problem is:

1.  I install and run the QCAR sample in IOS7 first time, it will show the message ,ask me whether the app could use the carema. I choose YES.

2. Then the app will stop in the first screen ,it will not show the carema view

3. I should close the app and start the app again.

4. the app will run normal.

5. the problem will not occur again when install the app in  second time.

why the app could not run normal in the first time in IOS7 ?

 

IOS7 problem

October 9, 2013 - 2:24am #5

This is most likely a change in iOS 7 to do with Camera privacy permissions:

http://en.wikipedia.org/wiki/IOS_7

search for "Per app using camera privacy permission."

 

N

IOS7 problem

October 9, 2013 - 2:02am #4

Sorry, the system is Chinese.  But the message meaning  is  "UsrDefTarget want to use your camera ----> NO , Yes". I should choose the yes ,then close

the app , and the second time ,the app will run normal

IOS7 problem

October 9, 2013 - 1:54am #3

Could you please try posting a picture of the message in English?

thanks

N

IOS7 problem

October 8, 2013 - 10:57pm #2

Sorry, I did not say clearly. The picture is from the sample "User-Defined Targets".

I found all QCAR samples will show the warning when run in IOS7 .Anybody could help ?

 

 

Log in or register to post comments