Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 13    Views: 268

chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
07/31/14 03:52 AM (9 years ago)

The JSON data for this app is invalid

Hi, I have created my self hosted iphone app. In BT panel I see only registered phones in Design mode, tryed to re-update my app on Appstore changing the current mode from Design to Live in xcode but now, when i download the app from appstore I have this error: "The JSON data for this app is invalid. Restart the app to try again". Can anyone help me please?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/31/14 06:04 AM (9 years ago)
Make sure there are no special characters in your text. Just regular ascii only. Be careful of characters that are parts of commands in ObjC and php. Things like single and double quotes, semi-colons, commas and such can present a problem in JSON. Cheers! -- Smug
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/31/14 07:24 AM (9 years ago)
A quick way to find where the error is located is running the config txt through http://www.jsonlint.com. I use it a lot especially to make the text clean :)
 
chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
like
07/31/14 09:36 AM (9 years ago)
I have tried http://www.jsonlint.com and it says "Valid JSON" in a green rectangle, so there aren't errors. So?? What Can I do?
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/31/14 09:40 AM (9 years ago)
Copy that same config file inside of xcode config.txt
 
chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
like
07/31/14 09:49 AM (9 years ago)
I have already copied it in BT_config.txt in Xcode, but nothing. The error on the app is the same
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/31/14 10:04 AM (9 years ago)
You can have valid config.txt JSON code, which only checked structure (punctuation , [ ] { } pairs), but not valid Android or iOS commands elsewhere in the package. One way that I encountered that error, was in Eclipse. In Manifest, I changed "debuggable" from "true" to "false", etc, and the editor changed the square (typewriter-style ) quotes "" to curly quotes (which I can't type here). Curly Quotes in Eclipse then made THAT JSON (in Manifest) invalid. config.txt was OK! Since I do a lot of computer program code writing, I look for things like that. After all, a square quote in ASCII is a different value than a curly quote in ASCII. The interpreter is looking for numeric values for typewritten characters, NOT visual appearance! I fixed the error, by re-typing the square Quote that got changed, and made sure it stuck as a square quote. Of course, there could be other examples, but trace your steps in any files you manually edited in Xcode, to make sure no garbage, no garbage characters got added or changed in those edited files - which then makes that JSON invalid. http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/31/14 02:09 PM (9 years ago)
Sorry I stepped away. I agree with the above. Also test again copying and pasting or test it by disconnecting the control panel from the app. So it's offline
 
chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
like
08/01/14 02:55 AM (9 years ago)
This is my JSON configuration data: {"BT_appConfig": { "BT_items":[ {"itemId":"EAD43049F0C909ABE0A66BD46", "itemType":"BT_app", "buzztouchAppId":"EAD43049F0C909ABE0A66BD46", "buzztouchAPIKey":"1F3DBD08386D1D8AAF58D5E", "dataURL":"http://www.youtubefun.net/BT-server/api/app/?command=getAppData&appGuid=EAD43049F0C909ABE0A66BD46&apiKey=1F3DBD08386D1D8AAF58D5E&apiSecret=E820350F961FCF90D8CEAF9", "reportToCloudURL":"http://www.youtubefun.net/BT-server/api/app/?command=reportToCloud&appGuid=EAD43049F0C909ABE0A66BD46&apiKey=1F3DBD08386D1D8AAF58D5E&apiSecret=E820350F961FCF90D8CEAF9&deviceId=[deviceId]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude]&deviceModel=[deviceModel]&userId=[userId]", "registerForPushURL":"http://www.youtubefun.net/BT-server/api/app/?command=registerForPush&appGuid=EAD43049F0C909ABE0A66BD46&apiKey=1F3DBD08386D1D8AAF58D5E&apiSecret=E820350F961FCF90D8CEAF9&deviceId=[deviceId]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude]&deviceModel=[deviceModel]&userId=[userId]", "lastModified":"Fri, 01 Aug 2014 09:48:20 -0700", "lastPublished":"Thu, 31 Jul 2014 16:33:22 -0700", "name":"La leggenda del tesoro", "version":"1.2", "currentMode":"Design", "startLocationUpdates":"0", "promptForPushNotifications":"1", "allowRotation":"largeDevicesOnly", "BT_themes":[ {"itemId":"5FA1AC579E9ED90119A536C", "itemType":"BT_theme", "itemNickname":"Default Theme", "navBarStyle":"solid", "statusBarStyle":"default", "backgroundColor":"#FFFFFF", "backgroundImageNameSmallDevice":"appbackground.jpg"} ], "BT_tabs":[ ], "BT_menus":[ ], "BT_screens":[ {"itemId":"CF482B53DCB39D717A7BF9B", "itemType":"BT_screen_menuButtons", "itemNickname":"Home", "itemId":"CF482B53DCB39D717A7BF9B", "itemType":"BT_screen_menuButtons", "itemNickname":"Home", "navBarTitleText":"Home", "buttonSizeSmallDevice":"120", "buttonPaddingSmallDevice":"27", "buttonLayoutStyle":"grid", "buttonBackgroundColor":"#77151b", "buttonLabelFontColor":"#77151b", "backgroundImageNameSmallDevice":"appbackgroundhome.jpg", "childItems":[ {"itemId":"8EA7D6E6EEBAE17A249A30C", "itemType":"BT_menuItem", "loadScreenWithItemId":"CEDD794F632C5D539B3C4BE", "titleText":"I nostri Menu", "imageNameSmallDevice":"iconainostrimenu.jpg"}, {"itemId":"2E25F2DE5E8A008BA80E091", "itemType":"BT_menuItem", "loadScreenWithItemId":"52500F67E70D92530E8EB74", "titleText":"News & Eventi", "imageNameSmallDevice":"iconaeventi.jpg"}, {"itemId":"EF5D638988DDFEFF3652BA6", "itemType":"BT_menuItem", "loadScreenWithItemId":"8AFBDF7D57944B84A444287", "titleText":"Il Ristorante", "imageNameSmallDevice":"iconaristorante.jpg"}, {"itemId":"E89E9978D5C31135DE89D98", "itemType":"BT_menuItem", "loadScreenWithItemId":"EAE334D8A5FE9D82661CB15", "titleText":"Info & Contatti", "imageNameSmallDevice":"iconainfo.jpg"} ]}, {"itemId":"52500F67E70D92530E8EB74", "itemType":"WB_screen_menuImage", "itemNickname":"News & Eventi", "itemId":"52500F67E70D92530E8EB74", "itemType":"WB_screen_menuImage", "itemNickname":"News & Eventi", "navBarTitleText":"News & Eventi", "imageFileName":"bannernews.png", "headerImageSize":"Medium", "backgroundColor":"#FFFFFF", "listBackgroundColor":"#FFFFFF", "backgroundImageNameSmallDevice":"appbackground.jpg", "childItems":[ {"itemId":"1D70D8B1605018B9B4DADC5", "itemType":"BT_menuItem", "loadScreenWithItemId":"B60F785C01FBEA9F80B761D", "titleText":"Evento1"}, {"itemId":"B671FAA71E19B4485782C1A", "itemType":"BT_menuItem", "titleText":"Evento", "loadScreenWithItemId":"5F8A56B3E816D64483E3948"} ]}, {"itemId":"8AFBDF7D57944B84A444287", "itemType":"WB_screen_menuImage", "itemNickname":"Il Ristorante", "itemId":"8AFBDF7D57944B84A444287", "itemType":"WB_screen_menuImage", "itemNickname":"Il Ristorante", "navBarTitleText":"Il Ristorante", "imageFileName":"bannerfotogallery.png", "headerImageSize":"Large", "backgroundColor":"#FFFFFF", "listBackgroundColor":"#FFFFFF", "childItems":[ {"itemId":"FAE32C5116EE557BDD2EC73", "itemType":"BT_menuItem", "loadScreenWithItemId":"B1C877A983D392C2774C44D", "titleText":"Foto Ristorante"}, {"itemId":"2AF05A9FAEBBF1D0044C886", "itemType":"BT_menuItem", "loadScreenWithItemId":"7E401AE5E4CC60BA8739030", "titleText":"Foto Giardino"} ]}, {"itemId":"5AD216710BAF8B9B1CD9BE8", "itemType":"BT_screen_pdfDoc", "itemNickname":"Menu Domenica Pranzo", "itemId":"5AD216710BAF8B9B1CD9BE8", "itemType":"BT_screen_pdfDoc", "itemNickname":"Menu Domenica Pranzo", "navBarTitleText":"Menu Domenica Pranzo", "localFileName":"domenica_pranzo.pdf"}, {"itemId":"ACBEA5496F6B525063D6400", "itemType":"BT_screen_pdfDoc", "itemNickname":"Menu Fissi", "itemId":"ACBEA5496F6B525063D6400", "itemType":"BT_screen_pdfDoc", "itemNickname":"Menu Fissi", "navBarTitleText":"Menu Fissi", "localFileName":"menu fissi.pdf"}, {"itemId":"EAE334D8A5FE9D82661CB15", "itemType":"BT_screen_pdfDoc", "itemNickname":"Info & Contatti", "itemId":"EAE334D8A5FE9D82661CB15", "itemType":"BT_screen_pdfDoc", "itemNickname":"Info & Contatti", "navBarTitleText":"Info & Contatti", "localFileName":"contatti_leggenda.pdf"}, {"itemId":"CEDD794F632C5D539B3C4BE", "itemType":"BT_screen_menuListSimple", "itemNickname":"I nostri menu", "itemId": "CEDD794F632C5D539B3C4BE", "itemType": "BT_screen_menuListSimple", "itemNickname": "I nostri menu", "navBarTitleText": "I nostri menu" , "childItems":[ {"itemId":"4EBBB71C0B64F7E75F8F32C", "itemType":"BT_menuItem", "loadScreenWithItemId":"5F392373DB57A1F5A6728D1", "titleText":"Free Arrosto & Pizza"}, {"itemId":"258707FEDFDC07A9B6E2BD5", "itemType":"BT_menuItem", "loadScreenWithItemId":"CB2AD7323C6A16B865785BF", "titleText":"Menu Sabato Sera"}, {"itemId":"5BCA9FAD53EF099D4352751", "itemType":"BT_menuItem", "loadScreenWithItemId":"5AD216710BAF8B9B1CD9BE8", "titleText":"Menu Domenica Pranzo"}, {"itemId":"B003C8E85D4E2285EEE08C9", "itemType":"BT_menuItem", "loadScreenWithItemId":"ACBEA5496F6B525063D6400", "titleText":"Menu Fissi"} ]}, {"itemId":"5F392373DB57A1F5A6728D1", "itemType":"BT_screen_pdfDoc", "itemNickname":"Free Arrosto & Pizza", "itemId":"5F392373DB57A1F5A6728D1", "itemType":"BT_screen_pdfDoc", "itemNickname":"Free Arrosto & Pizza", "navBarTitleText":"Menu", "localFileName":"arrosto & pizza free.pdf"}, {"itemId":"CB2AD7323C6A16B865785BF", "itemType":"BT_screen_pdfDoc", "itemNickname":"Menu Sabato Sera", "itemId":"CB2AD7323C6A16B865785BF", "itemType":"BT_screen_pdfDoc", "itemNickname":"Menu Sabato Sera", "navBarTitleText":"Menu Sabato Sera", "dataURL":"http://www.pugliaprint.com/a3_sabato_plast.pdf"}, {"itemId":"B1C877A983D392C2774C44D", "itemType":"BTA_thumbViewer", "itemNickname":"Foto Ristorante", "thumbAlbumType":"thumbLocal", "thumbviewStart":"thumbnailStart", "albumTitle":"Foto Ristorante", "albumDescription":"Fotogallery Ristorante Leggenda del Tesoro", "navBarTitleText":"Foto Ristorante", "childItems":[ {"itemId":"2AD719532B352155C7EDA9E", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"1_ristorante.jpg", "imageTitle":"Ristorante 1", "tvDescription":"Fotogallery Ristorante"}, {"itemId":"8D2121770BBAE9EC78B150A", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"2_ristorante.jpg", "imageTitle":"Ristorante 2", "tvDescription":"Fotogallery Ristorante"}, {"itemId":"9E3B3F6AB690ED535C64C86", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"3_ristorante.jpg", "imageTitle":"Ristorante 3", "tvDescription":"Fotogallery Ristorante"}, {"itemId":"2594A96173308FC40BE6E85", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"4_ristorante.jpg", "imageTitle":"Ristorante 4", "tvDescription":"Fotogallery Ristorante"}, {"itemId":"54595D9C8E3B5EC5E0E719F", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"5_ristorante.jpg", "imageTitle":"Ristorante 5"}, {"itemId":"BA65E6EBF22807C6542DD1D", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"6_ristorante.jpg", "imageTitle":"Ristorante 6"}, {"itemId":"9383A5A86EF4E4B85929AFC", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"7_ristorante.jpg", "imageTitle":"Ristorante 7"}, {"itemId":"2ABD2CAE4D9417C4C5CC6C0", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"8_ristorante.jpg", "imageTitle":"Ristorante 8"} ]}, {"itemId":"7E401AE5E4CC60BA8739030", "itemType":"BTA_thumbViewer", "itemNickname":"Foto Giardino", "thumbAlbumType":"thumbLocal", "thumbviewStart":"thumbnailStart", "albumTitle":"Fotogallery Giardino", "albumDescription":"Fotogallery Giardino Leggenda del Tesoro", "navBarTitleText":"Foto Giardino", "childItems":[ {"itemId":"59584FADF98D54801BF3A77", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"1_giardino.jpg", "imageTitle":"Giardino 1", "tvDescription":"Fotogallery Giardino"}, {"itemId":"4D374F813F4307CCF350475", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"2_giardino.jpg", "imageTitle":"Giardino 2", "tvDescription":"Fotogallery Giardino"}, {"itemId":"F0F16E568A8E7571BCE76EE", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"3_giardino.jpg", "imageTitle":"Giardino 3", "tvDescription":"Fotogallery Giardino"}, {"itemId":"21DB6E8A005A17B0DB4978D", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"4_giardino.jpg", "imageTitle":"Giardino 4", "tvDescription":"Fotogallery Giardino"}, {"itemId":"25150D2E6C74267D420C902", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"5_giardino.jpg", "imageTitle":"Giardino 5", "tvDescription":"Fotogallery Giardino"}, {"itemId":"AC816D53EB55BB9810BDA1A", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"6_giardino.jpg", "imageTitle":"Giardino 6", "tvDescription":"Fotogallery Giardino"}, {"itemId":"C0E2C8878CD832C236474D7", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"7_giardino.jpg", "imageTitle":"Giardino 7", "tvDescription":"Fotogallery Giardino"}, {"itemId":"527D46E5571D16D390BCF65", "itemType":"BT_thumbViewerItem", "loadScreenWithItemId":"na","thumbURL":"8_giardino.jpg", "imageTitle":"Giardino 8", "tvDescription":"Fotogallery Giardino"} ]}, {"itemId":"B60F785C01FBEA9F80B761D", "itemType":"BT_screen_pdfDoc", "itemNickname":"evento1", "navBarTitleText":"evento1"}, {"itemId":"5F8A56B3E816D64483E3948", "itemType":"BT_screen_pdfDoc", "itemNickname":"evento 2", "itemId":"5F8A56B3E816D64483E3948", "itemType":"BT_screen_pdfDoc", "itemNickname":"evento 2", "navBarTitleText":"evento 2"} ] } ] }} Can you check this to help me, please?
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
08/01/14 09:03 AM (9 years ago)
But config.txt might not be where the invalid error is. VALID JSON typically means the correct balance of punctuation , []{}()''"". Not necessarily commands that iOS knows how to handle. Did you edit in Xcode, ANY other files in the package outputted and downloaded from your Control Panel? Did you prepare and export v3.0 or 2? These instructions can be confusing: arrowPrepare iOS Project arrowUse the Buzztouch Core for iOS v3.0 They both should say "Prepare iOS Project" followed by the version 2.0 or 3.0. If your config.txt file is VALID, then think back to ALL of the files you subsequently edited in Xcode.
 
chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
like
08/04/14 10:49 AM (9 years ago)
I prepared it for v3.0 I only edited BT_config.txt for pass from Design mode to Live Mode, and I changed the version number in that file.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
08/04/14 11:01 AM (9 years ago)
Did you change the version number in config.txt in Xcode, or in your Control Panel? Before you exported it? :) I have never done either, but I could see where an error could occur if you did it in config.txt but not in your control panel. Also, when you edited Design to Live and the version number, did the "quote" marks stay the same as they were - either square or curly? You can't have the open quote be one, and the close quote be the other.
 
chris3839
I hate code!
Profile
Posts: 26
Reg: Apr 16, 2014
Sannicandro di ...
1,810
like
08/04/14 11:12 AM (9 years ago)
I changed the number in xcode and then I sended it to app store. Then I changed it in the control panel
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
08/04/14 11:20 AM (9 years ago)
Even though I have yet to have a new version of an App, I would have changed the version in Control Panel, then exported the new project. Especially since in your config.txt, you are referring so many times back to your self-hosted control panel. Let it do the decision making, not you do editing. Also, Control Panel gives you both Design and Live views of the JSON. Maybe you should Prepare and Export the project from the Control Panel and Import into Xcode... then Copy the whole Live JSON from the Control Panel, and Paste it into Xcode. I sense that you are not US, and the only thing important about that here, is that your (International) keyboard may be typing different numeric values for characters than my (US) keyboard. Might look the same on screen, but be different ASCII numerical values.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.