WhatsApp share using expo-sharing library in Android(React-native)

Viewed 297

I want to share an image file directly to my whatsApp or add it to my whatsApp status i.e I don't want to see any other sharing option when I click on button to share any image. Currently I am using the following code to share

import * as Sharing from 'expo-sharing';
import * as FileSystem from 'expo-file-system';

const customShare = async (image) => {
    const base64result = image.split(',')[1];
    try {
        let filename = 'share.png'; // or some other way to generate filename
        let filepath = `${FileSystem.documentDirectory}/${filename}`;
        await FileSystem.writeAsStringAsync(filepath, base64result, { encoding: 'base64' });
        await Sharing.shareAsync(filepath, { mimeType: 'image/gif' })
    } catch (e) {
        alert(e.message);
    }
};


But here it is showing all sharing option to choose, is there any way to skip this step and directly open my WhatsApp

0 Answers
Related