Native module for handle android broadcast
npm install react-native-handle-broadcast
<receiver android:name="com.handlebroadcast.BroadcastReceiverReceiver" android:enabled="true" android:exported="true">
<intent-filter android:priority="1000">
<action android:name="com.zzzz.yyyy.action" />
<category android:name="android.intent.category.DEFAULT"></category>
</intent-filter>
</receiver>
import { BroadcastReceiver } from 'react-native-handle-broadcast';
BroadcastReceiver.setIntentActionConfig([
{ action: 'com.zzzz.yyyy.action', datakey: '<data_key>' },
]);
React.useEffect(() => {
const sub = BroadcastReceiver.addEventListener((data) =>
console.log(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