InvalidOperationException: UPDATE_APP_TO_LOGIN
This is the exception thrown when calling SendCodeRequestAsync
It is because Telegram forced all clients to use 64 bit identifier. Yet there is no such good library for c# as TgSharp (TLSharp) is and also unfortunately this library is not useable after this update of telegram. I DO ASK you to provide 64 bit identifiers for this powerful library. thank you.
Here is the stack trace:
TLSharp.Core.Network.MtProtoSender.processMessage(ulong messageId, int sequence, BinaryReader messageReader, TLMethod request, CancellationToken token)
TLSharp.Core.Network.MtProtoSender.Receive(TLMethod request, CancellationToken token)
TLSharp.Core.TelegramClient.RequestWithDcMigration(TLMethod request, CancellationToken token)
TLSharp.Core.TelegramClient.SendCodeRequestAsync(string phoneNumber, CancellationToken token)
Ako.Sbmu.Core.Telegram.SendCodeAsync() in Telegram.cs
_authHash = await Client.SendCodeRequestAsync(_phoneNumber);
Telegram updated: Support for int64 IDs With its rapid growth, Telegram is moving from 32-bit to 64-bit IDs so that users can continue creating billions of groups, channels and bots. Your app will need to support these new IDs as soon as possible to ensure users aren't interrupted. To do so, make sure your app supports this API layer: https://core.telegram.org/api/layers#layer-133
TgSharp only support layer - 108.
We need to update TgSharp layer-133
Dear author of the library, should you expect a solution or decide for yourself? thanks
Hi guys, Ive managed to get the new TL definitions using the json and the TLgenerator.
This caused some trouble with missing references and unreqocnized objects but i just outcommented those. Next i did alter the layer version in the telegramclient and i did change the MakeAuthAsync function to return the user which went also wrong.
In my project (which references these files) i needed to change several things too. Mainly the channel ID props as well as replyToId which is changed a bit.
Should you want to check and try this, this is the zipfile containing the files.
This seems to work for us.
Hope this get you guys started.
@PhilAsCoder Hello Friend. I compiled both projects, each project compiles 2 files, which one should I select? When replacing the original files with these files, an error appeared "method not found"
Hi,
The TgSharp.TL builds the TL dll while the TgSharp.Core builds both since the Core depends upon the TL. When i compile it no error is generated.
Perhaps you have used some function(s) in the old build which are no longer supported? For me this rebuild with layer 133 works but i might not use the specific function you seem to miss?
@PhilAsCoder I have no compilation errors, had errors with old functions work after replacing the original files. The functions there were written for the tlsharp version, perhaps this is the case. I'll try to use the library in a new project, thanks
@PhilAsCoder How did you calculate constructor number for some classes which inherits TLObject ?? I need the way you calculate them to fulfill some other classes as well.
@PhilAsCoder I have no compilation errors, had errors with old functions work after replacing the original files. The functions there were written for the tlsharp version, perhaps this is the case. I'll try to use the library in a new project, thanks
No i used the original TGsharp library which was presented here at the beginning and just updated the TL layer (which TgSharp uses) so no methods were missing in my case
@PhilAsCoder How did you calculate constructor number for some classes which inherits TLObject ?? I need the way you calculate them to fulfill some other classes as well.
I didnt, all i did was use the TLGenerator exe which is inside the project, downloaded the latest Telegram Json file and then it outputted the TL objects. I didnt need to 'calculate constructors'. I only outcommented several properties in order for me to compile it. Some properties like 'invites' etc
@PhilAsCoder, not work for me, but ty
@PhilAsCoder Where I can find TLgenerator? Thanks!
@vuminhit its under the TgSharp project https://github.com/nblockchain/TgSharp/tree/master/src/TgSharp.Generator
Hello @jamesjsc ,
Yes for us it solved the issue posted here at the top of the page by the OP. All i did was re-genarate the TL files by using the TLGenerator and the latest Telegram Json file. Then outcommented several properties (like invites we dont use those) and related calls and rebuilded the dlls. After that of course i needed to tweak our project a bit to support the new Telegramclient calls which were slightly different as well as, from memory (not at the computer), change some ReplyTo calls because those were now in its own object.
So yes, this issue was solved by using this approach using the dlls I did post above.
Take care
Hello @PhilAsCoder, Sorry with my bad English :( Is your TGSharp updated with newest Telegram API updates? Thanks.
Hello @archnguyen27 ,
Yes the TL code i posted in the zip was generated by using the latest Telegram json file, so its based on version 133 from memory.
Hi guys, Ive managed to get the new TL definitions using the json and the TLgenerator.
This caused some trouble with missing references and unreqocnized objects but i just outcommented those. Next i did alter the layer version in the telegramclient and i did change the MakeAuthAsync function to return the user which went also wrong.
In my project (which references these files) i needed to change several things too. Mainly the channel ID props as well as replyToId which is changed a bit.
Should you want to check and try this, this is the zipfile containing the files.
This seems to work for us.
Hope this get you guys started.
hi I'm using this Lib but I'm getting the error "Flood prevention. Telegram now requires your program to make a request again only after 49649 seconds have elapsed (TimeToWait property). If you think the cause of this issue might lie in the TgSharp implementation, please go to Github issues. "
when registering a new phone number, other functions work normally, but registration function does not work, do you know how to avoid this error? can i contact you on telegram?
@PhilAsCoder Thanks you so much. You save me :D