Cordova + iOS 10: NSCameraUsageDescription missing, NSPhotoLibraryUsageDescription

얼마전까지 PhoneGap 과 Cordova 를 이용해서 iOS App을 만들고 있었는데 몇일전 기능을 수정할 일이 있어서 수정후 다시 앱스토어에 올릴려고 하니 아래와 같은 이메일을 받게 되었다.

Dear developer,

We have discovered one or more issues with your recent delivery for "Meals Delivered". To process your delivery, the following issues must be corrected:
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

해결 방법을 찾다 찾다 찾아내어서 해결 ^^
아래의 코드를 config.xml 에 넣어주고 PhoneGap 에서 컴파일 후 업로드하면 끝!!

<plugin name="cordova-plugin-media-capture" source="npm" spec="*">
	<variable name="CAMERA_USAGE_DESCRIPTION" value="App would like to access the camera." />
	<variable name="MICROPHONE_USAGE_DESCRIPTION" value="App would like to access the microphone." />
	<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="App would like to access the library." />
</plugin>

NSCameraUsageDescription, NSMicrophoneUsageDescription, NSPhotoLibraryUsageDescription 이 3가지 항목이 프라이버시 관련해서 문제가 발생하는 것으로 확인되었다.

마우스휠 Normalise

브라우져별로 마우스 휠이 스크롤될때의 값이 틀리기 때문에 경우에 따라서는 값을 보정해 주어야 하는 경우가 발생한다.

아래 코드는 브라우져별로 값을 보정해 주는 스크립트.

window.onload = function(){
	var wheelDistance = function(evt){
		if (!evt) evt = event;
		var w=evt.wheelDelta, d=evt.detail;
		if (d){
			if (w) return w/d/40*d>0?1:-1; // Opera
			else return -d/3;              // Firefox;         TODO: do not /3 for OS X
		} else return w/120;             // IE/Safari/Chrome TODO: /3 for Chrome OS X
	};
}