Home › Forums › WPLMS Live › WPLMS Push Notifications › push notification add-registrationId API received 400 Bad Gateway error
Tagged: Firebase, WPLMS_Push_Notifications
- This topic has 9 replies, 2 voices, and was last updated 4 years, 5 months ago by Anshuman Sahu.
Viewing 10 posts - 1 through 10 (of 10 total)
-
AuthorPosts
-
May 31, 2020 at 6:02 pm #264527teqjassParticipantI have called add-registrationId API but I got the 400 bad gateway response in the API and firebase that particular user's registration id also not stored but all my wordpress registration id's are stored in firebase..here is my API response {"status":1,"message":"Device registered for Push Notification","response":{"headers":{},"body":"<html>\r\n<head><title>400 Bad Request<\/title><\/head>\r\n<body>\r\n<center><h1>400 Bad Request<\/h1><\/center>\r\n<hr><center>nginx<\/center>\r\n<\/body>\r\n<\/html>\r\n","response":{"code":400,"message":"Bad Request"},"cookies":[],"filename":null,"http_response":{"data":null,"headers":null,"status":null}},"path":"https:\/\/.firebaseio.com\/\/push_notification_users.json?auth=***"}June 1, 2020 at 6:31 am #264653Anshuman SahuKeymasterHi can you please share your site url , admin credentials and valid ftp credentials in order to check this out ? Also please make sure that your private key that you put in your wp-admin-> lms -> live should not coutain any // (slashes) in it. Secondly please make sure that your put the rules in your firebase database rules : { "rules": { ".read": "auth != null", ".write":"auth != null", "notifications":{ ".indexOn":["status"] }, "users":{ "$uid":{ "chats":{ ".indexOn":["lastUpdated"] } } } } }June 1, 2020 at 7:18 am #264678teqjassParticipantThis reply has been marked as private.June 2, 2020 at 12:08 pm #265106Anshuman SahuKeymasterThis reply has been marked as private.June 2, 2020 at 12:38 pm #265120teqjassParticipantI guess you miss understand my question...I am using REST API to register the user's mobile firebase device token https://mcgansonline.com/wp-json/wplms/v1/user/add-registrationId using this API. In the mysql database also I can see the mobile device token stored not is firebase. I got this below response for the API {"status":1,"message":"Device registered for Push Notification","response":{"headers":{},"body":"<html>\r\n<head><title>400 Bad Request<\/title><\/head>\r\n<body>\r\n<center><h1>400 Bad Request<\/h1><\/center>\r\n<hr><center>nginx<\/center>\r\n<\/body>\r\n<\/html>\r\n","response":{"code":400,"message":"Bad Request"},"cookies":[],"filename":null,"http_response":{"data":null,"headers":null,"status":null}},"path":"https:\/\/.firebaseio.com\/\/push_notification_users.json?auth=***"} Website push notification working perfectly and all the user's token saved in my firebase database, I can see that. So, please investigate. Thank youJune 3, 2020 at 2:20 pm #265537Anshuman SahuKeymasterYes the token from the app does not got to firebase right now . This is yet to be done with firebase php sdk . It only goes to our website database so that when any notification goes to that user we fetch her token from website database and send notification to her .June 3, 2020 at 2:44 pm #265542teqjassParticipantbut if I sent push notification to the particular student he is not receiving any message in his mobile, since I have a updated device token. in my browser console I got the error like this wplms-pn.js?ver=1.3:formatted:30696 Uncaught (in promise) e code: "messaging/permission-blocked" message: "Messaging: The required permissions were not granted and blocked instead. (messaging/permission-blocked)." stack: "FirebaseError: Messaging: The required permissions were not granted and blocked instead. (messaging/permission-blocked). what is the solution to send push notification to the mobile then?June 4, 2020 at 3:09 pm #265857Anshuman SahuKeymasterCan you please share a video of it. The error is that you have disabled the site notifications on your system of your own site . refer : https://support.google.com/chrome/answer/3220216?co=GENIE.Platform%3DDesktop&hl=enJune 4, 2020 at 3:28 pm #265862teqjassParticipantmessaging/permission-blocked is this error was solved...this is due to while I am sending push notification from incognito mode..But still I can not send message to my mobile app. If I send a push notification means I have received it in browser not in my mobile..I have logged in the mobile with same username and password but notification not received in mobile. Here is where I am sending push notification https://prnt.sc/stscjxJune 5, 2020 at 12:29 pm #266093Anshuman SahuKeymasterOhh yes that is also fetched from the firebase and not from the website database . We have yet to push the user device token to firebase using the firebase php sdk. However the option send notification to all student is sent from website's database .
-
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)
- The topic ‘push notification add-registrationId API received 400 Bad Gateway error’ is closed to new replies.