דרושים פרילנסרים לפתרון תקלה בפתיחת קובץ באנדרואיד (קורדובה)

פרויקט מס' 75216

Job Statistics

1 Bids
תקציב
עד 2,500 ₪
תוקף הפרויקט
דקות
טווח הצעות
300 ₪ - 300 ₪ לשעת עבודה
הצעה ממוצעת
300 ₪ לשעת עבודה

Job Info And Actions

תאריך פרסום: 04:34, 21 יולי, 2015
הצעות תתקבלנה עד: 06:55, 19 נובמבר, 2015
דרושים פרילנסרים לפתרון תקלה בפתיחת קובץ באנדרואיד (קורדובה)
אנו זקוקים לפרילנס עם נסיון ב-IONIC או לכל הפחות בCORDOVA
לפתרון הבאג הבא בדחיפות -

fileOpener does not work with Android for me, whereas it does work on iOS. I tested it with the following devices:
Note 3 with KitKat
Note 4 with Lolipop

The error I get on those devices is attached to this message. (notice the null value thats associated with cordova.file.documentsDirectory)
Why does cordova.file.documentsDirectory turns null on Android?

Here is my code:

var url = Documents.download($stateParams.documentId, false);
$scope.targetPath = cordova.file.documentsDirectory;
var docName = $stateParams.documentName;
docName = docName.split(".");
$scope.fileName = $stateParams.documentId+"-"+$stateParams.modifiedTime+"."+docName[docName.length-1];
var trustHosts = true
var options = {};

$cordovaFile.checkFile($scope.targetPath, $scope.fileName).catch(function(err) {
// file was not saved earlier
download();
}).then(function(object) {
if(angular.isObject(object)) {
$scope.current = 100;
// The file exists in cache
openFile();
}
});

function download()
{
$cordovaFileTransfer.download(url, $scope.targetPath+$scope.fileName, options, trustHosts)
.then(openFile, failed, function (progress) {
$timeout(function () {
$scope.current = Math.ceil((progress.loaded / progress.total) * 100);
})
});
}

function failed(err)
{
err.body = err.body || "An unknown error occured";
var dialog = $ionicPopup.show({
title: 'We feel embarrassed..',
subTitle: JSON.stringify(err.body),
scope: $scope,
buttons: [
{ text: 'Cancel' },
{
text: '<b>Try Again</b>',
onTap: function()
{
return "retry"
}
}
]
});
dialog.then(function(res) {
if(res && res == 'retry') {
download();
}
else {
$ionicHistory.goBack()
}
})
}

function openFile()
{
$cordovaFileOpener2.open(
$scope.targetPath+$scope.fileName
).then(function() {
console.info("FILE OPENED IN DEVICE SUCCESSFULLY (CACHE)")
}, function(err) {
failed();
});
}

תחומי הפרויקט

קבצי הפרויקט

הלקוח

עדכונים

Private Bid

הצעה פרטית
1 פרויקטים
הצעה מס' 988360
הוגש: 22 יולי 2015