2014-10-07 3 views
0

Meteor와 PhoneGap 통합을 사용하기 시작했으며 플러그인 작동에 문제가 있습니다. 누군가가 카메라 플러그인을 사용하는 방법 아래 단계를 제공 할 수 있습니까? 현재 시뮬레이터에서만 실행 중입니다. 코드는 다음과 같습니다. 미리 감사드립니다. Meteor-PhoneGap Plugin 사용 방법

나는 다음과 같이 카메라 플러그인을 추가 : 유성 코르도바 추가 [email protected] 다음

그것을 사용하는 나는 다음과 같은 코드가 있습니다

if (Meteor.isClient) { 

    Template.hello.events({ 
    'click button': function() { 
     // increment the counter when button is clicked 
     navigator.camera.getPicture(
     function(data){ Session.set("picture", res); }, 

     function(err){ console.log(err); }, 

     { 
      quality: 50, 
      destinationType: Camera.DestinationType.DATA_URL 
     } 
    ); 
    } 
    }); 
} 

if (Meteor.isServer) { 
    Meteor.startup(function() { 
    // code to run on server at startup 
    }); 
} 

나는이 오류를 얻을 버튼을 클릭 :

I20141006-21:58:33.174(-7)? (ios) Camera.getPicture: source type 1 not available. 
I20141006-21:58:33.222(-7)? (ios) no camera available 
+0

나는 아이폰 시뮬레이터는 GPS 또는 사진을 수 있습니다 생각하지 않는다. Chrome에서 두 가지 작업을 모두 수행 할 수 있습니다. – CodeChimp

+0

@CodeChimp이 코드는 Android 에뮬레이터에서 카메라를 시작하지만 브라우저에서는 작동하지 않습니다. 이견있는 사람? –

+0

몇 주 전에 내 질문보기 : http://stackoverflow.com/questions/26182267/error-while-taking-pictures-using-meteorcamera-getpicture-while-testing-on-a-l – CodeChimp

답변

0

따르면 유성 - 코르도바 - 폰갭 통합 문서를

Any functionality which relies on a Cordova/Phonegap plugin should wrap code in a Meteor.startup() block

문서 link here

관련 문제