URL Schemes in Twitterrific
What is the URL scheme for Twitterrific?
URL schemes can be used by other applications to communicate with Twitterrific. The protocol for the URL is the application's name:
twitterrific://
NOTE: twitterrific5://
is provided for backward compatibility.
Choosing the Account
When communicating with the app, you can optionally specify an account using the URL host. For example, to use the CHOCKLOCK account you'd specify:
twitterrific://account/CHOCKLOCK/
You can get the current account by specifying "current" or a blank string for the host. For example:
twitterrific://current/
twitterrific:///
In Twitterrific on iOS the current account is the last one used. On macOS, the frontmost timeline is considered the current account; if there is no timeline one will be opened using the primary account.
Opening the App
If you just want to open the application, you can use:
twitterrific://
twitterrific://<account>/
The second example will also open the specified account.
Selecting a Timeline
You can select one of the timelines using the following URL resources:
twitterrific://<account>/tweets
twitterrific://<account>/mentions
twitterrific://<account>/messages
twitterrific://<account>/favorites
Opening Searches and Lists
When opening a search or list timeline, you'll also need to specify a query or name:
twitterrific://<account>/search?q=query%20with%20percent%20encoding
twitterrific://<account>/list?name=name%20with%20percent%20encoding
All query parameters should be percent encoded per RFC 2986.
An invalid or blank list name will present the list selection interface.
Viewing Tweets and Profiles
Tweets and user profiles can be opened using the following syntax:
twitterrific://<account>/tweet?id=1234
twitterrific://<account>/profile?screen_name=Iconfactory
Posting a Tweet
To open the compose view with a pre-populated message use this URL:
twitterrific://<account>/post?message=message%20with%20percent%20encoding
You can also supply a tweet ID to generate a reply:
twitterrific://<account>/post?message=message&reply_to_id=1234
Opening Message Threads
To open a message thread with a user and send them a message, you'll need to supply their user ID as a parameter:
twitterrific://<account>/send?recipient_id=643443
To get a user ID, you can use Twitterrific's user profile. It shows the user ID formatted as #643,443 – remove the hash and commas and use the numbers only.
Creating Muffle Rules
You can add a muffle rule to the selected account using any percent-encoded text:
twitterrific://account/gnitset/muffle?add=rule%20with%20percent%20encoding
twitterrific://account/gnitset/muffle?add=%23GameOfThrones
twitterrific://account/gnitset/muffle?add=%40HottPockets69
The last two examples show how this feature can muffle hash tags (%23 is '#') or user accounts (%40 is '@').
Sample Code
Now that you've seen all the available functions and parameters, you may need some guidance on how to apply them in your preferred coding environment. The sample code below covers the most common uses.
To post a tweet from Twitterrific on iOS, you'd use the following Swift code:
let scheme = "twitterrific:"
let account = "account/CHOCKLOCK"
let function = "post"
let parameters = "message=Poopin'