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...
infinite360vr
10 years agoExplorer
The code on Samsung developer website contains a lot of bugs and not even complete. So is of no use for a person who is working with Unity3D. But I was able to get help from other resources like this.
Here is my code that works fine:
Here is my code that works fine:
public class My_PluginUse this plugin like this:
{
public static My_Plugin instance;
public static void start()
{
instance = new My_Plugin();
}
public static void OpenURL(String url)
{
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
myIntent.setPackage("com.sec.android.app.sbrowser");
myIntent.setData(Uri.parse(url));
UnityPlayer.currentActivity.startActivity(myIntent);
}
}public class PluginsTest : MonoBehaviour
{
AndroidJavaClass pluginClass ;
void Start()
{
pluginClass = new AndroidJavaClass("com.library.myplugin.My_Plugin");
pluginClass.CallStatic ("start");
}
public void OnButtonClicked()
{
pluginClass.CallStatic ("OpenURL", "https://www.google.com");
}
}
Register the OnButtonClicked method to any button's onClick event listener.
Once you press the button and then take out the phone from Gear VR. It will open the browser with given url.
This is just a work around. Ideally I wanted to open Samsung Internet VR App without taking the phone out of Gear if that's possible
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