Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by vprabhu · Mar 22, 2012 at 09:36 PM · iosurl

URL scheme to launch Unity3d app in iOS

Hi everyone.

I've made a Unity3d iOS app which has two modes internally: Mode A and Mode B, which do different things within the app. There's gonna be another iOS app (non Unity3d) which can launch my app in either mode via the iOS URL scheme. For example: to launch my app in mode A, the URL to be called will be something like project:\\\modeA and project:\\\modeB to launch mode B.

Now I know that the UIApplication delegate in Unity3D is the AppController.mm file which is created once we've built the project.

My question is: how do I pass these URL parameters to the Unity app which determine the mode to be opened under ? And how should a Unity script do the polling to find out about the parameters and start the app in a particular mode ?

Any help in this regard is appreciated.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image toum · Aug 30, 2012 at 08:59 AM 0
Share

I need a help for the same thing. Anyone already do that?

avatar image AppAnalytics · Oct 29, 2012 at 10:26 PM 0
Share

+1 - is there anyway to access the URL?

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by liszto · Oct 29, 2012 at 10:37 PM

I think what you search is here : http://docs.unity3d.com/Documentation/Manual/PluginsForIOS.html

You must probably use the Unity/XCode call back.

So to do that you probably gonna use : UnitySendMessage("GameObjectName1", "MethodName1", "Message to send");

I don't know if it's exactly what you need but I think It's a good start ;). I'm still searching..

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by vprabhu · Oct 30, 2012 at 02:41 AM

You are right. I need to create a plugin that's coded in Objective C which passes parameters via the URL method to the Unity3d app. Using those parameters I could enable the different modes within the game. Also, I'm guessing this plugin would need to be added to the libraries in the xcode project.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image liszto · Oct 30, 2012 at 06:27 AM 0
Share

Indeed you must add it to XCode project. With that the Unity project can access to it. After I just code some interactions between Unity & XCode and never something like this. I suppose you can have more than 1 solutions. Like start Unity with an empty scene which call your app, when your app send the UnitySend$$anonymous$$essage(your parameters), Unity catch this callback and continue with the good mod.

avatar image liszto · Oct 30, 2012 at 06:31 AM 0
Share

Other solution but I never do this so I don't know if it's possible but I think yes. You can modify your XCode project to start with your Objective-C program and the user choose its mod, the Unity apps start (But I don't know if it's possible) You must probably create a plugin then modify the AppController.mm or something like this. I can check how to do this when I will be at the office. I work on iOS project cause here I don't have any $$anonymous$$AC.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is there a way to tell in Unity iOS when onDidReceiveMemoryWarning is received? 3 Answers

VideoPlayer from URL has extremely low frame rate in iOS 1 Answer

Videoplayer URL choppy on iOS 0 Answers

WWW Request for image error, unsupported URL 1 Answer

Does unity change AppController.mm or is it the same every time? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges