Android Live Updates for bare React Native.
This is a bare React Native port of expo-live-updates by Software Mansion Labs. It tracks the upstream library and exposes the same API as a React Native TurboModule, so projects not using the Expo managed workflow can use Live Updates on Android 16+.
This project is not affiliated with Expo or Software Mansion. All core notification logic originates from expo-live-updates.
npm install react-native-android-live-updatesimport {
startLiveUpdate,
updateLiveUpdate,
stopLiveUpdate,
addNotificationStateChangeListener,
addTokenChangeListener,
} from 'react-native-android-live-updates';
const notificationId = startLiveUpdate(
{
title: 'Order in progress',
text: 'Preparing your order',
progress: { max: 100, progress: 25 },
},
{ deepLinkUrl: '/orders/123' }
);
if (notificationId) {
updateLiveUpdate(notificationId, {
title: 'Order in progress',
text: 'Almost ready',
progress: { max: 100, progress: 80 },
});
}
const notificationSub = addNotificationStateChangeListener((event) => {
console.log(event.notificationId, event.action);
});
const tokenSub = addTokenChangeListener((event) => {
console.log(event.token);
});
if (notificationId) {
stopLiveUpdate(notificationId);
}
notificationSub?.remove();
tokenSub?.remove();Add permissions to AndroidManifest.xml:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.POST_PROMOTED_NOTIFICATIONS" />Add metadata inside the <application> tag:
<!-- Required -->
<meta-data
android:name="expo.modules.liveupdates.channelId"
android:value="LiveUpdatesServiceChannelId" />
<meta-data
android:name="expo.modules.liveupdates.channelName"
android:value="Live Updates Service Channel Name" />
<!-- Optional: required only for deepLinkUrl support -->
<meta-data
android:name="expo.modules.scheme"
android:value="your-app-scheme" />The
expo.modules.*key names are intentionally kept identical to upstream for compatibility.
Register the broadcast receiver inside the <application> tag:
<receiver
android:name="com.androidliveupdates.liveupdates.NotificationDismissedReceiver"
android:enabled="true"
android:exported="false" />If you use Firebase Cloud Messaging, also register the service:
<service
android:name="com.androidliveupdates.liveupdates.FirebaseService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>If you use deep links, add a matching VIEW intent filter for your activity.
Android 16 (API 36) and above. iOS autolinking is disabled via react-native.config.js.
See CONTRIBUTING.md.
MIT — see LICENSE. Portions of this library are derived from expo-live-updates by Software Mansion Labs.