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

[Important] allow sending data ONLY notifications for FCM notifications #453

Merged
merged 5 commits into from
Jan 20, 2020

Conversation

SebastienMelki
Copy link
Contributor

Hey @appleboy ran into a little issue here need this tweak to be able send and process background notifications on android

If you want to process android notifications in the BACKGROUND, they need to be data notifications, as in not contain the "notification" key in the payload.

This little change achieves it, because omitempty on structs for the json encoding does not work on sub-structs except if it is a pointer to it and set to nil.

@appleboy appleboy self-assigned this Jan 17, 2020
@appleboy
Copy link
Owner

@SebastienMelki https://cloud.drone.io/appleboy/gorush/195/1/7

Please update the code format. Try make fmt command.

Copy link
Owner

@appleboy appleboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code format error.

@SebastienMelki
Copy link
Contributor Author

code format error.

on it thanks

@SebastienMelki
Copy link
Contributor Author

make fmt

done

…ienMelki/gorush into data_only_fcm_notifications
@codecov-io
Copy link

codecov-io commented Jan 20, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@8929554). Click here to learn what that means.
The diff coverage is 75.86%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #453   +/-   ##
=========================================
  Coverage          ?   83.05%           
=========================================
  Files             ?       20           
  Lines             ?     1393           
  Branches          ?        0           
=========================================
  Hits              ?     1157           
  Misses            ?      188           
  Partials          ?       48
Impacted Files Coverage Δ
gorush/notification.go 100% <ø> (ø)
config/config.go 93.97% <ø> (ø)
gorush/notification_fcm.go 82.3% <ø> (ø)
gorush/server.go 85% <100%> (ø)
storage/badger/badger.go 77.01% <100%> (ø)
gorush/notification_apns.go 85.23% <72.72%> (ø)
gorush/server_normal.go 78.04% <78.04%> (ø)

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 8929554...f32a6cc. Read the comment docs.

@appleboy appleboy merged commit 5cb40cf into appleboy:master Jan 20, 2020
@appleboy
Copy link
Owner

@SebastienMelki Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants