✨ 🚀 Supports React-Native Bridgeless mode
This package allows you to register custom intent to listen in react native applications. The idea here is to reduce the number app builds that are required if you change the native code in react native. With this you can inject custom intent config at runtime.
npm install react-native-broadcast-receiver
yarn
yarn add react-native-broadcast-receiver
import { BroadcastReceiver } from 'react-native-broadcast-receiver';
BroadcastReceiver.setIntentActionConfig([
{ action: 'com.zzzz.yyyy.action1', datakey: '<data_key1>' },
{ action: 'com.zzzz.yyyy.action2', datakey: '<data_key2>' },
{ action: 'com.zzzz.yyyy.action3', datakey: '' }, // For empty dataKey an object will be returned instead of a string
]);
React.useEffect(() => {
const sub = BroadcastReceiver.addEventListner((d) =>
setScanned((x) => [...x, d.data])
);
return () => sub.remove();
}, []);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library