Code Monkey home page Code Monkey logo

pixfiledownload-plugin's Introduction

Notice: this plugin is tested on phonegap 1.3.0 xcode 4.1 debugger shows no error

How to Install

  1. download the plugin ,Open your Xcode project, Right-click on the Plugins folder in Xcode and select “Add Files to…”.

  2. select the pixFileDownload folder. Check “Copy items into. . .” and “Create groups for. . .”

  3. Copy/Paste the pixFileDownload.js file from the pixfiledownload folder to the www folder (or where ever you are placing your js files).

  4. in you index.html file add this line in the head section:

		<script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script>
        <script type="text/javascript" charset="utf-8" src="pixFileDownload.js"></script>
		<script type="text/javascript">
    
              function onBodyLoad()
              {		
                   document.addEventListener("deviceready", onDeviceReady, false);
               }
              /* When this function is called, PhoneGap has been initialized and is ready to roll */
              /* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch.
              see http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
              for more details -jm */
              function onDeviceReady()
	                {   
	                    // do your thing!
                        fileDownloadMgr.downloadFile(url,filepath);
						//url :refers to the file url
						//filepath : path for downloaded file (be sure to put /www/your downloadfolder name/filename)
	                }
		 </script>
  1. add the plugin to your PhoneGap,plist file found in (Supporting Files > PhoneGap.plist) :
	Key: PixFileDownload
	Type: String
	Value: PixFileDownload
  1. now we need to add the pixfiledownload declaration to AppDelegate.m found in (Classes > AppDelegate.m) your file should look like this

so it looks like this now:

	#import "AppDelegate.h"
	#ifdef PHONEGAP_FRAMEWORK
		#import <PhoneGap/PhoneGapViewController.h>
	#else
		#import "PhoneGapViewController.h"
	#endif

	#import "PixFileDownload.h"

	@implementation AppDelegate

now the plugin is ready to work

Important Notice:

Orginal work can be found in https://github.com/aaronksaunders/FileDownLoadApp

fixes taken from:

pixfiledownload-plugin's People

Contributors

halool avatar sebastian-meier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.