react-native-eightnone-bridge
v1.1.0
Published
React Native Android native module providing alarms, notifications, media control, app info, battery, volume and wallpaper access.
Maintainers
Readme
react-native-eightnone-bridge
A powerful React Native Android native module written in Kotlin, providing deep system-level access for launchers and utility apps.
Built and used by 8NONE Launcher.
✨ Features
- ⏰ Schedule & manage exact alarms (supports reboot persistence)
- 🔔 Read active notifications (Notification Listener)
- 🎵 Control music playback & read media sessions
- 📱 Get installed, recent, running & launcher apps
- 🔋 Battery level access
- 🔊 Get & set system volume
- 🖼️ Get current wallpaper
- ⚙️ Open system settings (usage access, notification access, app info)
⚠️ Android only Designed for launchers, system utilities & productivity apps
📦 Installation
Local development (recommended)
npm install ../react-native-eightnone-bridgeor using file: dependency:
{
"dependencies": {
"react-native-eightnone-bridge": "file:../react-native-eightnone-bridge"
}
}Then run:
npm installAfter publishing to npm
npm install react-native-eightnone-bridge🔗 Linking
React Native 0.60+ supports autolinking automatically.
After installation:
cd android
./gradlew clean
cd ..
npx react-native run-android🧠 Android Permissions
This module uses system-level Android APIs.
You must declare the following permissions in your app’s AndroidManifest.xml:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" />⚠️ Some permissions cannot be auto-granted and require manual user enablement.
🚀 Usage
import EightNoneBridge from 'react-native-eightnone-bridge';
const {
AlarmModule,
BatteryModule,
VolumeModule,
AppInfoModule,
WallpaperModule,
MusicControlModule,
NotificationFetchModule,
} = EightNoneBridge;🔋 Battery
const level = await BatteryModule.getBatteryLevel();
console.log(level); // 0 - 100⏰ Alarms
await AlarmModule.schedule(
1,
Date.now() + 60_000,
'Reminder',
'Time is up!'
);Cancel alarm:
await AlarmModule.cancel(1);🔔 Notifications
Get active notifications:
const notifications =
await NotificationFetchModule.getAllStatusBarNotifications();
console.log(notifications);Open notification access settings:
NotificationFetchModule.openNotificationListenerSettings();Check notification permission:
const enabled =
await NotificationFetchModule.checkNotificationListenerPermission();🎵 Music / Media Control
Get active media sessions:
await MusicControlModule.getActiveMediaSessions();Control playback:
await MusicControlModule.controlMusic('pause');Available actions:
playpausenextprevious
📱 App Info
Get visible installed apps:
const apps = await AppInfoModule.getInstalledVisibleApps();Open app:
AppInfoModule.openApp('com.spotify.music');Get recent apps (requires Usage Access):
const recentApps = await AppInfoModule.getRecentApps();Open usage access settings:
AppInfoModule.openUsageAccessSettings();🔊 Volume
const volume = await VolumeModule.getCurrentVolume();
await VolumeModule.setVolume(50); // 0–100🖼️ Wallpaper
const wallpaperBase64 =
await WallpaperModule.getCurrentWallpaper();🔐 Permission Handling (Recommended Integration)
Runtime permissions (Android)
import { PermissionsAndroid, Platform } from 'react-native';
export const requestRuntimePermissions = async () => {
const permissions =
Platform.Version >= 33
? [
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES,
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
]
: [
PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
];
return PermissionsAndroid.requestMultiple(permissions);
};System permissions (Notification & Usage Access)
export const SYSTEM_PERMISSIONS = [
{
key: 'notification-access',
permissionName: 'Notification Access',
check: async () =>
await NotificationFetchModule.checkNotificationListenerPermission(),
onPress: () =>
NotificationFetchModule.openNotificationListenerSettings(),
},
{
key: 'usage-access',
permissionName: 'Usage Access',
check: async () => {
try {
await AppInfoModule.getRecentApps();
return true;
} catch {
return false;
}
},
onPress: () =>
AppInfoModule.openUsageAccessSettings(),
},
];⚠️ Notes & Limitations
- Android only
- Some APIs require manual user enablement
- Notification & usage stats are restricted permissions
- Best suited for launchers and system tools
🧪 Tested On
- Android 10 – Android 14
- React Native 0.71+
- Kotlin 1.8+
📄 License
react-native-eightnone-bridge
👨💻 Author
8NONE Launcher Team Rama HareshKiran
