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.
// 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);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
Gallery Picker
Opens the gallery for the user to select existing media.
const galleryCallback = useCallback((data: string | string[]) => {
console.log('Selected:', data);
}, []);
// openGalleryPicker(callback, multiple, type, enableLinkInput)
openGalleryPicker(galleryCallback, true, 'image', true);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.
const contactCallback = useCallback((number: string) => {
console.log('Selected Number:', number);
}, []);
openContactPicker(contactCallback);callback
(number: string) => void
โ
Triggered when a contact is selected. Returns the phone number.
Emoji & GIF Pickers
// 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);callback
(emoji: string) => void
โ
Triggered when an emoji/GIF is selected. Returns the emoji char/gif url.
Last updated