Closed jriosdev closed 4 years ago
Hey @jriosdev ,
Can you enable and post logs, with Client.config = .init(apiKey: "...", appId: "...", logsEnabled: true)
already enabled, the activity result array is printing
but the closure FlatFeed.get() return error
"The data couldn’t be read because it isn’t in the correct format."
Hi @jriosdev
Can you show your Activity
type that you use in your timelineFeed
?
So, basically you use enrichment (enrich: true
) and Activity by default use a User
as an actor. The error occurs because the JSON data has a string instead of a user JSON for the actor field. Can you show the response from logs?
thank u fixed
@jriosdev how you resolve the above issue i am also facing same but i have try many ways still i am getting same error. thank you
What did you do?
while activity fetching
self.timelineFeed?.get(enrich: true, pagination: .limit(limit) + .offset(offset), ranking: nil, includeReactions: .all, completion: { feedsResults in do{ self.timelinePosts = try feedsResults.get().results } catch { } })
What did you expect to happen?
What happened instead?
getting JSON decoding error: The data couldn’t be read because it isn’t in the correct format.. Data: 5901 bytes ▿ jsonDecode : 3 elements
GetStream Environment
GetStream version:2.2.1 Xcode version:11 Swift version:5 Platform(s) running GetStream:iOS macOS version running Xcode:10.15
Additional context
the error happening inside
func parse<T: Decodable>(_ callbackQueue: DispatchQueue, _ completion: @escaping CompletionObjects<T>) { parse(block: { let moyaResponse = try get() var response = try JSONDecoder.default.decode(Response<T>.self, from: moyaResponse.data) if let next = response.next, case .none = next { response.next = nil } callbackQueue.async { completion(.success(response)) } }, catch: { error in callbackQueue.async { completion(.failure(error)) } }) }