I'm building a web app to help Airbnb hosts manage their listings. I want to be notified of new reservation instead of pinging Airbnb's servers every few minutes. Airbnb's API doesn't have a way to push data to a server so I thought maybe I could emulate a device and receive push notifications.
Is this possible to emulate a device and receive push notifications in nodejs?
Looks like the iOS app registers for push notifications at the following address:
https://api.airbnb.com/v2/air_notification_devices
with the following data:
{
"app_version": "19.08",
"device_type": "iphone_gcm",
"device_id": "{{DEVICE_ID}}",
"token": "{{TOKEN}}",
"enabled": true
}
and with the following cookie:
SRVID=mofi-production-12ab3c456-7defg_172.21.128.38:32350
and returns:
{
"air_notification_device": {
"app_version": "19.08",
"created_at": "2019-03-01T16:27:13Z",
"device_id": "{{DEVICE_ID}}",
"device_type": "iphone_gcm",
"enabled": true,
"id":{{ID}},
"locale": "en",
"token": "{{DIFFERNT_TOKEN}}",
"updated_at": "2019-03-01T16:27:13Z",
"user_id": {{USER_ID}}
},
"metadata": {}
}
Without FCM, you'd need to build more than three notification systems. You'd need one each for iOS and Android, but then you'd also need to accommodate all the different types of browsers for the web application to deliver push notifications without a hitch.
Pull notifications are updates delivered to a computer or mobile device in response to a user or software-initiated poll of a remote server. Generally, pull notifications are how noncritical updates and communications are delivered.
Run the React app and visit your website. You should see the following prompt appear after your chosen time delay interval: Click on the blue Allow button to enable push notifications on your browser.
TL;DR: Yes you can, but without knowledge from receive these notifications you will not do much.
You must look for how the application registers for notifications. As you have the documentation, look for how to sign up for notifications.
BTW: Airbnb has push notification in browser? If so, I would be more interested in this than it was starting to debug the android application.
Without an official API, you'll have a good dose of reverse engineering, but 90% of them used there is FCM from google.
On a publicly available website in English they write only about OAuth2 and updates,but in my language I have:
What can I do with the Airbnb API?
The API allows teams of developers to conduct secure authorization on new and existing Airbnb accounts. Users of your application will have the option of receiving push notifications about content updates, rates and availability. Once Airbnb guests have booked your offer, we will pass on your booking information and details, allowing applications to create your own data flow and deliver amazing experiences to our common guests.
It's worth starting by installing the phone emulator, listen on all network communication and installing the application. But it will not be easy, because you have to do a Man in the middle attack for HTTPS communication.
The option is to decompile the official application and search in the code.
First you need to discover the service used for notifications. If this is FCM, then the process looks like this:
The application generates unique token identifying the application instance
The application sends this token to Airbnb to sign up for notifications
And I could not find a client in Node that would subscribe to notifications but here is Web (JS), so it is possible. (Again reverse engineering)
There is some about XMPP server receive upstream messages, but better write small app in C++ / Unity which will further forward notifications to Node eg via websocket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With