[jira] [Commented] (CB-10562) hide() not working in latest splashscreen plug in 3.1.0 in iOS

2016-03-06 Thread Stanley Mason (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-10562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15182282#comment-15182282
 ] 

Stanley Mason commented on CB-10562:


I don't believe this is related to Ionic, but is a bug in the plugin.

To reproduce:
- Add  to config.xml
- Call navigator.splashscreen.hide() after 5 seconds or so 
(console.log(performance.now()) to get an exact timestamp
- The splashscreen will not hide until the 20 seconds are up

>From testing various versions of the plugin, I can see that the issue was 
>introduced by this commit: 
>https://github.com/apache/cordova-plugin-splashscreen/commit/ccb3c2f4533fa52da474c33a7adc5ab5a887a805

The code in the above commit does not take into account that an app may both 
manually hide the splashscreen and also have a timeout. Thus when the hide 
function is manually invoked, it will still wait SplashScreenDelay ms before 
hiding it. Unfortunately I do not know enough about iOS to be able to fix the 
issue. For now I am getting around the issue by removing the timeout entirely.

> hide() not working in latest splashscreen plug in 3.1.0 in iOS
> --
>
> Key: CB-10562
> URL: https://issues.apache.org/jira/browse/CB-10562
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin SplashScreen
>Affects Versions: 3.1.0
> Environment: OSX Yosemite, iOS 9, iPhone 6, XCode 7.2.1, Cordova 
> 4.0.1, IONIC app, latest Cordova & IONIC CLIs
>Reporter: Matthias Max
>Priority: Critical
>
> In version 3.0.0 the command navigator.splashscreen.hide(); works fine.
> With the new version 3.1.0 it simply doesn't close the splashscreen. The 
> splashscreen keeps on being displayed for the time set in the config.xml.
> config.xml:
>   
>   
>   
>   
>   
>   
>   
> JS:
> $ionicPlatform.ready(function() {
> // Hide splash screen
> if (navigator.splashscreen) {
>  navigator.splashscreen.hide();
> }
> });



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10796) In-call status bar causes content to shift down (as expected) then jump up again

2016-03-06 Thread Martin Baker (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-10796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15182278#comment-15182278
 ] 

Martin Baker commented on CB-10796:
---

I have no need to show and hide the statusbar at run time, so any fixes for 
bugs post 1.0.1 aren't relevant to my situation.

bq. So, according to you, if you have the StatusBarOverlaysWebView set to true, 
what means that the statusbar is over your app covering it, if the in-call 
statusbar appears, your content should be pushed 20 points down? why?

Because the in-call statusbar is always SOLID not transparent like the normal 
statusbar,  So yes the content should absolutely be pushed down by 20pt if the 
in-call status bar is shown. BUT after the content finishes its transition to 
move *down* it then jumps back *up* again by 20pt. How can that be considered 
correct functionality?

To recap, since I'm still not convinced you're understanding what I'm reporting:
1. This issue *doesn't* happen if I don't use statusbar plugin. That has to be 
taken as the benchmark.
2. It also *doesn't* happen if I use 1.0.1 version or earlier of the statusbar 
plugin
3. It *does* happen if I use 2.0.0 version or later of the statusbar plugin.

Since you asked, the reason I'm using the statusbar plugin is to change the 
status bar text to white as all my nav bars are black. However I'm now thinking 
it might be easier to remove the plugin and instead use cordova-custom-config 
to set the Info.plist value.

> In-call status bar causes content to shift down (as expected) then jump up 
> again
> 
>
> Key: CB-10796
> URL: https://issues.apache.org/jira/browse/CB-10796
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 3.8.0
>Reporter: Martin Baker
>  Labels: ios
> Attachments: statusbar-jump.m4v
>
>
> Issue happens with 2.0.0, 2.1.0 and 2.1.1 but works correctly in 1.0.1
> Create a new Cordova project. Add statusbar, device and console plugins.
> Run in iOS simulator and press Command-Y to toggle the enlarged "in-call 
> status bar".
> The page content slides down as expected but then immediately jumps back up, 
> so it is partially covered by the status bar.
> See attached screen capture.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-10799) Toolbar is shown in incorrect position if inappbrowser is shown when in-call status bar is active

