Native Features Integration

The phone exposes several native components (Camera, Gallery, Inputs) that you can trigger from your app.

Camera

Opens the phone's camera to take a photo or video.

REACT
// Callback receives the URL of the uploaded media
const cameraCallback = useCallback((url: string) => {
    console.log('Captured media:', url);
}, []);

// openCameraComponent(callback, disablePhoto, disableVideo)
openCameraComponent(cameraCallback, false, false);
Argument
Type
Optional
Explanation

callback

(url: string) => void

โŒ

Function triggered when media is saved. Receives the URL.

disablePhoto

boolean

โœ…

If true, the photo mode will be disabled. Default value is false

disableVideo

boolean

โœ…

If true, the video mode will be disabled. Default value is false

Opens the gallery for the user to select existing media.

REACT
const galleryCallback = useCallback((data: string | string[]) => {
    console.log('Selected:', data);
}, []);

// openGalleryPicker(callback, multiple, type, enableLinkInput)
openGalleryPicker(galleryCallback, true, 'image', true);
Argument
Type
Optional
Explanation

callback

(data: string | string[]) => void

โŒ

Triggered when media is selected. Returns URL or array of URLs.

multiple

boolean

โœ…

If true, user can select multiple items. Default value is false

type

'image' | 'video' | 'both'

โœ…

What type of media should be pickable. Default value is 'image'

enableLink

boolean

โœ…

If true, allows user to input a custom URL link. Default value is false

Contact Picker

Opens the contacts list to select a phone number.

REACT
const contactCallback = useCallback((number: string) => {
    console.log('Selected Number:', number);
}, []);

openContactPicker(contactCallback);
Argument
Type
Optional
Explanation

callback

(number: string) => void

โŒ

Triggered when a contact is selected. Returns the phone number.

Emoji & GIF Pickers

REACT
// Emoji
const emojiCallback = useCallback((emoji: string) => {
    console.log('Selected Emoji:', emoji);
}, []);
openEmojiPicker(emojiCallback);

// GIF
const gifCallback = useCallback((gifUrl: string) => {
    console.log('Selected GIF:', gifUrl);
}, []);
openGIFPicker(gifCallback);
Argument
Type
Optional
Explanation

callback

(emoji: string) => void

โŒ

Triggered when an emoji/GIF is selected. Returns the emoji char/gif url.

Last updated