答案 0 :(得分:1)
您是否已查看react-native-sms包裹?
它的SMS.send
函数支持可以处理多个收件人的options参数。 https://github.com/tkporter/react-native-sms#using-the-module
答案 1 :(得分:0)
或者您可以在'react-native'中使用Linking:
const onPressSendMessage = () => {
let numbers = '';
contacts.forEach((phoneNumber: string) => {
numbers += `${phoneNumber},`;
});
numbers = numbers.slice(0, -1);
const url = (Platform.OS === 'android')
? `sms:${numbers}?body=${text}`
: `sms:/open?addresses=${numbers}&body=${text}`;
Linking.canOpenURL(url).then((supported: boolean) => {
if (!supported) {
console.log('Unsupported url: ', url);
} else {
Linking.openURL(url).then(() => {
navigateBack(); // or something else
});
}
}).catch((err: string) => console.log('An error occurred', err));
}