push notification add-registrationId API received 400 Bad Gateway error

Home Forums WPLMS Live WPLMS Push Notifications push notification add-registrationId API received 400 Bad Gateway error

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #264527
    teqjass
    Participant
    I 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=***"}
    #264653
    Anshuman Sahu
    Keymaster
    Hi 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"] } } } } }
    #264678
    teqjass
    Participant
    This reply has been marked as private.
    #265106
    Anshuman Sahu
    Keymaster
    This reply has been marked as private.
    #265120
    teqjass
    Participant
    I 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 you
    #265537
    Anshuman Sahu
    Keymaster
    Yes 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 .
    #265542
    teqjass
    Participant
    but 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?
    #265857
    Anshuman Sahu
    Keymaster
    Can 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=en
    #265862
    teqjass
    Participant
    messaging/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/stscjx
    #266093
    Anshuman Sahu
    Keymaster
    Ohh 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 .    
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.