IOS10 kills firebase websocket

I am using Ionic v1 and Firebase v2.

Since IOS10, when I try to upload a base64 encoded image to my firebase using cordova camera, the websocket between my app and firebase gets killed for about 25 seconds, before it comes back to life.

This happens only on IOS10, android and all other ios versions work just fine.

After (a lot) of research online, I found that I have to add the following to my Info.plist, which I did :


Then I also found out that the content security policy (CSP) meta tag needed some changes to take into account ios10. Here is my CSP tag :

<meta http-equiv="Content-Security-Policy"
        default-src 'self' gap://ready file://* wss://* *;
        script-src * 'self' 'unsafe-eval' 'unsafe-inline' https://*;
        connect-src * 'self' 'unsafe-inline' 'unsafe-eval' * https://* ws:// wss://* blob: data:;
        style-src * 'unsafe-inline'; 
        img-src * 'unsafe-eval' 'unsafe-inline' data:">

As you can see, there is everything I could ever need to reach firebase properly.

Again, all other request to firebase work fine, but only this specific base64 upload (about 100Kb) kills my websocket.

Just in case, here is the code I use with my cordova camera to upload my image :

$scope.takePicture = function() {
        var options = { 
            quality : 90, 
            destinationType : Camera.DestinationType.DATA_URL, 
            sourceType : Camera.PictureSourceType.CAMERA, 
            allowEdit : false,
            encodingType: Camera.EncodingType.JPEG,
            correctOrientation: true,
            targetWidth: 400,
            targetHeight: 400, 
            popoverOptions: CameraPopoverOptions,
            saveToPhotoAlbum: false

        $cordovaCamera.getPicture(options).then(function(imageData) {
            $scope.imgURI = "data:image/jpeg;base64," + imageData;
            var myRef = new Firebase('; 
        }, function(err) {

I also started to believe that it was because of memory leaking using the cordova camera, when the image I get is too big ? If it’s less than 20Kb it gets uploaded to firebase right away. (if I take a picture of the wall, the image gets smaller) But if it’s more, that’s where the websocket gets killed.

Please anyone, I’m going bald with this issue.