Skip to content

Commit

Permalink
fcm support (#196)
Browse files Browse the repository at this point in the history
* feat(fcm): fcm support
  • Loading branch information
dcai committed Aug 12, 2019
1 parent abe14ee commit 8f9a736
Show file tree
Hide file tree
Showing 33 changed files with 1,780 additions and 1,004 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: python
python:
- "2.6"
- "2.7"
- '2.7'
install:
- "pip install ."
- "pip install -r requirements.txt"
- 'pip install .'
- 'pip install -r requirements.txt'
script: make test
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ install:

test:
true

format:
black --exclude "venv\/|venv3.6\/|build/|buck-out/|dist/|_build/|\.eggs/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/" .
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,54 @@ Content-Type: application/json
}
```

### Sending notification via FCM
```
POST /api/v2/push HTTP/1.1
X-AN-APP-NAME: moodlemobileapp
X-AN-APP-KEY: b2b56dbb
Content-Type: application/json
{
"device": "fcm",
"token": "FE66489F304DC75B8D6E8200DFF8A456E8DAEACEC428B427E9518741C92C6660",
"alert": {
"title": "hello",
"body": "Hello from AirNotifier"
},
"fcm": {
"data": {
"story_id": "xxxxx"
},
"android": {
"collapse_key": "KKKKKKKKKK",
"priority": "NORMAL",
"ttl": "100",
"restricted_package_name": "package name",
"data": {
"android-data-key": "data-value",
},
"notification": {
"title": "android notification title",
"body": "android notification body",
"icon": "icon",
"color": "black",
"sound": "ring",
"tag": "app",
"click_action": "action name",
"body_loc_key": "loc key",
"body_loc_args": [
"abc"
],
"title_loc_key": "title key",
"title_loc_args": [
"title"
],
"channel_id": "new channel"
}
}
}
}
```

### SMS
```
POST /api/v2/push HTTP/1.1
Expand Down Expand Up @@ -98,7 +146,7 @@ Please read [Installation guide](https://github.com/airnotifier/airnotifier/wiki

- [Python 2.7.9+](http://www.python.org)
- [MongoDB 2.0+](http://www.mongodb.org/)
- [Tornado 3.0+](http://tornadoweb.org)
- [Tornado 4.5+](http://tornadoweb.org)

## Copyright
Copyright (c) Dongsheng Cai and individual contributors
Loading

0 comments on commit 8f9a736

Please sign in to comment.