Does anyone know of a working example showing how to open the default email program while populating “To” address in Ionic2? I have a list of email addresses and when I click on one I would like to open the default client.
I am pretty new to Ionic and I have scene some conflicting info about which cordova plugin to use.
Is inappbrowser an absolute requirement for maito: and tel:? I just did window.location=“blahblah@blah” in a function in Android, and it worked perfectly. However, doing the same in iOS gives an error even though all of the items are correctly listed in the config.xml (allow-intent href=“mailto:*”):
The iOS error: ERROR internal navigation rejected - allow-navigation not set for url=“mailto:blahblah@blah”
UPDATE: I added the allow-navigation lines under platform name-“ios” in config.xml. I’m not getting navigation errors anymore. I’m still getting URL can’t be shown, but I think that might be because I’m in an emulator. I"ll update once I can get it deployed to a phone (getting a bunch of entitlements errors when trying to deploy to a physical device. I hate iOS so much)
UPDATE AGAIN: Confirmed. Just add allow-navigation tags as stated above. It works on a physical device.