2016-03-06 Thread Martin Baker (JIRA)
Martin Baker created CB-10799:
-

 Summary: Toolbar is shown in incorrect position if inappbrowser is 
shown when in-call status bar is active
 Key: CB-10799
 URL: https://issues.apache.org/jira/browse/CB-10799
 Project: Apache Cordova
  Issue Type: Bug
  Components: Plugin InAppBrowser
Affects Versions: 1.3.0
 Environment: iOS
Reporter: Martin Baker


If the in-call status bar is active when an inappbrowser is shown, and toolbar 
is set to top, then the toolbar is positioned 20pt lower than it should be and 
partially covers up the webview.

This does not happen if the inappbrowser is shown and *then* the in-call status 
bar is shown.

A similar but related problem happens if the toolbar is positioned at the 
bottom - there is a 20pt gap between the in-call status bar and the top of the 
webview. This suggests the issue is happening because the parent view is 
wrongly positioned 20pt lower than it should be in this situation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-10736) Resizes iOS viewport after document.readyState "complete"

2016-03-06 Thread Trent McNitt (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Trent McNitt updated CB-10736:
--
Environment: iOS 9.2.1, WKWebView  (was: iOS 9.2.1)
Description: 
Edit: This only occurs using WKWebview. It doesn't resize on UIWebView (at 
least when I tested it on an iOS 8 phone).

With StatusBarOverlaysWebView set to "false," the document loads 
(document.readyState == "complete") and then the window resizes sometime after 
that.

This is causing a document reflow, and disallows Javascript changes to the DOM 
that relate to viewport size to start right away.

My workaround right now is simple: If the platform is iOS, then wait for a 
resize before starting Javascript calculations.

Is this resizing unavoidable? (Or, can I just handle this with some .plist 
settings, or something?)

If the resizing is unavoidable, can I count on it always resizing the window? 
Or, is there a race condition happening, and I have just observed that it 
resizes after the readyState "complete", when it could really happen before OR 
after?

  was:
With StatusBarOverlaysWebView set to "false," the document loads 
(document.readyState == "complete") and then the window resizes sometime after 
that.

This is causing a document reflow, and disallows Javascript changes to the DOM 
that relate to viewport size to start right away.

My workaround right now is simple: If the platform is iOS, then wait for a 
resize before starting Javascript calculations.

Is this resizing unavoidable? (Or, can I just handle this with some .plist 
settings, or something?)

If the resizing is unavoidable, can I count on it always resizing the window? 
Or, is there a race condition happening, and I have just observed that it 
resizes after the readyState "complete", when it could really happen before OR 
after?


> Resizes iOS viewport after document.readyState "complete"
> -
>
> Key: CB-10736
> URL: https://issues.apache.org/jira/browse/CB-10736
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Plugin Statusbar
> Environment: iOS 9.2.1, WKWebView
>Reporter: Trent McNitt
>Priority: Minor
>
> Edit: This only occurs using WKWebview. It doesn't resize on UIWebView (at 
> least when I tested it on an iOS 8 phone).
> With StatusBarOverlaysWebView set to "false," the document loads 
> (document.readyState == "complete") and then the window resizes sometime 
> after that.
> This is causing a document reflow, and disallows Javascript changes to the 
> DOM that relate to viewport size to start right away.
> My workaround right now is simple: If the platform is iOS, then wait for a 
> resize before starting Javascript calculations.
> Is this resizing unavoidable? (Or, can I just handle this with some .plist 
> settings, or something?)
> If the resizing is unavoidable, can I count on it always resizing the window? 
> Or, is there a race condition happening, and I have just observed that it 
> resizes after the readyState "complete", when it could really happen before 
> OR after?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Updated] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-06 Thread Vito Macchia (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vito Macchia updated CB-10798:
--
Description: 
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (some ES6, sorry)

This snippet uses WinJS Promises - should work with native promises as well or 
you can just remove promises and pass succes and fail callbacks. It should 
create MY_Folder/test (both folders, like mkdirp) in the SD Card (regardless if 
emulated or not) root directory. It works fine with 5.x devices, but returns 
always FileError.ENCODING_ERR on Marshmallow. 

{code:title=createDirectory.js|borderStyle=solid}

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, "CODE", e);
return msg;
}

