πContacts
Let users access and create entries in the device's native contacts, directly from your app.
What is Contacts?
The Contacts feature gives your app access to the device's native contact list, letting users retrieve their existing contacts or create new ones without leaving the app. This is useful for features like inviting friends, syncing a personal address book, or letting users save a new contact your app provides.
Accessing contacts requires the user to grant permission the first time the feature is used, on both iOS and Android.
Prerequisites
This feature requires any paid plan. See all plans
Natively Dashboard Setup
Open your Natively app dashboard and navigate to Features > Contacts.
Toggle the feature to Enabled.
Enter the Permission Description.
Click Save.
Rebuild your app(s).
You must rebuild your app for these changes to take effect.
Implementation
Choose your integration method below: Bubble.io Plugin (No-Code), JavaScript SDK (Code), or AI Agents (for AI-powered editors like Lovable, Base44, and Replit).
Initialization
Check Plugin
Before starting, verify if the Natively plugin is already installed in your Bubble project.
Open your Bubble editor and navigate to the Plugins tab in the left sidebar.
Check Installed Plugins: Look through your list of installed plugins for "Natively iOS & Android app builder".
If it IS installed: Check the version number. If an update is available (e.g., you see a button saying "Update"), click it to ensure you have the latest features and bug fixes.

If it is NOT installed: Click the + Add plugins button, search for "Natively", and click Install.

Check SDK
Before writing any logic, ensure the Natively SDK is correctly installed and up-to-date in your codebase.
Open your project's main HTML file (or header settings) and look for the Natively script tag inside the
<head>section.Install/Update: If missing or outdated, add the following code. You can specify the SDK version in the URL (e.g.,
@2.26.0).
Initialize the SDK
AI-powered editors like Lovable, Base44, and Replit use the JavaScript SDK to implement Natively features. Before implementing any feature, the Natively SDK must be initialized in your project.
Copy the line below and paste it into your AI agent to check and set up the Natively SDK in your project.
Setup Logic
[Element] Natively - Contacts
Set the element's data type field to ContactObject (Natively - ...).

Events:
Get All Contacts Success - fires when contacts are successfully retrieved.
Get All Contacts Failed - fires if retrieving contacts fails.
Create Contact Success - fires when a new contact is successfully created.
Create Contact Failed - fires if creating a contact fails.
States:
Get Contacts Result β list of
ContactObject, each with:FirstName;
LastName;
Phones β comma-separated if the contact has multiple phone numbers (e.g.
"0543523,124334234");Emails β comma-separated if the contact has multiple emails (e.g.
"test@test.com,help@buildnatively.com");ID β unique contact identifier on the device.
Create Contact ID Result β the ID of the newly created contact, after Create Contact.
Create/Get Contacts Status β result status after calling Create Contact or Get All Contacts.
Actions:
Get All Contacts β returns a list of
ContactObject.Create Contact β returns the new contact's ID:
First name;
Last name;
Phone;
Email;
AI-powered editors like Lovable, Base44, and Replit use the JavaScript SDK to implement Natively features.
Copy the line below and paste it into your AI agent.
Replace the placeholder at the beginning with a description of what you want to build - for example: "Let the user create a new contact from a form with name, email, and phone fields".
How to use
Check resp.status before using the result
Both getAllContacts and createContact return a status field - always confirm it's "SUCCESS" before iterating over resp.contacts or using resp.id.
Handle multiple phone numbers and emails
A contact may have more than one entry in phones or emails - don't assume a single value; iterate over the array or pick the one relevant to your use case (e.g., the first entry).
Use this to power an invite-a-friend flow
A common use case is letting users pick from their existing contacts to invite friends to your app - retrieve contacts with getAllContacts, then let the user select recipients from the results.
Troubleshooting
Last updated