cordova - Starting a Telegram API instance -
hi! telegram api beginner here! i'm developing phonegap app features messaging service using telegram api.
i'm following api guide , i'm reading getting started guide authentication. however, find insufficient , not jimmy proof.
how 1 create telegram api instance in one's own app? after initialization how 1 authenticate user? link provided, can done auth.sendcode
method. class method belong to?
referencing documentation in git hub page...
to create telegramapi
instance, 1 must first create custom implementation of org.telegram.api.engine.storage.absapistate
class , implement suitable methods. instance of custom class implementation used parameter telegramapi
constructor method.
example git hub page:
telegramapi api = new telegramapi(new myapistorage(), new appinfo(/*... put application information here...*/), new apicallback() { @override public void onapidies(telegramapi api) { // when auth key or user authorization dies } @override public void onupdatesinvalidated(telegramapi api) { // when api engine expects update sequence might broken } });
as auth.sendcode
method, method remote procedure call (rpc), , not belong class in library. these methods invoked client executed telegram server. see telegram faq regarding tl more information.
Comments
Post a Comment