2013-08-30 4 views
1

Phonegap에서 첫 번째 응용 프로그램을 만들고 있습니다. FileOpener, Downloader 및 stausBarNotification과 같은 플러그인을 만들었습니다. 플러그인은 다음과 같습니다phonegap 사이트에서 플러그인을 제출하는 방법은 무엇입니까?

FileOpener.js은 다음과 같이이다 :

cordova.define("cordova/plugin/fileopener", 
      function(require, exports, module) { 
      var exec = require("cordova/exec"); 
      var FileOpener = function() {}; 

     FileOpener.prototype.open = function(url) { 
      exec(null, null, "FileOpener", "openFile", [url]); 
     }; 

     var fileOpener = new FileOpener(); 
      module.exports = fileOpener; 

     }); 
     /** 
     * Load Plugin 
     */ 
     if (!window.plugins) { 
      window.plugins = {}; 
     } 
     if (!window.plugins.fileOpener) { 
      window.plugins.fileOpener = cordova.require("cordova/plugin/fileopener"); 
     } 

Downloader.js은 다음과 같이이다 : 나는 약간의 자바 파일을 만들었습니다

cordova.define("cordova/plugin/downloader", 
    function(require, exports, module) { 
    var exec = require("cordova/exec"); 
    var Downloader = function() {}; 

Downloader.prototype.downloadFile = function(fileUrl, dirName, fileName, overwrite, win, fail) { 
    navigator.notification.alert('url: '+fileUrl+' to dir: '+dirName + ' to file: '+fileName); 
    if (overwrite == false) 
     overwrite = "false"; 
    else 
     overwrite = "true"; 
    exec(win, fail, "Downloader", "downloadFile", [ fileUrl, dirName, fileName, overwrite ]); 

}; 
var downloader = new Downloader(); 
    module.exports = downloader; 

}); 
if (!window.plugins) { 
    window.plugins = {}; 
} 
if (!window.plugins.downloader) { 
    window.plugins.downloader = cordova.require("cordova/plugin/downloader"); 
} 

그리고 구현도 마찬가지다. 이제 안드로이드 장치에서 예상대로 실행 중입니다. 하지만 지금은 iOS 용으로 동일한 프로젝트를 원합니다. build.phonegap.com이 나를 위해이 작업을 수행하길 원합니다.

<gap:plugin name="FileOpener" value="com.phonegap.plugins.fileOpener.FileOpener"/> 
<gap:plugin name="Downloader" value="com.phonegap.plugins.downloader.Downloader"/> 
<gap:plugin name="StatusBarNotification" value="com.phonegap.plugins.statusBarNotification.StatusBarNotification"/> 

지금 당장은 :

는이 같은 config.xml에에서 플러그인을 포함했다? phonegap.com에 플러그인을 제출하라는 기사를 읽었는데 어떻게해야합니까? iPhone에서 Android 기기와 동일한 프로젝트를 실행할 수 있습니까? 사전에 도움을 주셔서 감사합니다.

답변

관련 문제