JSONtoarray and JSONimport fail in iOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
hutchfx
Posts: 37
Joined: Sat Apr 09, 2011 5:38 am

JSONtoarray and JSONimport fail in iOS

Post by hutchfx » Fri Apr 13, 2018 6:59 pm

I have a stack using JSONtoarray and/or JSONimport that works on macOS 10.13.3 with LiveCode 9.0.0, but fails when deployed to an iPhone with iOS 11.2.6

Code: Select all

#! This does not work for mobile.
function fGetStreetAddress pJson
   -- Neither of the following two calls will work.
   -- put jsonimport(tApiReturnedJson) into taApiReturnedArray
   put JSONToArray(pJson) into taReturnedArray
   --
   put taReturnedArray["results"][1]["formatted_address"] into tReturnData
   return tReturnData
end fGetStreetAddress
Anyone have any ideas why? Here's a small stack for testing:
Attachments
test JSONtoarray.livecode.zip
(4.22 KiB) Downloaded 168 times

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: JSONtoarray and JSONimport fail in iOS

Post by LiveCode_Panos » Fri Apr 13, 2018 7:45 pm

Hi hutchfx,

You should probably add the JSON Library and the mergJSON extension to the standalone:

1. In the General pane of the standalone settings choose "select inclusions for the standalone application"
2. In the Inclusions pane (which is now enabled) check "JSON Library" and "mergJSON".

Hope this helps.

Best,
Panos
--

hutchfx
Posts: 37
Joined: Sat Apr 09, 2011 5:38 am

Re: JSONtoarray and JSONimport fail in iOS

Post by hutchfx » Fri Apr 13, 2018 7:55 pm

Panos,

Thank you for the speedy reply. That did it!

Hutch

Post Reply

Return to “iOS Deployment”