Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom ringtone is not working #613

Open
AlertnowMobile opened this issue Dec 11, 2024 · 0 comments
Open

Custom ringtone is not working #613

AlertnowMobile opened this issue Dec 11, 2024 · 0 comments

Comments

@AlertnowMobile
Copy link

AlertnowMobile commented Dec 11, 2024

Hi @hiennguyen92,

In my app, I've added custom wake-up call ringtones. However, it always plays the phone's default ringtone instead of the custom one.

I placed my ringtones in the following locations:

  • Android: android/app/src/main/res/raw
  • iOS: ios/Runner/high_ring.caf

But it’s still not working. Here’s the code I’m using:

Future<void> showCallkitIncoming(String uuid, String title) async {
  // sample high_ring
  final String ringtone = await getRingtonePreference();

  await FlutterCallkitIncoming.showCallkitIncoming(CallKitParams(
    id: uuid,
    nameCaller: title,
    appName: 'Xyz',
    avatar: 'assets/images/logo.jpeg',
    type: 0,
    duration: 30000,
    textAccept: 'Accept',
    textDecline: 'Decline',
    missedCallNotification: const NotificationParams(
      showNotification: false,
      isShowCallback: false,
      subtitle: 'Missed call',
      callbackText: 'Call back',
    ),
    android: AndroidParams(
      isCustomNotification: false,
      isCustomSmallExNotification: false,
      isShowLogo: false,
      ringtonePath: ringtone,
      backgroundColor: '#FFFFFF',
      actionColor: '#4CAF50',
      textColor: '#000000',
      isShowFullLockedScreen: true,
    ),
    ios: IOSParams(
      iconName: 'AlertNow',
      handleType: 'number',
      supportsVideo: true,
      maximumCallGroups: 2,
      maximumCallsPerCallGroup: 1,
      audioSessionMode: 'default',
      audioSessionActive: true,
      audioSessionPreferredSampleRate: 44100.0,
      audioSessionPreferredIOBufferDuration: 0.005,
      supportsDTMF: true,
      supportsHolding: true,
      supportsGrouping: false,
      supportsUngrouping: false,
      ringtonePath: '$ringtone.caf',
    ),
  ));
}

Could you help me identify if anything is wrong here? Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant