Search packages, repositories and app categories

Package detailsv0.0.3

ringtone_set

Flutter Plugin for setting devices default ringtone or notification sound.

AndroidiOS
30-day downloads
19
Likes
24
Pub points
115

Install package

flutter pub add ringtone_set

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The ringtone_set package is a Flutter plugin that enables apps to set the device's default ringtone or notification sound programmatically on both Android and iOS. It provides a simple interface to select and apply audio files as system sounds, enhancing user experience in media or communication apps. The plugin integrates with native device APIs to ensure compatibility and reliability across supported platforms. Developers can use it to customize sound profiles based on user preferences or app-specific needs. It is particularly useful for apps focused on alerts, reminders, or personalized audio experiences.

Use cases

  • Setting custom ringtones from within an app
  • Customizing notification sounds for specific events
  • Enabling user-defined sound profiles
  • Integrating audio customization into productivity apps
  • Supporting accessibility features with tailored alerts

Key features

  • Cross-platform support for Android and iOS
  • Simple API for setting default ringtones
  • Integration with native device sound systems
  • Supports file-based ringtone assignment
  • Secure handling of audio file permissions

Suitable for

  • Audio customization apps
  • Reminder and alert applications
  • Accessibility-focused tools
  • Communication and messaging platforms
  • User preference management systems

Considerations

  • Requires user permission on both platforms
  • Limited by platform-specific restrictions on system sound changes
  • May not work on all device models or OS versions
  • File path must be valid and accessible
  • Potential rejection during app store review due to system-level access

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

ringtone_set

Flutter package for easily setting device's default ringtone, notification sound and alarm.

[!IMPORTANT] Works only on Android

pub package

Getting Started

Add these lines to AndroidManifest.xml.

<manifest>
...
    <uses-permission android:name="android.permission.WRITE_SETTINGS"
        tools:ignore="ProtectedPermissions" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
...
</manifest>
Set from assets

Put your sounds into <yourapp>/assets/ add them to your pubspec.yaml

flutter:
  assets:
    - assets/music.mp3
dependencies:
  ringtone_set: ^0.0.2

Import the package

import 'package:ringtone_set/ringtone_set.dart';

Call the function

RingtoneSet.setRingtone("assets/music.mp3");

or

RingtoneSet.setNotification("assets/music.mp3");

or

RingtoneSet.setAlarm("assets/music.mp3");
Set from Network

You can also set ringtone from network URL:

RingtoneSet.setRingtoneFromNetwork("https://example.com/music.mp3");

or

RingtoneSet.setNotificationFromNetwork("https://example.com/music.mp3");

or

RingtoneSet.setAlarmFromNetwork("https://example.com/music.mp3");
Set from File

Finally, you can set ringtone from a File object as well:

final File ringtoneFile = File("music.mp3");

RingtoneSet.setRingtoneFromFile(ringtoneFile);

RingtoneSet.setNotificationFromFile(ringtoneFile);

RingtoneSet.setAlarmFromFile(ringtoneFile);

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.