const STATIC_CONTENT_DIR = 'MY_Folder/test';

function createDirectory(startDirectory = cordova.file.externalRootDirectory) {
return new WinJS.Promise(function(success, fail) {
window.resolveLocalFileSystemURL(startDirectory, function(directory) {

console.log("FS ROOT", directory);

function fileGetDir(path, cb) {
console.log("*** PATH", path);
var fnGetOrCreateDir = function(p, de) {
var entry = p.shift();
console.log("PATH", path);
if (entry) {
de.getDirectory(entry, {
create: true,
exclusive: false
}, function(dirEntry) {
console.log("CR", dirEntry);
fnGetOrCreateDir(p, dirEntry);
}, fileFSError);
} else
if (cb) cb(de);
};

if (path) {
var arPath = path.split("/");
fnGetOrCreateDir(arPath, directory.filesystem.root);
} else {
if (cb) cb(directory);
}
}

fileGetDir(STATIC_CONTENT_DIR, onSuccess);
}, fileFSError);

function fileFSError(e) {
console.log(e.code);
try {
console.log("fileFSError: " + JSON.stringify(e) + errorCode(e));
fail(e);
} catch (err) {
fail(err);
}
}

function onSuccess(dirEntry) {
console.log(dirEntry.fullPath);
success(dirEntry.fullPath)
}
});
}
{code}

I suspect it has something to do with the way the storage should be handled on 
Marshmallow, see for instance 
http://developer.android.com/guide/topics/data/data-storage.html and 
https://source.android.com/devices/storage/

  was:
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

{code:title=createDirectory.js|borderStyle=solid}

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;

[jira] [Updated] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-06 Thread Vito Macchia (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vito Macchia updated CB-10798:
--
Description: 
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

{code:title=createDirectory.js|borderStyle=solid}

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, "CODE", e);
return msg;
}

const STATIC_CONTENT_DIR = 'MY_Folder';

function createDirectory(startDirectory = cordova.file.externalRootDirectory) {
return new WinJS.Promise(function(success, fail) {
window.resolveLocalFileSystemURL(startDirectory, function(directory) {

console.log("FS ROOT", directory);

function fileGetDir(path, cb) {
console.log("*** PATH", path);
var fnGetOrCreateDir = function(p, de) {
var entry = p.shift();
console.log("PATH", path);
if (entry) {
de.getDirectory(entry, {
create: true,
exclusive: false
}, function(dirEntry) {
console.log("CR", dirEntry);
fnGetOrCreateDir(p, dirEntry);
}, fileFSError);
} else
if (cb) cb(de);
};

if (path) {
var arPath = path.split("/");
fnGetOrCreateDir(arPath, directory.filesystem.root);
} else {
if (cb) cb(directory);
}
}

fileGetDir(STATIC_CONTENT_DIR, onSuccess);
}, fileFSError);

function fileFSError(e) {
console.log(e.code);
try {
console.log("fileFSError: " + JSON.stringify(e) + errorCode(e));
fail(e);
} catch (err) {
fail(err);
}
}

function onSuccess(dirEntry) {
console.log(dirEntry.fullPath);
success(dirEntry.fullPath)
}
});
}
{code}

  was:
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

{code:title=createFolder.js|borderStyle=solid}

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, 

[jira] [Updated] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-06 Thread Vito Macchia (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vito Macchia updated CB-10798:
--
Description: 
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

{code:title=createFolder.js|borderStyle=solid}

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, "CODE", e);
return msg;
}

const STATIC_CONTENT_DIR = 'MY_Folder';

function createDirectory(startDirectory = cordova.file.externalRootDirectory) {
return new WinJS.Promise(function(success, fail) {
window.resolveLocalFileSystemURL(startDirectory, function(directory) {

console.log("FS ROOT", directory);

function fileGetDir(path, cb) {
console.log("*** PATH", path);
var fnGetOrCreateDir = function(p, de) {
var entry = p.shift();
console.log("PATH", path);
if (entry) {
de.getDirectory(entry, {
create: true,
exclusive: false
}, function(dirEntry) {
console.log("CR", dirEntry);
fnGetOrCreateDir(p, dirEntry);
}, fileFSError);
} else
if (cb) cb(de);
};

if (path) {
var arPath = path.split("/");
fnGetOrCreateDir(arPath, directory.filesystem.root);
} else {
if (cb) cb(directory);
}
}

fileGetDir(STATIC_CONTENT_DIR, onSuccess);
}, fileFSError);

function fileFSError(e) {
console.log(e.code);
try {
console.log("fileFSError: " + JSON.stringify(e) + errorCode(e));
fail(e);
} catch (err) {
fail(err);
}
}

function onSuccess(dirEntry) {
console.log(dirEntry.fullPath);
success(dirEntry.fullPath)
}
});
}
{code}

  was:
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

