Skip to content

Simple: How to run a cloud function that returns a JSON? #164

Answered by jaysonng
pktealshift asked this question in Q&A
Discussion options

You must be logged in to vote

so the cloud function works fine and returns this JSON?

what error are you specifically getting?

what is the struct of ParseObjectA and ParseObjectB?

seems to me you need to make a new struct that has those values.

struct NewObject {

    var object1: ParseObjectA?
    var object2: ParseObjectB?

}

which would be your ParseCloudable returnType for example:

struct NewObjectCloud: ParseCloudable {

    typealias ReturnType = NewObject
    var functionJobName: String = "getObject" // this would be the cloud code function name

    //: Parameters
    var object1ID: String?
    var object2ID: String?
}

if everything works ok, you should get back a NewObject object.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jaysonng
Comment options

Answer selected by pktealshift
@pktealshift
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants