Closed AndrewRudyk closed 4 years ago
Hello @AndrewRudyk Firstly, the correct place for this question is stream-js repo since the problem arises from how the user is sent from js backend. If the user is written as a literal (as you've did), stream-js fails to convert it to a valid stream object and encodes as string. There are 2 solutions here:
const actor = client.user(posterProfileId).get();
const activity = {
actor: actor,
..
}
SU:<actor Id>
and on client, request it with enrich: true
(this is by default):
const activity = {
actor: "SU:"+posterProfileId,
..
}
I'm not a js developer so apologizes for any errors in my js code. I'd suggest going with 1, since it's the safer option.
Thanks) We will try now your advice.
Second solution is working. Thanks.
Hello. I have lates version Swift-activity-feed (2.2.3). Initialization and UserRegistration is successful. When I am trying to load Activity I have an error: "JSON decoding error: The data couldn’t be read because it isn’t in the correct format.." JSON in logs is readable and has all the info about my Activitys(Posts).
I use code for request:
We are trying to send an object in actor property on the backend. Here is code snippet from the backend:
In the mobile app we are getting this response and the same error. It look likes actor is still treated as a string, not an object:
Actor property: "actor" : "{"data":{"name":null,"profileImage":null},"id":"w75K3rXL9EF4iuy7rkrW"}",