Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3677] Android: URL Scheme intent is not being placed on AndroidManifest.xml after build

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-06-14T20:02:58.000+0000
Affected Version/sAppcelerator Studio 4.4.1
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, android-6, android-manifest, cli, url-scheme
ReporterCaio Perdona
AssigneeShak Hossain
Created2016-05-31T21:50:47.000+0000
Updated2016-06-14T20:02:59.000+0000

Description

After inserting code below into my tiapp.xml
<activity android:label="@string/app_name"
       android:configChanges="keyboardHidden"
       android:name=".PinionActivity"
       android:screenOrientation="portrait" android:theme="@style/Theme.NoActionBar"
       url="app.js" android:launchMode="singleTask" android:alwaysRetainTaskState="true">
            <intent-filter>
                  <action android:name="android.intent.action.MAIN"/>
                  <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
                  <action android:name="br.com.pinion.MESSAGE"/>
                  <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter>
                  <data android:scheme="pinion"/>
                  <action android:name="android.intent.action.VIEW"/>
                  <category android:name="android.intent.category.DEFAULT"/>
                  <category android:name="android.intent.category.BROWSABLE"/>
            </intent-filter>
</activity>
URL schemes fail to launch app. After researching a bit, I found that Titanium is failing to insert the intent-filter into the generated AndroidManifest.xml located on build folder. After overriding the tiapp.xml (putting generated AndroidManifest on app/platform/android) and manually inserting the code above, it worked like a charm. Can anyone help me with this issue? Thanks in advance.

Comments

  1. Nazmus Salahin 2016-06-02

    Hello, Please check if the format of your customized manifest in tiapp.xml is correct. Things are working just fine in my environment in this regard. Thanks *Customized manifest in tiapp.xml :*
        <android xmlns:android="http://schemas.android.com/apk/res/android">
           	<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gsl.ac3677" android:versionCode="1" android:versionName="1.0">
       			<application android:icon="@drawable/appicon" android:label="ac3677" android:name="Ac3677Application" android:debuggable="false" android:theme="@style/Theme.AppCompat">
       				<activity android:name=".Ac3677Activity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize">
       					
       					<intent-filter>
       						<action android:name="android.intent.action.MAIN"/>
       						<category android:name="android.intent.category.LAUNCHER"/>
       					</intent-filter>
       					
       			        <intent-filter>
                        	 	<action android:name="br.com.pinion.MESSAGE"/>
                        		<category android:name="android.intent.category.DEFAULT"/>
                   		</intent-filter>
       
                  			<intent-filter>
                       	 	<data android:scheme="pinion"/>
                        		<action android:name="android.intent.action.VIEW"/>	
                        		<category android:name="android.intent.category.DEFAULT"/>
                        	 	<category android:name="android.intent.category.BROWSABLE"/>
                   		</intent-filter>
       
       				</activity>
       		
       			</application>
       
       		</manifest>
       
    *Generated AndroidManifest.xml:*
       <?xml version="1.0" encoding="UTF-8"?>
       <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.abcd.ac3677" android:versionCode="1" android:versionName="1.0">
       	<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
       	<application android:icon="@drawable/appicon" android:label="ac3677" android:name="Ac3677Application" android:debuggable="false" android:theme="@style/Theme.AppCompat">
       		<activity android:name=".Ac3677Activity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize">
       			<intent-filter>
       				<action android:name="android.intent.action.MAIN"/>
       				<category android:name="android.intent.category.LAUNCHER"/>
       			</intent-filter>
       			<intent-filter>
       				<action android:name="br.com.pinion.MESSAGE"/>
       				<category android:name="android.intent.category.DEFAULT"/>
       			</intent-filter>
       			<intent-filter>
       				<data android:scheme="pinion"/>
       				<action android:name="android.intent.action.VIEW"/>
       				<category android:name="android.intent.category.DEFAULT"/>
       				<category android:name="android.intent.category.BROWSABLE"/>
       			</intent-filter>
       		</activity>
       		<activity android:name="org.appcelerator.titanium.TiActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
       		<activity android:name="org.appcelerator.titanium.TiTranslucentActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/Theme.AppCompat.Translucent"/>
       		<activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" android:configChanges="screenSize"/>
       		<service android:name="com.appcelerator.analytics.APSAnalyticsService" android:exported="false"/>
       	</application>
       	<uses-permission android:name="android.permission.INTERNET"/>
       	<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
       	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
       	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
       </manifest>
       
    *Environment*: *Device info:* Nexus7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
  2. Sharif AbuDarda 2016-06-02

    Hello, If you are having a specific issue using URL scheme in Android here is a fairly easy guide for you to follow. http://fokkezb.nl/2013/08/26/url-schemes-for-ios-and-android-1/. Follow the guide for using URL Scheme in Appcelerator. We are able to build and get the activity node in AndroidManifest.xml, which we then put in tiapp.xml Regards, Sharif
  3. Caio Perdona 2016-06-03

    Guys, still no luck. Intent is not being placed on manifest, followed the link above in the first time already. Can't find anything wrong with my tiapp.xml. This is so strange...
  4. Sharif AbuDarda 2016-06-09

    Hello, We are not able to regenerate your issue. Perhaps you are not correctly following the instruction in http://fokkezb.nl/2013/08/26/url-schemes-for-ios-and-android-1/. Please share with us how you are performing the action in details, possibly with screenshots or video demonstration. We will be able to escalate the ticket once we establish it's a real bug. Regards, Sharif.

JSON Source