FileTransfer Undefined on iOS only

Hi,

I’m trying to use the FileTransfer plugin with Ionic-native.
http://ionicframework.com/docs/v2/native/transfer/

It works exactly as expected on Android and Windows devices. But it fails on the iOS device with ReferenceError: Can’t find variable: FileTransfer.
I do use Ionic Package to build my iOS app, not sure if this could be the problem?

What I’ve tried:

  • Removing the plugin and adding it again
  • Removing the iOS platform and adding it again

My code looks more or less like this:

import { Transfer } from 'ionic-native'; this.platform.ready().then(() => { var transfer = new Transfer(); .........

It fails trying to instantiate the Transfer object. But only on iOS.

I found a similar post here: https://forum.ionicframework.com/t/ionic-native-transfer-error-filetransfer-is-not-defined/57280
But it seems like he was trying to use it with serve, where I’m running on an actual device.

The other odd thing is I also use the File plugin. And that does work on iOS.
It feels like I’m just missing something, no idea what though?

Any help is much appreciated.

Thanks.

1 Like