Skip to content

richm541/ios-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Constant Contact IOS SDK

Installation

In order to use the Constant Contact SDK you have to follow these steps:

  1. Open the project in Xcode

  2. Drag The Constant Contact Folder into the Project Navigation Panel.

  3. On the popup make shire you have selected: Folders : "Create groups for ant added folders" Add to targets: "" Destination: "Copy items into destination group's folder(if needed)"

Usage

  1. In the file you wish to use the SDK include the following code in your header file:

#import "CTCTOAuth2.h" -for the authentication process
#import "Config.h" -for api key and other configuration elements
#import "ContactsCollection.h" -for contact collection manipulation
#import "ListsCollection.h" -for list collection manipulation
#import "ActivityService.h" -for activity manipulation
#import "EmailCampaignService.h" -for email campaign manipulation
#import "CampaignScheduleService.h" -for campaign schedule manipulation
#import "CampaignTrackingService.h" -for campaign tracking manipulation
#import "ContactTrackingService.h" -for contact tracking manipulation
#import "VerifiedEmailAddress.h" -to obtain the valid email addresses used in some calls

  1. Create a authentication object with your user credentials:
Instantiate your credentials

In the Config directory open the Congif.plist file.

Select the config drop down section fill in your consumer_secret, api_key, and redirect_uri keys.

######Store the values in a "CTCTOAuth2" object

CTCTOAuth2 *ctctOauth2 = [[CTCTOAuth2 alloc] initWithClientID:[Config valueForType:@"config" key:@"api_key"]
									    redirectURI:[Config valueForType:@"config" key:@"redirect_uri"]
									    userName:YourUserName 
									    password:YourPassword];

Note: 'your redirect url' is the URL of the action you just created.

  1. Make the call for the user token using the initiated "CTCTOAuth2" object, and save the token in a object of your choosing.
NSString *myToken = [ctctOauth2 accessToken];

Note: Requesting the access token implicitly implies that you are giving the all the permissions needed by the SDK, no further permissions are required.

  1. Start using the SDK.

######Example for getting a array of contacts

HttpResponse *result = [ContactsCollection contactsWithAccessToken: myToken];
NSArray *contactArray = result.data;

About

Constant Contact IOS SDK for v2

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 76.8%
  • JavaScript 23.2%