The IBM Cloud Push Notifications service provides a unified push service to send real-time notifications to mobile and web applications. The Go SDK is used to manage Push Notifications service.
Ensure that you go through IBM Cloud Push Notifications service documentation before you start.
- An IBM Cloud account.
- An Push Notifications instance.
- Go version 1.15 or above.
Install using the command.
go get -u github.com/IBM/push-notifications-go-sdkTo import the module
import "github.com/IBM/push-notifications-go-sdk/pushservicev1"then run go mod tidy to download and install the new dependency and update your Go application's
go.mod file.
Initialize the sdk to connect with your App Configuration service instance.
func init() {
authenticator := &core.IamAuthenticator{
ApiKey: "apikey",
}
options := &pushservicev1.PushServiceV1Options{
ServiceName: "imfpush",
Authenticator: authenticator,
URL: "url",
}
app, err := pushservicev1.NewPushServiceV1(options)
if err != nil {
log.Fatal(err)
}
}- apikey : apikey of the Push notifications service. Get it from the service credentials section of the dashboard.
- url : url of the Push notifications Instance. URL instance can found from here
Refer to the example directory
This project is released under the Apache 2.0 license. The license's full text can be found in LICENSE