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

Send messages to topics for android #296

Merged
merged 1 commit into from
Oct 24, 2017
Merged

Send messages to topics for android #296

merged 1 commit into from
Oct 24, 2017

Conversation

appleboy
Copy link
Owner

@appleboy appleboy commented Oct 24, 2017

fix #265

Using binary:

$ gorush --android --topic "/topics/foo-bar" -m "This is a Firebase Cloud Messaging Topic Message" -k xxxxxxxxxx

Send JSON file:

$ bat POST localhost:8088/api/push notifications:=@test.json

result:

POST /api/push HTTP/1.1
Host: localhost:8088
Accept: application/json
Accept-Encoding: gzip, deflate
Content-Type: application/json
User-Agent: bat/0.1.0


{"notifications":[{"message":"This is a Firebase Cloud Messaging Topic Message","platform":2,"to":"/topics/foo-bar"}]}


HTTP/1.1 200 OK
Content-Type : application/json; charset=utf-8
X-Drone-Version : v1.9.0-84-g098f9da
Date : Tue, 24 Oct 2017 08:42:56 GMT
Content-Length : 242


{
  "counts": 1,
  "logs": [],
  "success": "ok"
}

Data:

{
  "notifications": [{
    "message": "This is a Firebase Cloud Messaging Topic Message",
    "platform": 2,
    "to": "/topics/foo-bar"
  }]
}

Server Log:

screen shot 2017-10-24 at 4 57 35 pm

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@codecov-io
Copy link

codecov-io commented Oct 24, 2017

Codecov Report

Merging #296 into master will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #296      +/-   ##
==========================================
+ Coverage   92.78%   92.95%   +0.16%     
==========================================
  Files          16       16              
  Lines        1247     1277      +30     
==========================================
+ Hits         1157     1187      +30     
  Misses         68       68              
  Partials       22       22
Impacted Files Coverage Δ
gorush/notification_fcm.go 89.39% <100%> (+2.12%) ⬆️
gorush/notification.go 100% <100%> (ø) ⬆️
gorush/worker.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4df2420...098f9da. Read the comment docs.

@appleboy appleboy merged commit 115ee18 into master Oct 24, 2017
@appleboy appleboy deleted the fcm-topic branch October 24, 2017 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support send to FCM topic message?
2 participants