Native transfer plugin - not available after install in ionic2

后端 未结 1 510
太阳男子
太阳男子 2021-01-15 05:22

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

相关标签:
1条回答
  • 2021-01-15 05:55

    In the 3.1.0 version of Ionic Native, you have to use the plugin like a provider.

    1. Import it in app.module.ts and set as provider

       import {Transfer} from '@ionic-native/transfer'
      
       @ngModule({
         //...
         providers:[
             Transfer,
             ..]
      
    2. Inject in the component/provider where you need to use it.

      constructor(private fileTransfer:Transfer){}
      
    3. Use the fileTransfer object.

    Documentation: Ionic Native and Transfer

    0 讨论(0)
提交回复
热议问题