Open richterdennis opened 1 year ago
Any update?
` @PluginMethod public void openContact(PluginCall call) { if (!isContactsPermissionGranted()) { requestContactsPermission(call); } else { String contactId = call.getString("contactId");
if (contactId == null) {
call.reject("Parameter `contactId` not provided.");
return;
}
try {
// Crear un Intent para abrir el contacto con el contactId proporcionado
Uri contactUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, contactId);
Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // Asegurarse de que la actividad se inicie en un nuevo task
getContext().startActivity(intent);
call.resolve();
} catch (Exception e) {
call.reject("Failed to open contact with id: " + contactId, e);
}
}
} `
I can successfully create a contact with
How do I open the contact with the default contact app?
After researching for hours, the best I achieved is
This opens the contact app on android but not the contact itself.
A dedicated function to open the new created contact would be nice. Something like this: