ionic-team / ng-cordova

OBSOLETE: Please move to Ionic Native https://github.com/ionic-team/ionic-native
https://github.com/ionic-team/ionic-native
MIT License
3.48k stars 1.05k forks source link

$cordovaFile.writeFile operations do not end #1378

Open fluqueval opened 8 years ago

fluqueval commented 8 years ago

Hello

In IOS with this single example, the operation writeFile (And any operation) is not a success or an error The same code in Android is OK!!

The strange thing is that if I go to the iphone initial screen and then enter the app, then the write operation is executed

I've tried:

Nothing has worked!!

I using Deployment target in Xcode 8.0. I do not know if this is a Xcode configuration issue

In my controller: $cordovaFile.writeFile(cordova.file.dataDirectory, "file.txt", "text", true) .then(function (success) { $scope.exitoWrite='exitoWrite'; }, function (error) { $scope.errorWrite=error; });

In my config.xml:

<preference name="iosPersistentFileLocation" value="Compatibility" />

Thnx

fluqueval commented 8 years ago

In console de Xcode: THREAD WARNING: ['File'] took '23.610107' ms. Plugin should use a background thread. 2016-11-11 10:33:11.985736 bonosMoviles[5161:1628891] Cannot snapshot view (<UIKeyboardImpl: 0x100568fb0; frame = (0 0; 414 271); layer = <CALayer: 0x1702312e0>>) with afterScreenUpdates:NO, because the view is not in a window. Use afterScreenUpdates:YES.

When I enter the second time:

2016-11-11 10:33:16.999766 bonosMoviles[5161:1628891] looking for file at file:///private/var/mobile/Containers/Data/Application/963D775C-9AFD-4A40-BCF5-1E26C5CC3E97/tmp/Factura_1_2016.pdf 2016-11-11 10:33:17.479531 bonosMoviles[5161:1628891] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToTwitter => com.apple.share.Twitter.post 2016-11-11 10:33:17.479716 bonosMoviles[5161:1628891] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToFacebook => com.apple.share.Facebook.post 2016-11-11 10:33:17.479807 bonosMoviles[5161:1628891] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToWeibo => com.apple.share.SinaWeibo.post 2016-11-11 10:33:17.480069 bonosMoviles[5161:1628891] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.TencentWeibo => com.apple.share.TencentWeibo.post 2016-11-11 10:33:17.480489 bonosMoviles[5161:1628891] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToFlickr => com.apple.share.Flickr.post 2016-11-11 10:33:17.480923 bonosMoviles[5161:1628891] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToVimeo => com.apple.share.Vimeo.post

fluqueval commented 8 years ago

nobody?

gortok commented 8 years ago

This is a underlying plugin issue, not a wrapper issue. Try here: https://issues.apache.org/jira/browse/CB-12085?jql=project%20%3D%20CB%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20File%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC

fluqueval commented 8 years ago

I'm sorry, I think your answer is not related to my problem.

Effectively it is a CordovaFile plugin problem.

My problem is very specific. When writing does not go through success, nor because of error

But if I go out and enter it seems that the thread running CordovaFile plugin is activated

I do not get it

Thnx

$cordovaFile.writeFile(cordova.file.dataDirectory, "file.txt", "text", true) .then(function (success) { $scope.exitoWrite='exitoWrite'; }, function (error) { $scope.errorWrite=error; });