# Rocket Chat notifications Could not send notification id: \\"undefined\\", Error: Cannot read property 'send' of undefined

**URL:** <https://forums.rocket.chat/t/rocket-chat-notifications-could-not-send-notification-id-undefined-error-cannot-read-property-send-of-undefined/17217>\
**Category:** Community Support\
**Tags:** mobile, rocketchat-apps\
**Created:** [July 6, 2023, 7:38am UTC](https://forums.rocket.chat/t/rocket-chat-notifications-could-not-send-notification-id-undefined-error-cannot-read-property-send-of-undefined/17217 "2023-07-06T07:38:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sareerkhan](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sareerkhan](https://forums.rocket.chat/u/sareerkhan)\
**Post date:** [July 6, 2023, 7:38am UTC](https://forums.rocket.chat/t/rocket-chat-notifications-could-not-send-notification-id-undefined-error-cannot-read-property-send-of-undefined/17217/1 "2023-07-06T07:38:39Z")

</div>

I have setup self hosted rocket chat server on my debian machine using snap package. Using websocket and some external APIs of rocket chat i have setup a custom flutter app. Everythings works fine except notifications.

For notification i have setup configuration where certificate and keys are required under Settings-\>Push copied from firebase console

On app, each time i login, FCM token is send to rocket chat server agains user using [https://developer.rocket.chat/reference/api/rest-api/endpoints/push-token-endpoints/push-token](https://developer.rocket.chat/reference/api/rest-api/endpoints/push-token-endpoints/push-token)  
I want that if mobile app is closed i should receive a notification but in logs i see this on new message send from admin to user

```auto
{"level":20,"time":"2023-07-06T07:10:30.681Z","pid":66241,"hostname":"chat","name":"Push","msg":"send to token {\"apn\":\"fcaHkHHOD0xSvOEb6hn2tO:APA91bHRxj_6wt3yNBb58t4Qy8GjGuH7xi7yz_pEQwKgre3oYTMzNyttrb33xvyVoCRFIKwRhisKUAivSJfJW-UUdLMjRLOlX4nUXgcIt2lb1JpxDRMQVAEH2rOSJqndrvVW06vcUmol\"}"} 
{"level":20,"time":"2023-07-06T07:10:30.681Z","pid":66241,"hostname":"chat","name":"Push","msg":"send to token {\"apn\":\"fcaHkHHOD0xSvOEb6hn2tO:APA91bHRxj_6wt3yNBb58t4Qy8GjGuH7xi7yz_pEQwKgre3oYTMzNyttrb33xvyVoCRFIKwRhisKUAivSJfJW-UUdLMjRLOlX4nUXgcIt2lb1JpxDRMQVAEH2rOSJqndrvVW06vcUmol\"}"} 
{"level":20,"time":"2023-07-06T07:10:30.682Z","pid":66241,"hostname":"chat","name":"Push","msg":"Could not send notification id: \"undefined\", Error: Cannot read property 'send' of undefined"}

```

It always look for an old apn token instead i am sending gcm token on POST method agains the user.

I am really confused what am i messing to acheive this goal. Any help will really be appriciated.

### Server Setup Information

Version: 6.2.8  
Apps Engine Version: 1.39.1  
Node Version: v14.21.2  
Database Migration:294 (July 5, 2023 2:25 PM)  
MongoDB: 5.0.15 / wiredTiger (oplog Enabled)  
Commit Details  
HEAD: (27753d300)  
Branch: HEAD

can provide more details if needed.

 ![Screenshot 2023-07-06 at 2.27.40 PM](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/d/dd1709dfcc1896f0f347f2cc692b27a67437bdbd.png)
