[AC-428] URL scheme Android returns null
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2015-11-21T18:51:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Studio |
Labels | android, handler, scheme, url |
Reporter | Jan van Kampen |
Assignee | Sharif AbuDarda |
Created | 2015-09-24T10:01:14.000+0000 |
Updated | 2015-12-23T16:40:09.000+0000 |
Description
I want to add an URL handler to my app. Currently, the app is opening when I open 'myapp://history', but there is no way to receive 'history' in the app. I followed a bunch of tutorials, including the tutorial of Fokke, but the intent data is always null.
tiapp.xml
<activity
android:configChanges="keyboardHidden|screenSize"
android:launchMode="singleTask"
android:name="org.appcelerator.titanium.TiTranslucentActivity" android:theme="@style/Theme.AppCompat.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myapp"/>
</intent-filter>
</activity>
First lines of alloy.js
if (OS_ANDROID) {
var platformTools = require('bencoding.android.tools').createPlatform(),
wasInForeGround = true;
setInterval(function() {
var isInForeground = platformTools.isInForeground();
if (wasInForeGround !== isInForeground) {
if (isInForeground) {
console.log('start');
console.log(Ti.Android.currentActivity.getIntent());
console.log('stop');
}
wasInForeGround = isInForeground;
}
}, 2000);
}
Hello, Can you take a look at these community links below? [Link1](https://developer.appcelerator.com/question/120393/custom-url-scheme---iphone--android) [Link2](https://developer.appcelerator.com/questions/tag/url%20scheme) [Link3](https://developer.appcelerator.com/question/162165/tiandroidcurrentactivityintentdata-always-null-when-application-resume) Thanks.
Links provided do not show a solution. Note: this is an alloy application (I am co-worker of Jan, therefore my response :) )
I'm experiencing exactly the same problems. Also in Common JS/Classic Titanium. Links provided do not provide any solution.