CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Feb 2015 |
Maintained by Meekan API, Eyal Yavor.
Meekan is a platform that helps people schedule meetings.
Our API can help developers integrate calendar event creation and modification, availability lookups, and time suggestions.
platform :ios, '7.0'
pod 'MeekanSDK', '~> 1.0'
Initialize a shared MeekanSDK
instance using your API Key
MeekanSDK *sdk =[MeekanSDK sharedInstanceWithApiKey:@"YOUR_API_KEY_HERE"];
You must be logged in as a Meekan User to perform operations on the backend.
There are 2 options exposed for now to login - via Google OAuth2, or directly to an exchange account.
Once connected, you get an object describing your user and accounts. More than one account can be connected to the current user, but using the "connect" method again.
MKNGoogleLoginViewController *viewController = [sdk connectWithGoogleWithCompletionHandler:^(MKNGoogleLoginViewController *vc, ConnectedUser *user, NSError *error) {
if (user) {
// Save current user and accounts
NSLog(@"User primary Email: %@", user.primaryEmail);
} else {
//
}
}];
[self.navigationController pushViewController:viewController animated:YES];
[self.sdk connectWithExchangeUser:accountParams[@"username"] withPassword:accountParams[@"password"] withEmail:accountParams[@"email"] withServerUrl:accountParams[@"url"] andDomain:accountParams[@"domain"] onSuccess:^(ConnectedUser *user) {
// Save connected user account details.
} onError:^(NSError *err) {
// Handle bad authentication details, retry
}];
Availability lookup allows you to find suggested times for a meeting using Meekan's schedueling engine. You use it by providing time frames for the meeting, as well as account IDs of participants. The operations returns ranked time slots based on availability.
SlotSuggestionsRequest *request = [[SlotSuggestionsRequest alloc]init];
request.organizerAccountId = @"YOUR_ACCOUNT_ID";
request.duration = 45; // Minutes
NSDate *now = [NSDate dateWithTimeIntervalSince1970:trunc([[NSDate date] timeIntervalSince1970])];
NSDate *inTwoHours = [now dateByAddingTimeInterval:120 * 60];
NSDate *inThreeHours = [now dateByAddingTimeInterval:180 * 60];
NSDate *inFourHours = [now dateByAddingTimeInterval:240 * 60];
request.timeFrameRanges = @[ @[now, inTwoHours],
@[inThreeHours, inFourHours];
[self.sdk suggestedSlots:request onSuccess:^(NSArray *slotSuggestions) {
for (SlotSuggestion *suggestion in slotSuggestions) {
NSLog(@"Start: %@, Unavailable: %@", suggestion.start, suggestion.busyIds);
}
NSSet *times = [NSSet setWithArray:[slotSuggestions valueForKey:@"start"]];
} onError:^(NSError *err) {
NSLog(@"Oops: %@", err);
}];
The MeetingDetails
instance contains information about the meeting to create.
MeetingDetails *details = [[MeetingDetails alloc]init];
details.accountId = @"4785074604081152";
details.title = @"Test Multiple";
details.durationInMinutes = 10;
NSDate *start = [NSDate dateWithTimeIntervalSince1970:1409477400];
NSSet *options = [NSSet setWithObjects:
[start dateByAddingTimeInterval:3600],
[start dateByAddingTimeInterval:7200],
[start dateByAddingTimeInterval:10800], nil];
details.options = options;
details.participants = [[MeetingParticipants alloc]init];
[self.sdk createMeeting:details onSuccess:^(MeetingServerResponse *details) {
NSLog(@"Created Meeting with ID: %@"details.meetingId);
} onError:^(NSError *err) {
// Handle error
}];
MeekanSDK
class contains all wrapped methods for now. Take a look at the exposed operations.
We'd love to hear your feedback. Send us issues or a pull request here, or contact us via email on [email protected].