You need Utils
, isAndroid
, isIOS
from @nativescript/core
. This util does not require contact permissions, because the way this util works is only sending data to the default contact app.
import { saveToPhoneBook } from "~/util_phonebook";
import { saveToPhoneBook } from "~/util_phonebook";
let contact = {
name: "Kang Cahya",
phoneNumber: "628123456789",
email: "[email protected]",
address: "123 Main St, Indonesia",
company: "ABC Company",
jobTitle: "Software Engineer",
notes: "This is a sample note.",
website: "https://kang-cahya.com",
};
saveToPhoneBook(contact);