Not so long ago, a new feature appeared in UC Browser - Facebook notification, and in this article we want to share with you some details. So, Facebook notification is a feature that allows you to receive messages and notifications from Facebook, even if your browser is closed. The user will receive push messages on the main screen of his phone and thus will not miss any important messages.
The basis for the implementation of this function was taken all known service - Google Cloud Messaging (GCM) and OAuth protocol.
In this diagram, we can see how the process of receiving notification occurs:
')
Step by step it looks like this:
Entrance:
1. The user logs in to Facebook.
2. Add-on "Better FB" will detect and check the status of cookies after the user has logged in to FB.
3. Add-on OAuth logs in the FB to get the user_access_token. The user will have to give permission to receive information.
4. Add-on is registered in the GCM and receives a registration ID (push_token).
5. Add-on is registered in FB using push_token.
6. FB starts sending GCM notifications using push_token.
Notifications stop as follows:
1. User logs out of Facebook.
2. Add-on "Better FB" detects that cookies are not available.
3. Add-on unregisters with GCM and cancels push_token.
4. Add-on unregisters with FB using push_token.
5. FB stops sending GCM notifications using push_token
API Push Notifications
Register access token:
api.facebook.com/method/user.registerPushCallback?protocol_params= {"token": "<push_token>", "app_version": "<app_version>"} & access_token = <user_access_token>
Unregistering an access token:
api.facebook.com/method/user.unregisterPushCallback?protocol_params= {"token": "<push_token>”} & access_token = <user_access_token>
Suspend / Resume Token:
api.facebook.com/method/user.registerPushCallback?protocol_params= {"token": "<push_token>", "app_version": "<app_version>", ”has_alerts_off”: true} & access_token = <user_access_token>
In a browser, it looks like this:
Go to the Browser Menu, and then go to Add-ons.
Next, click on the Facebook icon and enable the Notifications feature.
Login on your Facebook page.
After logging in to Facebook, we confirm permission to receive notifications.
Done, you can receive notifications.
It should be noted that the function was implemented thanks to the close cooperation of UCWeb with Facebook. This is the first time that a company gives access to online alerts in a third-party application. Such a partnership of companies proves the strong commitment of UC Browser to its goal of making a convenient browser for every day. Innovation especially appeal to those who prefer to use one application for most tasks in the browser.
PS We can not report another important news. Most recently, UC Browser reached 100 million active users per day (DAU) and became the world's largest independent mobile browser: according to StatCounter, UC Browser increased its market share in page views to 11.1%. In Russia over the past year, the number of daily active users has almost tripled, and the number of page views (PV) is 125%. In January, UC Browser also became the number one browser on Google Play in Russia and ranked third among the top free apps.