Skip to content

Instantly share code, notes, and snippets.

Last active May 28, 2021 16:48
  • Star 28 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Quick example of registering a URLScheme in a Titanium app using the TiApp.xml without info.plist file. Just add the following into your TiApp.xml (I put it under the </iphone> tag. Works on Android and iOS.

Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js

// points for getting this shorter using regex
function urlToObject(url) {
var returnObj = {};
url = url.replace('URLSCHEMENAME://?', '');
var params = url.split('&');
params.forEach(function(param) {
var keyAndValue = param.split('=');
returnObj[keyAndValue[0]] = decodeURI(keyAndValue[1]);
return returnObj;
function processArgs() {
if (Ti.App.getArguments().url) {
// on launch
// on resume
Ti.App.addEventListener("resumed", function(){
<android xmlns:android="">
<activity url="app.js"
android:launchMode="singleTask" android:alwaysRetainTaskState="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="" android:scheme="URLSCHEMENAME"/>
Copy link

bert-w commented Feb 21, 2017

Is this still working as supposed to? What does line #20 do in TiApp.xml ? url="app.js" does not make sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment