This is a migrated thread and some comments may be shown as answers.

Base64 & Downgrading Icenium ion to 2.4.0

3 Answers 15 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mohammad
Top achievements
Rank 2
Mohammad asked on 09 Jul 2013, 08:05 AM
Cordova 2.7.0 has a problem with base64 and thus makes my application fails when trying to process images. Bug found in here
mail-archives.apache.org/mod_mbox/cordova-issues/201304.mbox/<JIRA.12644261.1366766957447.228283.1366935735616@arcas>
but when i try to down grade to 2.4.0 Icenium ion tells me that this version does  not supports 2.4.0 it only supports 2.7.0,
Is there any way to down grade cordova ? else where how can i fix this problem ?

3 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 09 Jul 2013, 10:38 AM
Hi Mohammad,

I have looked at the Cordova issue you have pointed out, but it seems to be resolved in 2.7. Shazron from the Cordova team has commented here, that the problem was in the clients code where FileEntry object was used instead of File. Can you please share a simple code snippet that illustrates the issue on your end?

Regarding Icenium Ion it works only with the latest version of Cordova that Icenium supports, which currently is 2.7, so if you want to use Ion you should use the latest version. For provisioned applications you can use only of the Cordova version that Icenium supports.

 

Hope this helps,
Stefan Dobrev
Telerik

Looking for tips & tricks directly from the Icenium team? Check out our blog!
Missed our first webinar, watch it here.
Share feedback and vote for features on our Feedback Portal.
0
Mohammad
Top achievements
Rank 2
answered on 09 Jul 2013, 12:27 PM
var imageToBase64 = function (name, it) {
        return new $.Deferred(function (def) {
            var gotFS = function (source) {
                source.root.getDirectory("images", { exclusive: false }, function (source) {
                    source.getFile(name, null, function (file) {
                        var reader = new FileReader();
                        reader.onloadend = function (e) {
                            console.log("loaded");
                            def.resolve([e.target.result.substr(23, e.target.result.length), it]);
                        };
                        reader.readAsDataURL(file);
                    }, error);
                }, error);
            };
            var error = function (error) {
                def.reject(error);
            };
            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, error);
        }).promise();
    };

here's my code its actually being loaded but the value is empty.
Ill try to use file instead of fileEntry and get back with the results. By the way my code works fine with 2.4.0
0
Accepted
Mohammad
Top achievements
Rank 2
answered on 09 Jul 2013, 12:44 PM
var imageToBase64 = function (name, it) {
        var def = new $.Deferred();
        var gotFS = function (source) {
            source.root.getDirectory("images", { exclusive: false }, function (source) {
                source.getFile(name, null, function (file) {
                    var reader = new FileReader();
                    reader.onloadend = function (e) {
                        def.resolve([e.target.result.substr(23, e.target.result.length), it]);
                    };
                    file.file(function (fileObj) {
                        reader.readAsDataURL(fileObj);
                    }, error);
                }, error);
            }, error);
        };
        var error = function (error) {
            def.reject(error);
        };
        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, error);
        return def.promise();
    };

WORKED LIKE A CRYSTAL !! THANKS!
Tags
Report a bug
Asked by
Mohammad
Top achievements
Rank 2
Answers by
Stefan Dobrev
Telerik team
Mohammad
Top achievements
Rank 2
Share this question
or