Giter Site home page Giter Site logo

Question? about jsonjoy-swift HOT 3 CLOSED

daltoniam avatar daltoniam commented on June 2, 2024
Question?

from jsonjoy-swift.

Comments (3)

daltoniam avatar daltoniam commented on June 2, 2024

The notificationContent key has a string of JSON with it? Can you provide an example of what it looks like? JSONJoy uses the builtin NSJSONSerialization class, so if that parses it as an object and not a string, it should behave properly.

from jsonjoy-swift.

OmarBizreh avatar OmarBizreh commented on June 2, 2024

Here is a sample of NotificationContent:

"NotificationContent":"{\"Subject\":{\"SubjectTitle\":\"Physical Development\",\"ExamMark\":null,\"ClassTimeFrom\":null,\"ClassTimeTo\":null,\"SubjectID\":null,\"MaxGrade\":0} 

And this is the JSON Object that I parse using JSONDecoder it includes NotificationContent:

{"AppUserId":"0000000-0000-0000-0000-000000000000","ContentToDisplay":null,"CreationDate":"\/Date(1436337714830+0300)\/","ExiprationDate":"\/Date(1437201714830+0300)\/","IsSeenByUser":false,"NotificationContent":"{\"Subject\":{\"SubjectTitle\":\"Language and Literacy Development\",\"ExamMark\":null,\"ClassTimeFrom\":null,\"ClassTimeTo\":null,\"SubjectID\":null,\"MaxGrade\":0},\"Homework\":{\"Title\":\"Quiz\",\"CreationDate\":\"08\/07\/2015 9:41:54 AM\",\"Description\":\"Quiz in chapter 10, pages 145 -> 200\"},\"TeacherNotes\":{\"TeacherName\":\"\",\"CreationDate\":\"08\/07\/2015 9:41:54 AM\",\"Content\":\"None\"},\"DueDate\":\"09\/07\/2015\",\"TimeFrom\":\"8:00 AM\",\"TimeTo\":\"9:30 AM\",\"child\":{\"FullName\":\"شهاب\",\"PersonID\":\"00000000-0000-0000-0000-000000000000\",\"SISNumber\":\"8136-1816103\"},\"Title\":\"Quiz\"}","NotificationID":"0000000-0000-0000-0000-000000000000","NotificationType":10,"SISUserID":"0000000-0000-0000-0000-000000000000","SISUserNumber":"0000-0000"}

By the way a side question, in my pod file I chose the platform to be IOS 7, am I good to go for both IOS 7 & 8? or are there any changes I need to do for both JSONJoy and SwiftHTTP?

from jsonjoy-swift.

daltoniam avatar daltoniam commented on June 2, 2024

Alright, yeah. I don't think NSJSONSerialization parses a JSON string with JSON. You will probably have to run that through the parser again (or a JSONDecoder), as JSONJoy uses the standard NSJSONSerialization API to do JSON parsing.

You should be able to set it to iOS7 for both. The code isn't any different for either target version. The only issue is iOS 7 doesn't support Swift dynamic frameworks. See this for more info:

CocoaPods/swift#9

from jsonjoy-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.