I can not understand what I am doing wrong.
When I take a token from Tindroid, then base64 decode it with php, in some cases I can not login with GRPC - Tinode returns malformed error.
For example.
<?php
$token = '
3X3jPTdOIYdz24hkFAABAAEAIAzgCv1K7A/0LKspbEAvK6vjZHPjSYk3IGd eyzbkQ8'; //a token from Tindroid
$token = base64_decode($token);
echo $token;
?>
Echo produces:
Ý}ã=7N!‡sÛˆd à
ýJì ô,«)l@/+«ãdsãI‰7 g^Ë6äC
As you can see, there is a newline. Do tokens contain newlines. As I understand, malformed error appears when a token after decoding contains a newline.
How to resolve this problem? Thanks.