I need help with using Cordova Plug ins

I want to send email from my Ionic creator app.
I started following the documentation http://docs.usecreator.com/docs/how-to-use-cordova-plugins-with-your-creator-app

  1. creating & copying the ionic.native.min.js code and adding it to my app
  2. Add “ionic.native” as an Angular Module
  3. Add Some Cordova Plugins to Your App

but when I actually want to start using it on my page or injecting it into my service, I feel like a cat on a hot plate and nothing seems to work…

I want to use the $cordovaEmailComposer plugin

Can someone put me on track, I am derailed…
Do you need to install anything physically on your pc???

So you are using the new ionic.native not ngCordova.
And you are injecting the correct module into your Angular module section:

angular.module('myApp', ['ionic', 'ionic.native'])

Can you debug your app and see what the logs say!
Also, try to wrap $cordovaEmailComposer inside $ionicPlatform.ready like so:

$ionicPlatform.ready(function() { $cordovaEmailComposer.someFunction().then(success, error); });

Great, I will give it a shot,

I copied the ionic.native.min.js code from https://unpkg.com/ionic-native/dist/ionic.native.min.js
how do I know if it is the new one?

Just to confirm, you don’t have to install anything physically on you PC, I am coding in Ionic creator.
…and the steps I followed is correct?

Thanks Heaps

Cool, I am not getting errors anymore, so $cordovaEmailComposer.isAvailable().then(function() {
is working but obviously running in Ionic creator on my PC is not the correct environment to test the email in, can it be tested in the Creator Mobile App?

Whenever you’re using cordova libs, test them on a real device to get an accurate result of how the plugin/s is working :slight_smile:
As for the Creator App, I think it should work.
You can check the docs here for more information:

I feel positive that I am on the right track, nearly there,

I packaged my app and installed it on my apple cellphone and ipad.

The web interface is giving me an expected message “Native: tried calling EmailComposer.open, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator” in my ionic creator

BUT when I test it on the device, the app loses focus, and the focus goes to my cellphone’s home tab. The app splash screen is running in the background? How do I debug or have control over the errors that might occur on the device? Or even better what is happening?

There are different ways to check the log from your iOS device, one of which is using Safari Web Inspector but you have to enable this feature from both your macOS machine and your iPhone/simulator.

You may refer to this link for further details.
https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html

Let me know how it goes with you :slight_smile:

Thanks, I will steal my husbands mac to do this,

At the end $cordovaEmailComposer did not work for me, I used $cordovaSocialSharing instead and it works, except i am struggling with attachments, I think I will add another topic for that. Thanks for your help