How to add ionic devApp support in a cordova plugin - ionic-framework

I have a cordova plugin which supports Android, iOS and browser platforms. But when adding the plugin in an ionic app that is being developed/built using ionic serve or ionic devApp, the error comes as 'plugin is not defined'. Is there a way to add the ionic devApp support to a cordova plugin ? If it means only using the browser code for all the platforms(Not using any native platform code), then it works for me. Thanks in advance.
I have added the browser platform to my plugin but it does not work with ionic serve even when the app is running on browser. Note that the plugin works fine on browser when the app is run using ionic cordova run browser command.
I want the cordova plugin to be compatible with all platforms - Android, iOS , browser and devApp. My expectation are that when the app is run using ionic cordova run android/ios/browser command, it should use the native code of my cordova plugin. And when the app is run using ionic serve or ionic devApp, then it should use the web code.

Related

Why ionic 4 social sharing plugin not working in browser?

I'm creating ionic 4 angular app , and using ionic 4 social sharing plugin to share app.in mobile devices it's working fine but in browser it is not working.
Here is ionic 4 social sharing documentation
Since Ionic social sharing is native plugin so its required cordova to run. You are running it in browser so it will not working. Try to run ionic cordova run browser. before running this command in cmd, Please make sure browser plateform is installed.

How to run pwa developed with ionic on android device

I have connected my android phone to the same wifi as my laptop is connected.
and i execute ionic serve --devapp
the expectation is to be able to run my ionic PWA on my android device.
Very simple :
ionic cordova run android
Note :
This command will automatically integrate cordova in ionic project.
Manually integrate cordova :
ionic integrations enable cordova

Ionic 4 Angular 6 create app not asking Cordova Integration question

I'm new to Ionic, and just installed it and i also installed Cordova on my Ubuntu 18.04 machine, then i used the command to create an app using these commands
npm install -g ionic
npm install -g cordova
then i used the command to create an app using these
ionic start ionic4Tut --type=angular
but I'm not getting the question about integrating cordova to the project as shown in all the tutorials,
Integrate your new app with Cordova to target native iOS and Android? (y/N)
anyone know way is that?
I was having the same problem and what I did was after creating the project using
$ionic start projName --type=angular
I will cd to my project folder and run
$ionic cordova platform
that will solve your problem.
Cordova is what the Ionic framework uses to target native functionality for mobile devices. It does this because Ionic is primarily a mobile app framework. If you don't want to integrate it and want to use nothing but the development framework, you may as well use Angular on it's own.
Reference: Cordova, Angular, Ionic

ionic app run perfectly on browser but not working on devApp and android apk

This question is related to ionic 3 and I want to know how to run an ionic app using a real device.
I have developed an hybrid application and I was not able to connect my app with server. It works fine in my laptop browser. But it does not work in devApp and android apk.
I have tried many solutions but was not able to get the perfect solution. I have made a proxy server to access the api by ionic devApp but it doesn't even show a single error.
I think this problem is related about CORS.
Use the additional parameter of --devapp when running your ionic serve.
ionic serve --devapp
Should work now.
For me allowing port 8100 in my firewall was needed. Then everythig works.
CORS is not a problem when you build your app on a real device.
To run your app on android device :
ionic cordova platform add android
ionic cordova build android
ionic cordova run android (Connect your device before executing this)
Try Reinstalling cordova-plugin-whitelist plugin.
I'd the same problem. But I just uninstalled and installed again the ionic DevApp and it solved it.
Try using the command ionic serve -c this for view the app into Ionic devApp
I am not sure if this helps now - In your DevAPp you have settings where you can manually enter IP address and port. This will be the private IP (192.x.x.x) and 8100 that is displayed when you start the ionic serve --devapp from the terminal.

Not able to run Ionic App with Mobile First 7.1

I have created my ionic App via Commmand Prompt by using the following command,
mfp cordova create AppName
After that mfp plugin was installed automatically inside my project.Then
I created mfp project using,
mfp create projectname
App created successfully..Then using
mfp push
i pushed my app inside the server 7.1 version.
After i have started to run my ionic app using,
ionic run android --livereload
In there i am getting error as,
TypeError: platforms[platformId].parser is not a function
My configuration:
cordova : 5.4.1 version android : 3.6.4 version
Anyone help will be Appreciated!!!!
You did not create an Ionic app. You created a Cordova app.
You wrote: mfp cordova create AppName. That's not how you create an Ionic app... that's how you do it: ionic start todo blank.
Please read the Ionic docs.
http://ionicframework.com/docs/guide/installation.html
To create an Ionic app and then integrate it with MobileFirst , you can follow this guide: https://www.raymondcamden.com/2015/03/23/working-with-ibm-mobilefirst-and-the-ionic-framework/