mirror of
https://gitee.com/shuto/cordova-plugin-camera.git
synced 2025-04-26 22:40:11 +08:00
CB-10241 - App Crash cause by Camera Plugin ios 7
This commit is contained in:
parent
e1911a3c78
commit
e8fa1695c4
@ -163,9 +163,12 @@ static NSString* toBase64(NSData* data) {
|
|||||||
if (authStatus == AVAuthorizationStatusDenied ||
|
if (authStatus == AVAuthorizationStatusDenied ||
|
||||||
authStatus == AVAuthorizationStatusRestricted) {
|
authStatus == AVAuthorizationStatusRestricted) {
|
||||||
// If iOS 8+, offer a link to the Settings app
|
// If iOS 8+, offer a link to the Settings app
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
|
||||||
NSString* settingsButton = (&UIApplicationOpenSettingsURLString != NULL)
|
NSString* settingsButton = (&UIApplicationOpenSettingsURLString != NULL)
|
||||||
? NSLocalizedString(@"Settings", nil)
|
? NSLocalizedString(@"Settings", nil)
|
||||||
: nil;
|
: nil;
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
// Denied; show an alert
|
// Denied; show an alert
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
@ -216,7 +219,12 @@ static NSString* toBase64(NSData* data) {
|
|||||||
{
|
{
|
||||||
// If Settings button (on iOS 8), open the settings app
|
// If Settings button (on iOS 8), open the settings app
|
||||||
if (buttonIndex == 1) {
|
if (buttonIndex == 1) {
|
||||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wtautological-pointer-compare"
|
||||||
|
if (&UIApplicationOpenSettingsURLString != NULL) {
|
||||||
|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
|
||||||
|
}
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dismiss the view
|
// Dismiss the view
|
||||||
|
Loading…
x
Reference in New Issue
Block a user