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 /
This question was closed Dec 10, 2013 at 04:37 PM by StormSabotage for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by StormSabotage · Dec 09, 2013 at 09:57 PM · unity ios

Can't use JSON in WWW class iOS

Hello everyone. Maybe someone can help me with this, because i have no idea what's wrong. (sorry for my bad eng =)

So, i have client and php server and use JSON to make requests from client and do answers from server. (I'm sure, all scripts i wrote is good and have no errors)

In client-side i generate new WWW class with link to my server:

 http://myserver.com/index.php?DATA={*JSON_HERE*}&HASH=*HASH_HERE*

And at server-side i generate JSON answer and just use "print $json", so i can catch this response by looking in www.text string.

And all i made was good and worked fine until i started to build it on my iPad. Build process have no errors and application works good, but no answer was received from server. I spend a lot time searching what's wrong and i found it!

I found that my WWW class returns null when i try to access www.text and it happens only when URL string have JSON inside, so if i use:

 http://myserver.com/index.php?DATA=*SOME_VALUE*&HASH=*HASH_HERE*

that works, and if i try to use:

 http://myserver.com/index.php?DATA={*JSON_HERE*}&HASH=*HASH_HERE*

that will not work, and looks like just nothing happens. In both ways www.isDone will become True, but it will be empty if request link was with JSON value...

That's not server-side mistakes, i tried same link in usual browser and all works fine, also PC / MAC / Android compilations works fine, that happens only in iOS device.

I work on latest Unity Pro 4.3.1 f1 and Xcode 5.0.2.

Thanks a lot for helping.

Comment
Add comment
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

1 Reply

  • Sort: 
avatar image
2
Best Answer

Answer by Graham-Dunnett · Dec 09, 2013 at 10:00 PM

Check out:

http://www.ietf.org/rfc/rfc1738.txt

Search for "unsafe" in that. You'll learn that braces are considered unsafe and should be escaped. Just because your browser lets you get away with this doesn't mean that it's safe to use. So, yes, it's not server side mistake, it's client side mistake.

Comment
Add comment · Show 1 · 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 StormSabotage · Dec 09, 2013 at 10:29 PM 0
Share

$$anonymous$$y god, haven't thought about "unsafe" characters because all other compilations was with no errors. -_- Thank you man, after escaping my url all become perfect!

Follow this Question

Answers Answers and Comments

17 People are following this question.

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

Related Questions

Social when no image is set by the user 1 Answer

iOS Unity Remote For iPhone 5 0 Answers

Screen overlay effect is black on iOS 0 Answers

Audio not playing on iPad using Unity Remote 4 2 Answers

Publishing iOs app with Unity running in VirtualBox? 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