File Download plugin for iPhone - Phonegap
How can I download a file from an URL to the iPhone file system with Phonegap?! I'm trying to use this plugin from clearlyinnovative but开发者_StackOverflow中文版 it doesn't support the last version of phonegap. Any ideas?!
The plugin from clearlyinnovative does actually support the latest phonegap, with a few changes. You are REALLY close to having this work perfectly. Recently, phonegap made some changes to their plugin structure. I think these are all of the changes that you will need to make. (assuming you have latest phonegap installed)
PixFileDownload.h:
Change:
#import "PhoneGapCommand.h"
To:
#import <PhoneGap/PGPlugin.h>
Change:
@interface PixFileDownload : PhoneGapCommand {
To:
@interface PixFileDownload : PGPlugin {
PixFileDownload.m:
Change:
-(PhoneGapCommand*) initWithWebView:(UIWebView*)theWebView
To:
-(PGPlugin*) initWithWebView:(UIWebView*)theWebView
Also, you need to add an entry to the PhoneGap.plist to let the system know about your plugin.
Add
PixFileDownload String PixFileDownload
to the plist file.
Hope this helps, let me know if you run into any errors, i have the working copy and the old version both in front of me, so I can help.
An up to date version can be found at: https://github.com/halool/PixFileDownload-Plugin
Compiles perfectly with PhoneGap 1.4.1 on XCode 4.2.1
精彩评论