{code:title=createFile.js|borderStyle=solid}

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, 

[jira] [Updated] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-06 Thread Vito Macchia (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vito Macchia updated CB-10798:
--
Description: 
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

{code:title=createFile.js|borderStyle=solid}

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, "CODE", e);
return msg;
}

const STATIC_CONTENT_DIR = 'MY_Folder';

function createDirectory(startDirectory = cordova.file.externalRootDirectory) {
return new WinJS.Promise(function(success, fail) {
window.resolveLocalFileSystemURL(startDirectory, function(directory) {

console.log("FS ROOT", directory);

function fileGetDir(path, cb) {
console.log("*** PATH", path);
var fnGetOrCreateDir = function(p, de) {
var entry = p.shift();
console.log("PATH", path);
if (entry) {
de.getDirectory(entry, {
create: true,
exclusive: false
}, function(dirEntry) {
console.log("CR", dirEntry);
fnGetOrCreateDir(p, dirEntry);
}, fileFSError);
} else
if (cb) cb(de);
};

if (path) {
var arPath = path.split("/");
fnGetOrCreateDir(arPath, directory.filesystem.root);
} else {
if (cb) cb(directory);
}
}

fileGetDir(STATIC_CONTENT_DIR, onSuccess);
}, fileFSError);

function fileFSError(e) {
console.log(e.code);
try {
console.log("fileFSError: " + JSON.stringify(e) + errorCode(e));
fail(e);
} catch (err) {
fail(err);
}
}

function onSuccess(dirEntry) {
console.log(dirEntry.fullPath);
success(dirEntry.fullPath)
}
});
}
{code}

  was:
Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, "CODE", e);
return msg;
}

const 

[jira] [Created] (CB-10798) Cannot create folder into cordova.file.externalRootDirectory on Android 6.x Marshmallow

2016-03-06 Thread Vito Macchia (JIRA)
Vito Macchia created CB-10798:
-

 Summary: Cannot create folder into 
cordova.file.externalRootDirectory on Android 6.x Marshmallow
 Key: CB-10798
 URL: https://issues.apache.org/jira/browse/CB-10798
 Project: Apache Cordova
  Issue Type: Bug
  Components: Plugin File
Affects Versions: 4.1.1
 Environment: Android 6.0.1 (Nexus 9 and other 6.x devices), Cordova 
cli 6.0.0, Android platform 5.1.0
Reporter: Vito Macchia


Cannot create folder into cordova.file.externalRootDirectory on Android 6.x 
Marshmallow. It always returns encording error (12), while on Android 5.x 
(Lollipop) the same code works fine.

On Marshmallow devices I can succesfully create folders only into 
cordova.file.externalDataDirectory.

No matter the value of preference AndroidPersistentFileLocation or 
AndroidExtraFilesystems.


Code (ES6, sorry)

function errorCode(e) {
var msg = '';

switch (e.code) {
case FileError.ABORT_ERR:
msg = 'ABORT_ERR';
break;
case FileError.ENCODING_ERR:
msg = 'ENCODING_ERR';
break;
case FileError.NOT_READABLE_ERR:
msg = 'NOT_READABLE_ERR';
break;
case FileError.PATH_EXISTS_ERR:
msg = 'PATH_EXISTS_ERR';
break;
case FileError.QUOTA_EXCEEDED_ERR:
msg = 'QUOTA_EXCEEDED_ERR';
break;
case FileError.NOT_FOUND_ERR:
msg = 'NOT_FOUND_ERR';
break;
case FileError.SECURITY_ERR:
msg = 'SECURITY_ERR';
break;
case FileError.INVALID_MODIFICATION_ERR:
msg = 'INVALID_MODIFICATION_ERR';
break;
case FileError.INVALID_STATE_ERR:
msg = 'INVALID_STATE_ERR';
break;
default:
msg = 'Unknown Error';
break;
};

console.log('Error: ' + msg, "CODE", e);
return msg;
}

