Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax highlighting to README snippets #5

Merged
merged 1 commit into from
May 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ Or install it yourself as:

## Usage

```
```ruby
message = {
title: "title",
body: "body",
icon: "http://example.com/icon.pn"
}

Webpush.payload_send(
message: JSON.generate(message),
endpoint: "https://android.googleapis.com/gcm/send/eah7hak....",
p256dh: "BO/aG9nYXNkZmFkc2ZmZHNmYWRzZmFl...",
auth: "aW1hcmthcmFpa3V6ZQ==",
api_key: "[GoogleDeveloper APIKEY]" # optional, not used in Firefox.
)
message: JSON.generate(message),
endpoint: "https://android.googleapis.com/gcm/send/eah7hak....",
p256dh: "BO/aG9nYXNkZmFkc2ZmZHNmYWRzZmFl...",
auth: "aW1hcmthcmFpa3V6ZQ==",
api_key: "[GoogleDeveloper APIKEY]" # optional, not used in Firefox.
)
```

### ServiceWorker sample
Expand All @@ -44,7 +44,7 @@ see. https://github.com/zaru/web-push-sample

p256dh and auth generate sample code.

```
```javascript
navigator.serviceWorker.ready.then(function(sw) {
Notification.requestPermission(function(permission) {
if(permission !== 'denied') {
Expand All @@ -63,7 +63,7 @@ navigator.serviceWorker.ready.then(function(sw) {

payloads received sample code.

```
```javascript
self.addEventListener("push", function(event) {
var json = event.data.json();
self.registration.showNotification(json.title, {
Expand Down