Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message Not Sent #42

Open
mdarshath opened this issue Jun 11, 2018 · 5 comments
Open

Message Not Sent #42

mdarshath opened this issue Jun 11, 2018 · 5 comments

Comments

@mdarshath
Copy link

I have integrated all the things correctly the registration and login work perfectly but message not sending to another user. in the database table can't be created conversation table because no messages sent.
Finally, can you send the database rules for security?

@andrealeo83
Copy link
Contributor

Did you follow all the configuration steps?
In particular did you install Chat21 Firebase Cloud Functions as described here : https://github.com/chat21/chat21-cloud-functions

When you install Chat21 Firebase Cloud Functions the database rules are automatically installed.
You can find database rules here :
https://github.com/chat21/chat21-cloud-functions/blob/master/database.rules.json

@mdarshath
Copy link
Author

mdarshath commented Jun 11, 2018

Hai, now I have followed the cloud functions setup. I have integrated the functions in firebase. I am Having Following error in firebase function Request InserAndSendMessage Function. while sent a message.

TypeError: Cannot read property 'message_id' of undefined
at exports.insertAndSendMessage.functions.database.ref.onCreate.event (/user_code/index.js:33:36)
at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27)
at next (native)
at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71
at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:82:36)
at /var/tmp/worker/worker.js:716:24
at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Please Help me @alessandro-giovinazzo

@andrealeo83
Copy link
Contributor

Can you run "firebase --version" and confirm your firebase installation version is 3.16.0 ?As described on the Chat21 Cloud Functions REAME at the moment we don't support 3.18.0 and upper versions

@mdarshath
Copy link
Author

mdarshath commented Jun 12, 2018

my firebase version is 3.16.0 but the message can not be sent. in my console "OK MSG SENT WITH SUCCESS TO SERVER" but message not sent in my firebase functions dashboard the request has been called. with the following error above I have mentioned previous comment
ReferenceError: message_id is not defined
at exports.insertAndSendMessage.functions.database.ref.onCreate.event (/user_code/index.js:32:59)
at Object. (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:112:27)
at next (native)
at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71
at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:82:36)
at /var/tmp/worker/worker.js:716:24
at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Firebase Functions errors
createConversation -> gmp_databaseref.create/apps/{app_id}/users/{sender_id}/messages/{recipient_id}/{message_id}

insertAndSendMessage -> gmp_databaseref.create/apps/{app_id}/users/{sender_id}/messages/{recipient_id}/{message_id}

please help me @andrealeo83

@andrealeo83
Copy link
Contributor

Please uninstall firebase-tools and reinstall it with:

npm uninstall -g firebase-tools
npm install -g [email protected]

Please also check your package.json contains following lines:
"firebase-admin": "~5.5.0",
"firebase-functions": "^0.7.1",

After that run:

  • cd <project_dir>
  • rm -rf node_modules
  • npm install
  • firebase deploy

The problem is caused by the new firebase-functions v1.0 as described here:
https://firebase.google.com/docs/functions/beta-v1-diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants