How to add cordova plugin with F7

hello
how to add and use Cordova plugin with F7 ,
i have use for example
framework7 cordova plugin add cordova-plugin-android-permissions

but with use this plugin (on my phone ) in my app after build
i get error permissions function not define .
so i must edit file /cordova/config.xml
and add this line

or no ??

what did you use to create your proy?

Framework7 v4 with Webpack…

i mean with f7-cli cordova proy or manual?

i have use (f7-cli )
npm run build-cordova-dev

just test it.
last f7 cli.

What type of the app are you targeting? Simple web app, Cordova app (targets native iOS and Android apps, or native desktop app with Electron)
? App (project) name: My App
? App package (Bundle ID): io.framework7.myapp
? Target Cordova platform: (Press to select, to toggle all, to invert selection)iOS, Android
? What type of framework do you prefer? Framework7 Core
? Choose starter template: Single View
? Should we setup project with bundler? Webpack (recommended)
? Do you want to setup CSS Pre-Processor No, i am good with CSS
? Do you want to specify custom theme color? No, use default color theme
? Do you want to include Framework7 Icons and Material Icons icon fonts? No, i want to use my own custom icons

then use the provided cmds and it works fine.

// add plugin
framework7 cordova plugin add cordova-plugin-splashscreen
// after adding the plugin i check the config.xml and it was added correctly
// <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
// then build
framework7 cordova build android
// then i test apk and it works fine

maybe there is an issue with the plugin you are trying to add?

1 Like

bro i have choose
Target Cordova platform:: android and ios native cordova .

i have use too
framework7 cordova plugin add [name of plugin ]
but after plugin complete installed
i can’t find it in path/myprojectF7/cordova/confix.xml the line of
<plugin name="[Name-of-Plugin" spec="[version[" />

so maybe i must install it manually or Framwork7 add it when build ?

after i build apk and open it with APK profile
i can see file cordova_pluigin.js
with all my plugin without add them to config.xml

Ok. So f7 add plugin is working. Right?

yes .!!! without edit file config.xml

1 Like