(I posted this in Android Development but it applies to both Android and iPhone so if there’s a better section for this post I apologize.)
My question:
Is it possible to launch another Unity application from within a Unity application? Basically I want to be able to press a “Start other app”-button inside Unity app #1 that launches this other Unity app (#2), or if it’s not yet downloaded takes me to AppStore/PlayStore.
Is something like Application.OpenURL() interesting here? Or what would be the best approach? I’m using Unity 4.3.2 btw.
make sure you have a function that can detect you phone and find your that way it will work properly mine works by checking if the URL address is there first so make sure your URL is right you my need to check your phone folder structure first before approaching this of just have
if (Input.GetButton("Start"))
{
Application.OpenURL("Your URL");
}
and keep it simple but if its not there it will not open
I think I need to specify a bit more: Can I somehow check if an app is installed? And if that app is installed can I make the phone launch it? Or if it’s not installed redirect the user/phone to AppStore/PlayStore?
I would be very grateful if I could get example code on these specific lines, if it’s even possible. Maybe I can do something with “com.company.appname”?
Thanks for your reply! I’m not sure this is what I’m looking for though, since I need it to work in Unity (C# scripts) and preferably something that will work with both iOS and Android, i.e. a Unity method. But maybe I’m misunderstanding something?
Sorry, I haven’t checked in here for over a week so I haven’t seen your question.
I have not found the answer I was looking for and since I have some deadline “issues”, I decided to use “Application.OpenURL (“link-to-my-other-app-in-GooglePlay/AppStore”);” instead. So when the user clicks the button that leads them to the store, they can choose to install the app (or open if already installed). This is a last solution I guess, but it works for me this time.
If you somehow find the answer to my original question, I would be very grateful if you would write the answer here.
The right question here is: Can we detect if apps are installed on device using custom URL schemes? We can’t do this from Unity API therefore we need a plugin.
Davesh, can your plugin do this or it can only launch those apps listed in description?
Ganesh, have you read the my plugin’s description?
This plugin is for Android and iOS so it will work on Android and iOS device only, it will not work in Unity Editor.
After integrating this plugin you can launch dial pad, message, gmail, skype, facebook etc from your unity app.
I edited my answer, so yeah there was not any bool before, no need to apologize for that xD
Hmm if you see my answer now, I put comment showing where to put your target bundle id not the name (“com.companyname.applicationame” in build setting), it is the
string bundleId = com.google.appname; // replace it to your target bundle ID
you dont need any .jar, it is default built-in within unity