Skip to content

Commit

Permalink
Add subscribe channel
Browse files Browse the repository at this point in the history
  • Loading branch information
kariudo committed Feb 6, 2015
1 parent 0c9cab9 commit 7ecd0cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gopushbullet.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,16 @@ func (c *Client) DeleteContact(contactID string) error {
return nil
}

//SubscribeChannel subscribes use to a specified channel
func (c *Client) SubscribeChannel(channel string) error {
_, apiError, err := c.makeCall("POST", "subscriptions", nil)
if err != nil {
log.Println("Failed to add subscription: ", err, apiError.String())
return err
}
return nil
}

func (c *Client) makeCall(method string, call string, data interface{}) (responseBody []byte, apiError *Error, err error) {
// make sure API key seems ok
if len(c.APIKey) == 0 {
Expand Down

0 comments on commit 7ecd0cd

Please sign in to comment.