Skip to content

📱 A simple API client to send push notifications using Batch.com service

License

Notifications You must be signed in to change notification settings

reyhoonia/go-batch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GoDoc license

Go Batch

This is a simple API client to send push notifications using Batch.

Installation

go get github.com/mamal72/go-batch
# or use dep, glide, vgo or whatever you like

Usage

package main

import "github.com/mamal72/go-batch"

func main() {
    client := batch.NewClient("YOUR_BATCH_REST_API_KEY", "YOUR_BATCH_API_KEY_FOR_YOUR_APP")
    payload := batch.TransactionalPushPayload{
        GroupID: "SOME_GROUP_ID",
        Recipients: batch.TransactionalPushRecipient{
            CustomIDs: []string{"1", "2"},
            // blah blah blah
        },
        Message: batch.TransactionalPushMessage{
            Title: "Greeting",
            Body:  "Hello dear user!",
        },
        // blah blah blah
    }

    response, err := client.TransactionalSend(payload)
    // handle error or get and store token from response
}

Ideas || Issues

Just fill an issue and describe it. I'll check it ASAP!

Contribution

You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. ❤️

License

MIT

About

📱 A simple API client to send push notifications using Batch.com service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Go 100.0%