|
function downloadOfApk(){
api.download({
url: 'http://downloadpkg.apicloud.com/app/download?path=http://**.**1.z0.glb**.**/1164331e18d313f565f107b7d740a8c7_d',
savePath: 'fs://123.apk',
cache:false,
allowResume:false,
report:true
}, function(ret, err) {
if(ret){
if(ret.state==0){
api.toast({
msg: "正在下载 " + ret.percent + "%",
duration: 2000
});
api.notification({
notify: {
content: "正在下载 " + ret.percent + "%",
updateCurrent: true
}
}, function(ret, err) {
api.cancelNotification({
id: ret.id
});
});
};
};
});
}; |
|