I have installed native TRANSFER plugin in my ionic 2 app in 2 steps:
1. ionic plugin add cordova-plugin-file-transfer
2. npm install --save @ionic-native/transfer
After that i imported the plugin in my home.ts page.
Import { Transfer } from '@ionic-native/transfer'
I tried to use the plugin to upload a file var ft = new Transfer();
But i can't use ft var, because Transfer plugin look like it's not avalable. If i write ft.upload () i receive an error like: Property 'upload' does not exist on type 'Transfer'.
My technologies:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
In the previous version of my app when using Ionic Framework Version: 2.0.0-rc.5 /Ionic App Scripts Version: 1.0.0 all worked just fine.
Does anyone has any solution for this? Thanks in advance.
In the
3.1.0 version of Ionic Native
, you have to use the plugin like a provider.Import it in app.module.ts and set as provider
Inject in the component/provider where you need to use it.
fileTransfer
object.Documentation: Ionic Native and Transfer