Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Swift subscription with completion block #11

Open
webmagnets opened this issue Jun 26, 2015 · 2 comments
Open

Swift subscription with completion block #11

webmagnets opened this issue Jun 26, 2015 · 2 comments

Comments

@webmagnets
Copy link

Can you please provide a sample for subscribing an email address with a block in Swift?

@fabreax
Copy link

fabreax commented Jan 18, 2016

I'm also looking for a swift sample

@fabreax
Copy link

fabreax commented Jan 18, 2016

This is a functional sample :

ChimpKit.sharedKit().apiKey = "your api key"
let params:[NSObject : AnyObject] = ["id": "your list id", "email": ["email": "[email protected]"]]
ChimpKit.sharedKit().callApiMethod("lists/subscribe", withParams: params, andCompletionHandler: {(response, data, error) -> Void in
            if let httpResponse = response as? NSHTTPURLResponse {
                NSLog("Reponse status code: %d", httpResponse.statusCode)
            }
})

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

No branches or pull requests

2 participants