url handling on Android with Enterprise

Has anyone gotten URL handling to work on Android with Enterprise?

I want to do something like if the user clicks on a link in their email that says"customcode://unlock-test-mode" then it will allow a tester to unlock certain modes, basically just doing URL scheme handling like is allowed in iOS Corona.

Is there a way to do this with Android Enterprise? I think maybe we have to create a new Intent? But this is over my head with my limited Android skills. Any advice would be greatly appreciated! [import]uid: 122310 topic_id: 34971 reply_id: 334971[/import]

To answer my own question, and so others can enjoy:

I just modified the activity android:name="com.ansca.corona.CoronaActivity" to have an additional intent-filter:

[code]
<intent-filter><br> <action android:name="android.intent.action.MAIN"></action><br> <category android:name="android.intent.category.LAUNCHER"></category><br>	</intent-filter>

<intent-filter><br> <action android:name="android.intent.action.VIEW"></action><br> <category android:name="android.intent.category.DEFAULT"></category><br> <category android:name="android.intent.category.BROWSABLE"></category><br> <data android:scheme="yourschemaname"></data><br>	</intent-filter>
[/code]

This seems to do all the necessary magic. The same URL handling code that works for iOS just gets automatically called by Corona. [import]uid: 122310 topic_id: 34971 reply_id: 139023[/import]

What you are doing is the best way to handle it. Plus, tapping the same URL scheme from another app (let’s say the main Browser app) will launch your app as well and give you the url via the main.lua file’s launchArgs or the applicationOpen system event.

Just so you know, the standard Android WebView does not behave the same as iOS’ WebView. For example, if you tap on a “mailto://” URL, Android will not automatically launch the mail app. Google expects you to override the URL handling and do that yourself in Java. The same is true of HTML5 videos. Google expects you to launch your own VideoView in that case as well. Meanwhile, iOS does all of this for free with no extra code. Welcome to Android!
[import]uid: 32256 topic_id: 34971 reply_id: 139095[/import]

To answer my own question, and so others can enjoy:

I just modified the activity android:name="com.ansca.corona.CoronaActivity" to have an additional intent-filter:

[code]
<intent-filter><br> <action android:name="android.intent.action.MAIN"></action><br> <category android:name="android.intent.category.LAUNCHER"></category><br>	</intent-filter>

<intent-filter><br> <action android:name="android.intent.action.VIEW"></action><br> <category android:name="android.intent.category.DEFAULT"></category><br> <category android:name="android.intent.category.BROWSABLE"></category><br> <data android:scheme="yourschemaname"></data><br>	</intent-filter>
[/code]

This seems to do all the necessary magic. The same URL handling code that works for iOS just gets automatically called by Corona. [import]uid: 122310 topic_id: 34971 reply_id: 139023[/import]

What you are doing is the best way to handle it. Plus, tapping the same URL scheme from another app (let’s say the main Browser app) will launch your app as well and give you the url via the main.lua file’s launchArgs or the applicationOpen system event.

Just so you know, the standard Android WebView does not behave the same as iOS’ WebView. For example, if you tap on a “mailto://” URL, Android will not automatically launch the mail app. Google expects you to override the URL handling and do that yourself in Java. The same is true of HTML5 videos. Google expects you to launch your own VideoView in that case as well. Meanwhile, iOS does all of this for free with no extra code. Welcome to Android!
[import]uid: 32256 topic_id: 34971 reply_id: 139095[/import]