tencent cloud

All product documents
Tencent Real-Time Communication
uni-app (Anroid&iOS)
Last updated: 2024-04-03 17:23:11
uni-app (Anroid&iOS)
Last updated: 2024-04-03 17:23:11
This article introduces how to use the custom ringtone and silent incoming call ringtone feature from the definition.

Customize Incoming Call Ringtone

Setting Custom incoming call ringtone, here only local file addresses can be passed in, it is required to ensure the file directory is accessible by the application.
const TUICallKit = uni.requireNativePlugin('TencentCloud-TUICallKit');

const tempFilePath = './static/rain.mp3'; // Locally stored audio files
let musicFilePath = '';
uni.saveFile({
tempFilePath: tempFilePath,
success: (res) => {
console.warn(JSON.stringify(res));
musicFilePath = res.savedFilePath;
musicFilePath = plus.io.convertLocalFileSystemURL(musicFilePath);
// Set ringtone
TUICallKit.setCallingBell(musicFilePath, (res) => {
if (res.code === 0) {
console.log('setCallingBell success');
} else {
console.log(`setCallingBell failed, error message = ${res.msg}`);
}
});
},
fail: (err) => {
console.error(err);
},
});

Silent incoming call ringtone

Enable/Disable incoming call ringtone.
After enabling, the incoming call ringtone will not be played when a call request is received.
const TUICallKit = uni.requireNativePlugin('TencentCloud-TUICallKit');
const enable = true;
TUICallKit.enableMuteMode(enable);
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon