GetStream / stream-swift

Swift client for Stream API
https://getstream.io
BSD 3-Clause "New" or "Revised" License
35 stars 26 forks source link

Error adding like reaction #4

Closed HernanPaez closed 5 years ago

HernanPaez commented 5 years ago
            client.add(reactionTo: activity.id, kindOf: "like", completion: { (_) in
                completion()
            })

What did you do?

Add a 'Like' reaction to an activity

What did you expect to happen?

Add the like reaction

What happened instead?

Fails with error:

{"detail":"Errors for fields 'user_id'","status_code":400,"code":4,"exception":"InputException","exception_fields":{"user_id":["user_id is a required field"]},"duration":"0.17ms"}

GetStream Environment

GetStream version: 1.1.8 Xcode version: 10.2 Swift version: 4.2 Platform(s) running GetStream: iOS macOS version running Xcode: Mojave 10.14.4

Additional context

buh commented 5 years ago

@HernanPaez I'll take a look.

buh commented 5 years ago

@HernanPaez Could you tell me more what do you want to fix with backticks?

The error message is about missing user_id and it's because you are trying to use server-side Token, instead of client side. The client-side Token should have a payload with user_id value only. Please check docs here: https://getstream.io/docs_rest/#clientside_authentication

HernanPaez commented 5 years ago

I will check it out!

HernanPaez commented 5 years ago

@buh . We fixed it. We were using the server-side token. It worked again when we fixed it on the backend.