You have found PodioPlatformKit, the official Objective-C and Swift SDK for Podio Platform. It works with both iOS and Mac OS X.

Build Status

For help post on Stack Overflow and tag with podio. For bugs create an issue on GitHub.

Working with Apps & Items

Fetching items

Apps and items are the corner stones of the Podio platform. An app is a container of multiple items. You can think of an app as a set of fields of different types, like the columns in a spreadsheet. The items in that app are then equivalent to the rows in the spreadsheet, i.e. the entires with one or more values for each field.

There are mupltiple types of fields in an app. A field supports a single or multiple values depending on its type. The available field types and their supported values are:

To fetch an item, use the class method on PKTItem:

[[PKTItem fetchItemWithID:1234] onComplete:^(PKTItem *item, NSError *error) {
  if (!error) {
    NSLog(@"Fetched item with ID: %@", @(item.itemID));
  }
}];

To fetch a list of items in an app, there is another handy method on PKTItem:

[[PKTItem fetchItemsInAppWithID:1234 offset:0 limit:30] onComplete:^(NSArray *items, NSUInteger filteredCount, NSUInteger totalCount, NSError *error) {
  if (!error) {
    NSLog(@"Fetched %@ items out of a total of @%", @(filteredCount), @(totalCount));
  }
}];

To access the values of an item, you can either use the -valueForField:(NSString *)externalID method on PKTItem, or use subscripting directly:

PKTItem *item = ...

PKTMoney *amount = item[@"amount"];
// Is equivalient to
PKTMoney *amount2 = [item valueForField:@"amount"];

The same works for updating field values:

PKTItem *item = ...

PKTMoney *amount = [PKTMoney alloc] initWithAmount:@123 currency:@"USD"];

item[@"amount"] = amount;
// Is equivalient to:
[item setValue:amount forField:@"amount"];

Creating a new item

To create an item, simply use the class methods on PKTItem:

PKTItem *item = [PKTItem itemForAppWithID:1234];
item[@"title"] = @"My first item";
item[@"description"] = @"This is my first item of many.";

[[item save] onComplete:^(PKTResponse *response, NSError *error) {
  if (!error) {
    NSLog(@"Item saved with ID: %@", @(item.itemID));
  } else {
    // Handle error...
  }
}];

Updating an existing item

To update an item, use the same save method as described in Creating a new item above. PodioPlatformKit will know if the item already exists and needs to be created, or if it should only be updated.