- Home /
Open Url in browser on button click
Hello I am new to unity . I am developing an app in unity 3d .
Their is one functionality in which I want to open the weburl in browser through the game . On completing the browsing if user wants to go back their must be one button .
On clicking that button the previous state of the game must open i.e. the state where the user clicks the button to go to that webpage.
How to accomplice this task .It must not be difficult.
I am using Application.OpenURL(); to open webpage .
Here it opens in browser and their is no way to go back to the state of the game....
Thanks ...
You haven't mentioned what the target platform is. I'm assu$$anonymous$$g you're on mobile, because PC and $$anonymous$$ac deployments unfocusing the Unity app won't pause the game at all by default when you goto another app.
Depending on the platform you are using, you just go back to the game. Both iOS and Android will resume the game state when you go back to it, provided the memory hasn't needed to be reclaimed.
Think about what you're asking though. You want a button on a website to give an instruction to a native API. This, by design, is not allowed on either iOS or Android as it would compromise the security of the device.
Long story short, it isn't difficult; its impossible. All you can do is go 'back' to the application. On iOS this means double-tapping the home button and picking the app out of the task list. On Android that means either hitting the back button or holding the home button and selecting.
I am building for android and iphone .It's basically an Augmented Reality app so it is very important to go back to the current state of the application .can you suggest some methods without the last one which is some what difficult for users if they dont know how to use.
I think your third 3rd answer.can you please tell the steps or procedure for native API .or any example in this regard..
Thanks
Answer by aman_jha · Jul 04, 2014 at 01:53 PM
If it's an app for android or iphone, it's fine. The devices pause the game when you go to another app, so when the user presses back, it goes back to the app as if nothing happened. You probably don't actually want a button on your website that goes back. 1) There's no point. The user can just go back to your app like normal and 2) as iwaldrop has said, it could compromise the security of your application.
Your answer
Follow this Question
Related Questions
Cloud recognition in Vuforia 0 Answers
How add advertising in a free Android application using unity 1 Answer
Wrap unity3d inside an existing app 1 Answer
place data locally from install 0 Answers