If I’m understanding the comment on how context was added to the JS SDK correctly
The context is added to the property of the ParseObject. If this is true, ParseSwift’s design allows you to do this easily by just defining the property in your struct:
struct GameScore: ParseObject {
...
var _context: [String: String]? // Or any encodable object. I don’t use context, so not sure what it needs to look like.
}
This will probably not be officially added to the Swift SDK as it will add some unnecessary complexity due to context being able to be any Encodable and I don’t see a reason to require users to add a _context property to all of their objects which will happen if it’s officially added to the SDK.
Try what I mentioned above and let me know if it works.
From what I understand, context currently can’t be used by the Swift SDK because it doesn’t seem to be fully implemented on the server-side:
It seems like it should of had a dedicated header added which is currently missing from above. Probably best for @Manuel to confirm if this is true since he made the discussion and PR to expose context and may know more about it’s origins and why it doesn’t have a header (PR).
The JS SDK adds a _context key to the body for it to work. The Swift SDK doesn’t ever add keys like this to the body (this looks a little hacky IMO, but from the comments it seems some of the other SDKs do it). If there’s a header added on the server side or perhaps a different way to use it that someone mentions then it will be an easy add to the Swift SDK. Until then, context won’t be added to the Swift SDK.