chandan
chandan

Reputation: 82

Can embeded browser (chrome) use GCM for Push Notification

I have embeded browser in my windows application using CEF.Can this browser which is rendered in my application window, use GCM(google cloud messaging) for receiving Push notification.

Upvotes: 0

Views: 112

Answers (1)

abielita
abielita

Reputation: 13469

You may want to check the documentation about Web Push Notifications. Push is based on service workers because service workers operate in the background. This means the only time code is run for a push notification (in other words, the only time the battery is used) is when the user interacts with a notification by clicking it or closing it. If you're not familiar with them, check out the service worker introduction.

With a service worker registration you call showNotification on a registration object.

serviceWorkerRegistration.showNotification(title, options);

The title argument appears as a heading in the notification. The options argument is an object literal that sets the other properties of a notification. A typical options object looks something like this:

{
  "body": "Did you make a $1,000,000 purchase at Dr. Evil...",
  "icon": "images/ccard.png",
  "vibrate": [200, 100, 200, 100, 200, 100, 400],
  "tag": "request",
  "actions": [
    { "action": "yes", "title": "Yes", "icon": "images/yes.png" },
    { "action": "no", "title": "No", "icon": "images/no.png" }
  ]
}

Check this documentation for additional information.

Upvotes: 1

Related Questions