const STATIC_CONTENT_DIR = 'MY_Folder';

function createDirectory(startDirectory = cordova.file.externalRootDirectory) {
return new WinJS.Promise(function(success, fail) {
window.resolveLocalFileSystemURL(startDirectory, function(directory) {

console.log("FS ROOT", directory);

function fileGetDir(path, cb) {
console.log("*** PATH", path);
var fnGetOrCreateDir = function(p, de) {
var entry = p.shift();
console.log("PATH", path);
if (entry) {
de.getDirectory(entry, {
create: true,
exclusive: false
}, function(dirEntry) {
console.log("CR", dirEntry);
fnGetOrCreateDir(p, dirEntry);
}, fileFSError);
} else
if (cb) cb(de);
};

if (path) {
var arPath = path.split("/");
fnGetOrCreateDir(arPath, directory.filesystem.root);
} else {
if (cb) cb(directory);
}
}

fileGetDir(STATIC_CONTENT_DIR, onSuccess);
}, fileFSError);

function fileFSError(e) {
console.log(e.code);
try {
console.log("fileFSError: " + JSON.stringify(e) + errorCode(e));
fail(e);
} catch (err) {
fail(err);
}
}

function onSuccess(dirEntry) {
console.log(dirEntry.fullPath);
success(dirEntry.fullPath)
}
});
}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Reopened] (CB-10752) ios 6 lost 20px in the statusbar when rotate the device (portrait mode)

2016-03-06 Thread jcesarmobile (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jcesarmobile reopened CB-10752:
---

> ios 6 lost 20px in the statusbar when rotate the device (portrait mode)
> ---
>
> Key: CB-10752
> URL: https://issues.apache.org/jira/browse/CB-10752
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 2.1.0
> Environment: phone 3gs, ios 6
>Reporter: Jorge Chávez
>Assignee: jcesarmobile
>Priority: Minor
>
> when the app its fixed on portrait and you rotate the device lost the 20px in 
> the top and the webview stay under the statusbar. this bug its just in ios 6
> It happens to if you execute  location.reload();
> 
> 
> 
> StatusBar.show();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10752) ios 6 lost 20px in the statusbar when rotate the device (portrait mode)

2016-03-06 Thread jcesarmobile (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15182100#comment-15182100
 ] 

jcesarmobile commented on CB-10752:
---

Fixed in 2.1.2-dev

> ios 6 lost 20px in the statusbar when rotate the device (portrait mode)
> ---
>
> Key: CB-10752
> URL: https://issues.apache.org/jira/browse/CB-10752
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 2.1.0
> Environment: phone 3gs, ios 6
>Reporter: Jorge Chávez
>Assignee: jcesarmobile
>Priority: Minor
>
> when the app its fixed on portrait and you rotate the device lost the 20px in 
> the top and the webview stay under the statusbar. this bug its just in ios 6
> It happens to if you execute  location.reload();
> 
> 
> 
> StatusBar.show();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Closed] (CB-10752) ios 6 lost 20px in the statusbar when rotate the device (portrait mode)

2016-03-06 Thread jcesarmobile (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jcesarmobile closed CB-10752.
-
Resolution: Fixed

> ios 6 lost 20px in the statusbar when rotate the device (portrait mode)
> ---
>
> Key: CB-10752
> URL: https://issues.apache.org/jira/browse/CB-10752
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 2.1.0
> Environment: phone 3gs, ios 6
>Reporter: Jorge Chávez
>Assignee: jcesarmobile
>Priority: Minor
>
> when the app its fixed on portrait and you rotate the device lost the 20px in 
> the top and the webview stay under the statusbar. this bug its just in ios 6
> It happens to if you execute  location.reload();
> 
> 
> 
> StatusBar.show();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Resolved] (CB-10752) ios 6 lost 20px in the statusbar when rotate the device (portrait mode)

