Giter VIP home page Giter VIP logo

fcm's People

Contributors

gen1us2k avatar ovr avatar sev3ryn avatar themartorana avatar tjerkw avatar tobiaskaminsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fcm's Issues

Implement exponential backoff for 500-599 status codes

Errors in the 500-599 range (such as 500 or 503) indicate that there was an internal error in the FCM connection server while trying to process the request, or that the server is temporarily unavailable (for example, because of timeouts). Sender must retry later, honoring any Retry-After header included in the response. Application servers must implement exponential back-off.

notification click does not start application

Hello,

When I send a notification, I receive it but and when I click on it, it does not start my app when app is in background.

When I send using firebase console I can start my app even when app is in background.

I think I missed something on the payload to send or something.

Any help ?

Thank you

fcm.go incorrect logic

Hello, just wanted to point out that there is some inconsistency in file fcm.go in line 88:

image

(resp.StatusCode >= 500 && resp.StatusCode > 600) - this clause will never proccess 5xx statuses, which is this code for (due to commit messsage).

I hope this would help you!

cannot use "gopkg.in/maddevsio/fcm.v1".Message literal (type "gopkg.in/maddevsio/fcm.v1".Message) as type *"gopkg.in/maddevsio/fcm.v1".Message in argument to cfcm.Send

I'm trying to use this module with go gin, so just changed c to cfm in the test code:

func SendNotiPost(c *gin.Context) {
	data := map[string]string{
		"msg": "Hello World1",
		"sum": "Happy Day",
	}
	cfcm := fcm.NewFCM("myServerKy")
	token := myMobiletoken"
	response, err := cfcm.Send(fcm.Message{
		Data:             data,
		RegistrationIDs:  []string{token},
		ContentAvailable: true,
		Priority:         fcm.PriorityHigh,
		Notification: fcm.Notification{
			Title: "Hello",
			Body:  "World",
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("Status Code   :", response.StatusCode)
	fmt.Println("Success       :", response.Success)
	fmt.Println("Fail          :", response.Fail)
	fmt.Println("Canonical_ids :", response.CanonicalIDs)
	fmt.Println("Topic MsgId   :", response.MsgID)

	c.JSON(200, gin.H{"message": "Notifications sent"})
}

But I get:

controller/firebase.go:39: cannot use "gopkg.in/maddevsio/fcm.v1".Message literal (type "gopkg.in/maddevsio/fcm.v1".Message) as type *"gopkg.in/maddevsio/fcm.v1".Message in argument to cfcm.Send
controller/firebase.go:47: cannot use "gopkg.in/maddevsio/fcm.v1".Notification literal (type "gopkg.in/maddevsio/fcm.v1".Notification) as type *"gopkg.in/maddevsio/fcm.v1".Notification in field value

What's wrong here? How to fix it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.