2013-12-20 3 views
1

내 iOS 7 앱에서 사진을 볼 수있는 권한을 요청하지 않습니다. 내 장치에서 응용 프로그램을 삭제 한 다음 xcode를 다시 설치하여 장치에 설치하면 응용 프로그램이 시작될 때마다 개인 정보 설정을 확인할 수 있으며 결코받지는 않았지만 사진에 대한 액세스 권한이 있음을 보여줍니다 위치 서비스를 요청하는 메시지 상자. 나는 한 순간에 내 애플 리케이션 및 그 검은 이미지 미리보기를 표시하는 데 문제가있는 모달로 표시되는 imagepicker 있고이 사진 액세스 문제로 인한 것으로 믿습니다.ios7 앱이 사진에 액세스 할 수있는 권한을 요청하지 않습니다.

왜 이런 일이 일어나는 지 알고 계십니까?

편집 : 또한 내 앱이 시작된 후 개인 정보 보호 설정으로 이동하여 사진 권한을 on에서 off로 변경하면 앱이 다운됩니다. 경고 또는 오류가 발생하지 않고 충돌 만 발생합니다.

+0

가 http://stackoverflow.com/보기 질문/13635288/ios-calendar-access-permission-dialog-force-it-to-appear/13693935 # 13693935 이는 모든 개인 정보 설정에 적용됩니다. – rmaddy

+0

또한 "편집"에 대한 정보는 http://stackoverflow.com/questions/12810638/app-crashed-in-ios-6-when-user-changes-contacts-access-permissions/12810719#12810719를 참조하십시오. – rmaddy

+0

@rmaddy, 흥미 롭습니다. 도와 주셔서 감사합니다! – Stonep123

답변

0

비슷한 문제가있었습니다. 의 Info.plist에서 NSPhotoLibraryUsageDescription 키를 생성하는 것은이 문제를 해결하지만, 그렇지 않은한다, 여기에 프로그램의 수정입니다 :

func photoLibraryAvailabilityCheck() { 
    let status = PHPhotoLibrary.authorizationStatus() 
    if (status == PHAuthorizationStatus.authorized) { 
     print("PHAuthorizationStatus.authorized") 
    }  else if (status == PHAuthorizationStatus.denied) { 
     print("PHAuthorizationStatus.denied") 
     requestPhotosLibraryAccess() 
    }  else if (status == PHAuthorizationStatus.notDetermined) { 
     print("PHAuthorizationStatus.notDetermined") 
     requestPhotosLibraryAccess() 
    }  else if (status == PHAuthorizationStatus.restricted) { 
     print("PHAuthorizationStatus.restricted") 
    } 
} 

func requestPhotosLibraryAccess() { 
    PHPhotoLibrary.requestAuthorization({ (newStatus) in 
     if (newStatus == PHAuthorizationStatus.authorized) { 
      print("pressed the allowed button") 
     }  else { 
      print("pressed the don't allow button") 
     } 
    }) 
} 

사용하기 :

photoLibraryAvailabilityCheck() 
관련 문제