The promise always returns undefined when i call the method DeviceAccounts.getEmails(). Here is the code that does that.
import { DeviceAccounts } from “@ionic-native/device-accounts”;
export class RegisterPage {
constructor(private deviceAccnts: DeviceAccounts) { }
public getEmailsAccounts():void{
this.deviceAccnts.getEmails().then(
res=> alert("Emails: "+res)
).catch(err=>alert("Error: "+err));
}
}
Please can someone help me out with this issue?