Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tkyshm/pnsvc
Push Notification Service via FCM with Erlang/OTP.
https://github.com/tkyshm/pnsvc
apns erlang fcm otp push webpush
Last synced: 24 days ago
JSON representation
Push Notification Service via FCM with Erlang/OTP.
- Host: GitHub
- URL: https://github.com/tkyshm/pnsvc
- Owner: tkyshm
- License: apache-2.0
- Created: 2019-01-16T07:24:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-17T02:10:19.000Z (over 5 years ago)
- Last Synced: 2024-10-29T12:59:52.257Z (2 months ago)
- Topics: apns, erlang, fcm, otp, push, webpush
- Language: Erlang
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Push Notification Service (pnsvc)
=====## Overview
TBD
## Usage
```erlang
1> pnsvc:send(Request, GCPProjectId).{ok, 200, ...}
```### About Request
[FCM App Server Protocols HTTP v1 API.](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages?hl=ja)
- for example(android)
```erlang
#{
message => #{
notification => #{
title => <<"notification title"/utf8>>,
body => <<"notification body"/utf8>>
},
token => <<"fcm registration token">>,
android => #{
ttl => "3600s"
}
}
}.
```- for example(ios)
```erlang
TBD
```- for example(webpush)
```erlang
TBD
```### Push Notification test
- curl
```
$ curl -XPOST -H 'Content-Type: application/json' \
-d '{"message":
{
"token": "dR1Xd5PcL...xuyntS",
"data": {
"title": "notification title",
"body": "notification body",
"icon": "icon image",
"badge": "icon image url displayed at the device status bar"
}
}
}' http://localhost:5000/v1/projects/:project_id/send | jq .
````:project_id` is your firebase project id.