Forum Discussion
infinite360vr
10 years agoExplorer
Unity - How to open Samsung Internet App from my Unity App
Here is a scenario, I want to redirect users to Samsung Internet Web Browser App to create a new account when they click on sign up button. Is there a way to open others app via Unity, Or can I show w...
vrdaveb
10 years agoOculus Staff
Virtual keyboard and in-app browser support aren't available yet. But you can send an intent to a web browser as described here. See the ACTION_VIEW intent:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(<your_url_string>));
public static final String SAMSUNG_INTERNET_PACKAGE_NAME = "com.sec.android.app.sbrowser";
// Extra used to match the session.
private static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
Bundle extras = new Bundle;
extras.putBinder(EXTRA_SESSION, sessionICustomTabsCallback.asBinder());
intent.putExtras(extras);
intent.setData(url);
intent.setPackage(SAMSUNG_INTERNET_PACKAGE_NAME );
context.startActivity(intent);If the user doesn't have the Samsung internet browser installed (which is not uncommon), this will fail. You may want to prompt the user to install it or use a generic ACTION_VIEW intent like the following:try {
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link));
startActivity(myIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "No application can handle this request."
+ " Please install a webbrowser", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 months ago
- 2 years ago
- 9 months ago