-
Notifications
You must be signed in to change notification settings - Fork 15
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.
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"]];
XExtensionItem’s attachments and built-in parameters map to Tumblr post fields in the following way:
Tumblr field | XExtensionItem parameter |
---|---|
tags | tags |
Content source URL | sourceURL |
Tumblr field | XExtensionItem parameter |
---|---|
title | title |
body | attributedContentText |
Tumblr field | XExtensionItem parameter |
---|---|
quote | title, if exists, otherwise attributedContentText |
source | attributedContentText if title exists |
Tumblr field | XExtensionItem parameter |
---|---|
body | attributedContentText |
Tumblr field | XExtensionItem parameter |
---|---|
title | title |
URL | attachments |
description | attributedContentText |
Tumblr field | XExtensionItem parameter |
---|---|
photo | Attachments |
caption | attributedContentText |
Tumblr field | XExtensionItem parameter |
---|---|
video | Attachments |
caption | attributedContentText |