2016-03-06 Thread jcesarmobile (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jcesarmobile resolved CB-10752.
---
Resolution: Fixed

> ios 6 lost 20px in the statusbar when rotate the device (portrait mode)
> ---
>
> Key: CB-10752
> URL: https://issues.apache.org/jira/browse/CB-10752
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 2.1.0
> Environment: phone 3gs, ios 6
>Reporter: Jorge Chávez
>Assignee: jcesarmobile
>Priority: Minor
>
> when the app its fixed on portrait and you rotate the device lost the 20px in 
> the top and the webview stay under the statusbar. this bug its just in ios 6
> It happens to if you execute  location.reload();
> 
> 
> 
> StatusBar.show();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10752) ios 6 lost 20px in the statusbar when rotate the device (portrait mode)

2016-03-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15182097#comment-15182097
 ] 

ASF GitHub Bot commented on CB-10752:
-

Github user asfgit closed the pull request at:

https://github.com/apache/cordova-plugin-statusbar/pull/50


> ios 6 lost 20px in the statusbar when rotate the device (portrait mode)
> ---
>
> Key: CB-10752
> URL: https://issues.apache.org/jira/browse/CB-10752
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 2.1.0
> Environment: phone 3gs, ios 6
>Reporter: Jorge Chávez
>Assignee: jcesarmobile
>Priority: Minor
>
> when the app its fixed on portrait and you rotate the device lost the 20px in 
> the top and the webview stay under the statusbar. this bug its just in ios 6
> It happens to if you execute  location.reload();
> 
> 
> 
> StatusBar.show();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10752) ios 6 lost 20px in the statusbar when rotate the device (portrait mode)

2016-03-06 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15182096#comment-15182096
 ] 

ASF subversion and git services commented on CB-10752:
--

Commit 7ca35522242c1fa73b4e3e7b33b804c121e14194 in cordova-plugin-statusbar's 
branch refs/heads/master from [~jcesarmobile]
[ 
https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-statusbar.git;h=7ca3552
 ]

Fix for CB-10752 status bar overlays the webview on iOS 6 in some cases

We don’t allow the statusbar to overlay the webview on iOS 6, but in
some cases it happens. This changes avoid it.


> ios 6 lost 20px in the statusbar when rotate the device (portrait mode)
> ---
>
> Key: CB-10752
> URL: https://issues.apache.org/jira/browse/CB-10752
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 2.1.0
> Environment: phone 3gs, ios 6
>Reporter: Jorge Chávez
>Assignee: jcesarmobile
>Priority: Minor
>
> when the app its fixed on portrait and you rotate the device lost the 20px in 
> the top and the webview stay under the statusbar. this bug its just in ios 6
> It happens to if you execute  location.reload();
> 
> 
> 
> StatusBar.show();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-10752) ios 6 lost 20px in the statusbar when rotate the device (portrait mode)

2016-03-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-10752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15182086#comment-15182086
 ] 

ASF GitHub Bot commented on CB-10752:
-

GitHub user jcesarmobile opened a pull request:

https://github.com/apache/cordova-plugin-statusbar/pull/50

Fix for CB-10752 status bar overlays the webview on iOS 6 in some cases

We don’t allow the statusbar to overlay the webview on iOS 6, but in
some cases it happens. This changes avoid it.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jcesarmobile/cordova-plugin-statusbar 
CB-10752-ios-statusbar

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-plugin-statusbar/pull/50.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #50


commit 7ca35522242c1fa73b4e3e7b33b804c121e14194
Author: Julio César 
Date:   2016-03-06T10:55:49Z

Fix for CB-10752 status bar overlays the webview on iOS 6 in some cases

We don’t allow the statusbar to overlay the webview on iOS 6, but in
some cases it happens. This changes avoid it.




> ios 6 lost 20px in the statusbar when rotate the device (portrait mode)
> ---
>
> Key: CB-10752
> URL: https://issues.apache.org/jira/browse/CB-10752
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Statusbar
>Affects Versions: 2.1.0
> Environment: phone 3gs, ios 6
>Reporter: Jorge Chávez
>Assignee: jcesarmobile
>Priority: Minor
>
> when the app its fixed on portrait and you rotate the device lost the 20px in 
> the top and the webview stay under the statusbar. this bug its just in ios 6
> It happens to if you execute  location.reload();
> 
> 
> 
> StatusBar.show();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org