Skip to content

Instantly share code, notes, and snippets.

function handle_attachments() {
// make sure we have new args before firing
// prevents handling of the same file every time the app opens, resumes, etc
args = Ti.App.getArguments();
var file = args.url;
var source = args.source;
// make sure we have something to work with
if(!file) {
return false;
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>YOUR APPLICATION ID</string>
<key>CFBundleURLSchemes</key>
<array>
<string>YOUR APP NAME</string>
</array>
</dict>