Will ionic native 2.x code work in 3.x

I have to upload image to firebase storage with the help of ionic native plugins like file-chooser file file path.

but couldn’t achieve it with ionic native 3.x syntax as suggested in docs, so i implemented in ionic-native 2.x syntax
can you tell me if this will work or not?

here is the code which i used:

uploadimage() {
    (<any>window).resolveLocalFileSystemURL(this.nativepath, (res) => {
      res.file((resFile) => {
        var reader = new FileReader();
        reader.readAsArrayBuffer(resFile);
        reader.onloadend = (evt: any) => {
          var imgBlob = new Blob([evt.target.result], { type: 'image/jpeg' });
          var imageStore = this.firestore.ref().child('image');
          imageStore.put(imgBlob).then((res) => {
            alert('Upload Success');
          }).catch((err) => {
            alert('Upload Failed' + err);
          })
        }
      })
    })
  }

if this is not gonna work…can you give the code for the sma ein ionic native 3.x …will be a great help.

Can you make sure that you are not confusing “Ionic 2” or “Ionic 3” with “Ionic Native 2” or “Ionic Native 3” in your post? Right now it’s all muddled together.

i am using ionic 2 and Ionic-native 3.x

Great for you!

But what do you in you title with “3.x”. Ionic or Ionic Native?
What do you mean with “so i implemented in ionic 2.x.”? What does this have to do with " ionic native 3.x syntax"?

You shouldn’t have to be using window.

just edited the question :sweat_smile:

Ok, so you are using Ionic 2. You wanted to use Ionic Native 3 code, but couldn’t get it to work so used Ionic Native 2 code. Correct?

You are talking about http://ionicframework.com/docs/native/file-chooser/ and https://github.com/don/cordova-filechooser, right?

yes File Chooser as well as File and FilePath

And what is your problem and question then?
If your project is using Ionic Native 3 (see package.json), of course Ionic Native 2 code won’t work.

there one thing we call Backward compatibility…is it there or not?

No, otherwise it wouldn’t have been Ionic Native 3.x but Ionic Native 2.1. Native 3 dropped support for Angular 1 and Ionic 1.

The main point of ionic-native 3 is the ability to include only the plugins you are using in your app package. That would not be possible to achieve while preserving the prior static method API.