Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valid api_id must be provided. Can be obtained at https://my.telegram.org #104

Closed
AlexGnatko opened this issue Nov 29, 2022 · 4 comments
Closed

Comments

@AlexGnatko
Copy link
Contributor

AlexGnatko commented Nov 29, 2022

Hi!

I've encountered the problem with the newest version of phptdlib not being able to ->setParameter(TDApi\TDLibParameters::API_ID, $api_id). Unfortunately, Yaroslav himself doesn't yet have a solution to this problem. I suspect there's some change in data types for API_IDs in the newest versions of https://github.com/tdlib/td/, which is a sub-module of this project.

But, I've managed to find a temporary solution to the problem. All you have to do is make sure that you're using a much older version of the td submodule, that still worked without issues back in May 2022. I chose version 1.8.3 and made a fork:

https://github.com/AlexGnatko/td/

To apply the fix, go to the .gitmodules file and change the td url to https://github.com/AlexGnatko/td.git.

Then run the following commands:

git submodule sync --recursive
cd modules/td

git fetch
git checkout origin/master
git branch master -f
git checkout master

And then follow the build steps listed in the readme file.

For me, it fixed the problem, and even though I don't have a recent version of TDLib compiled into phptdlib, I can at least use most of the Telegram functions in my PHP.

I hope this helps anyone who bumps into a similar problem.

@yaroslavche
Copy link
Owner

yaroslavche commented Nov 29, 2022

The same problem occurs with FFI calls without extension. I don't know why =) I've tried 1.8.8

@FASKHETDINOV
Copy link
Contributor

@AlexGnatko @yaroslavche

Starting from TDLib v1.8.6+ setTdlibParameters values must be inlined and i can see in your JSON
tdlib/td#2211

Solution
770b16f

@yaroslavche
Copy link
Owner

yaroslavche commented Jan 29, 2023

@FASKHETDINOV Hi, thanks for the info and fix. CI build didn't pass, since it requires update fot tdlib to latest 1.8.10. Later I'll push commit into your PR and will merge. Or you can update it, need to do two things:
run command in the repository root directory

git submodule foreach git pull origin master

and change version in CMakeLists.txt to 1.8.10 here
Thanks.

@yaroslavche
Copy link
Owner

yaroslavche commented Jan 30, 2023

@AlexGnatko since the problem is found, I'll close this issue. Can confirm, that now it works for me (but I've checked calls via FFI, not with this extension).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants