Skip to content

Integration Guide: Tumblr

Bryan Irace edited this page May 15, 2015 · 1 revision

The Tumblr share extension uses XExtensionItem to parse incoming data. This guide explains how applications can use XExtensionItem to pass their data in a format that the Tumblr share extension expects.

Custom parameters

Tumblr supports the following custom parameters:

  • Custom URL path component
  • Requested post type
  • Consumer key

Please see the XExtensionItemTumblrParameters header documentation for details about each.

Populating an instance and adding it to your item source can be done as follows:

XExtensionItemSource *itemSource = [[XExtensionItemSource alloc] initWithURL:[NSURL URLWithString:@"http://apple.com/ipad-air-2/"]];
itemSource.title = @"Apple";

[itemSource addCustomParameters:
 [[XExtensionItemTumblrParameters alloc] initWithCustomURLPathComponent:@"want-this-for-xmas"
                                                      requestedPostType:XExtensionItemTumblrPostTypeLink
                                                            consumerKey:@"YOUR_CONSUMER_KEY_HERE"]];

Attachments and built-in parameters

XExtensionItem’s attachments and built-in parameters map to Tumblr post fields in the following way:

All posts

Tumblr field XExtensionItem parameter
tags tags
Content source URL sourceURL

Text posts

Tumblr field XExtensionItem parameter
title title
body attributedContentText

Quote posts

Tumblr field XExtensionItem parameter
quote title, if exists, otherwise attributedContentText
source attributedContentText if title exists

Chat posts

Tumblr field XExtensionItem parameter
body attributedContentText

Link posts

Tumblr field XExtensionItem parameter
title title
URL attachments
description attributedContentText

Photo posts

Tumblr field XExtensionItem parameter
photo Attachments
caption attributedContentText

Video posts

Tumblr field XExtensionItem parameter
video Attachments
caption attributedContentText
Clone this wiki locally