chat21-ionic icon indicating copy to clipboard operation
chat21-ionic copied to clipboard

Message Not Sent

Open mdarshath opened this issue 7 years ago • 5 comments

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?

mdarshath avatar Jun 11 '18 05:06 mdarshath

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

andrealeo83 avatar Jun 11 '18 09:06 andrealeo83

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

mdarshath avatar Jun 11 '18 12:06 mdarshath

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

andrealeo83 avatar Jun 11 '18 13:06 andrealeo83

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

mdarshath avatar Jun 12 '18 05:06 mdarshath

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

andrealeo83 avatar Jun 12 '18 10:06 andrealeo83