Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "data": {
- "body": "here is body",
- "title": "Title",
- "click_action": "YOUR_ACTION"
- },
- "to": "ffEseX6vwcM:APA91bF8m7wOF MY FCM ID 07j1aPUb"
- }
- <activity
- android:name=".NotificationActivity"
- android:screenOrientation="portrait"
- android:theme="@style/Theme.AppCompat.Dialog"
- android:windowSoftInputMode="stateHidden" >
- <intent-filter>
- <action android:name="YOUR_ACTION" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- </activity>
- Bundle bundle=getIntent().getExtras();
- if(bundle!=null) {
- for (String key : bundle.keySet()) {
- Object value = bundle.get(key);
- Log.d("DATA_SENT", String.format("%s %s (%s)", key,
- value.toString(), value.getClass().getName()));
- }
- }
- {
- "data": {
- "body": "here is body",
- "title": "Title"
- },
- "notification": {
- "body": "here is body",
- "title": "Title",
- "click_action": "YOUR_ACTION"
- },
- "to": "ffEseX6vwcM:APA91bF8m7wOF MY FCM ID 07j1aPUb"
- }
- this.notificationListener =
- FCMNotification.onNotification((notificationOpen: NotificationOpen) => {
- const localNotification = new firebase.notifications.Notification({ sound: 'default', show_in_foreground: true})
- .setNotificationId(notificationOpen.notificationId)
- .setTitle(notificationOpen.title)
- .setSubtitle(notificationOpen.subtitle)
- .setBody(notificationOpen.body)
- .setData(notificationOpen.data)
- .android.setChannelId('cuddlynest')
- .android.setColor('#000000')
- .android.setAutoCancel(true)
- .android.setPriority(firebase.notifications.Android.Priority.High)
- .android.setSmallIcon('ic_stat_ic_notification');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement