Skip to content
Permalink
Browse files

- add push notification listeners

- fix AndroidManifest.xml
  • Loading branch information...
Vladmir Upirov
Vladmir Upirov committed Dec 11, 2018
1 parent daa865e commit 022e7e2c58d250dd67193338c3d496208c50e36e
Showing with 29 additions and 0 deletions.
  1. +21 −0 App.js
  2. +8 −0 android/app/src/main/AndroidManifest.xml
21 App.js
@@ -26,6 +26,27 @@ const instructions = Platform.select({

type Props = {};
export default class App extends Component<Props> {

constructor(props) {
super(props);

Backendless.Messaging.registerDevice(['default'])
.then(r => console.log('registerDevice:', r))
.catch(e => console.log('registerDevice:', e));
}

componentDidMount() {
Backendless.Messaging.addPushNotificationListener(this.onNotification);
}

componentWillUnmount() {
Backendless.Messaging.removePushNotificationListener(this.onNotification);
}

onNotification = notification => {
console.log('notification', notification)
};

render() {
return (
<View style={styles.container}>
@@ -21,6 +21,14 @@
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

<receiver android:name="com.reactlibrary.RNBackendlessPushNotificationActionReceiver"/>

<service android:name="com.reactlibrary.RNBackendlessPushNotificationService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
</application>

</manifest>

0 comments on commit 022e7e2

Please sign in to comment.
You can’t perform that action at this time.