i-naji / tdlib Goto Github PK
View Code? Open in Web Editor NEWFlutter Plugin for TDLib (Telegram Database Library)
License: BSD 3-Clause "New" or "Revised" License
Flutter Plugin for TDLib (Telegram Database Library)
License: BSD 3-Clause "New" or "Revised" License
As I know there is something called ChatBotApi for doing it. However, I'm using tdlib. Can I implement chatbot with tdlib?
How can I listen to the stream of the telegram updates? Although it is one of the main functionality, it should be implemented in the package i think?
Unhandled Exception: MissingPluginException(No implementation found for method clientCreate on channel channel/to/tdlib)
Hi! Got any plans?
[ERROR:flutter/lib/ui/ui_dart_state.cc(184)] Unhandled Exception: MissingPluginException(No implementation found for method clientCreate on channel channel/to/tdli
b)
After updating tdlib to 1.5.9 it crashes with the error:
Oops; flutter has exited unexpectedly: "type 'Null' is not a subtype of type 'String' in type cast".
A crash report has been written to C:\Projects\telegramnews\flutter_03.log.
log:
flutter_03.log
tdlib version is tdlib: 1.5.9+1
Version 1.5.0 works correctly with no crashes
To send message need chatId, but i have never chat before, is there any way to get chat id. Or is there a way to create a new message?
any information about this lib for flutter web..?
Hi Sir.
After pressing floatingActionButton (_clientCreator) my app is crashed. Please help me
`Launching lib/main.dart on Android SDK built for x86 in debug mode...
✓ Built build/app/outputs/apk/debug/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:60432/lwjmrRocakQ=/ws
D/EGL_emulation(20174): eglMakeCurrent: 0xb0464be0: ver 3 0 (tinfo 0xa5b7f7e0)
E/zygote (20174): No implementation found for long org.drinkless.tdlib.JsonClient.create() (tried Java_org_drinkless_tdlib_JsonClient_create and Java_org_drinkless_tdlib_JsonClient_create__)
E/flutter (20174): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.UnsatisfiedLinkError: No implementation found for long org.drinkless.tdlib.JsonClient.create() (tried Java_org_drinkless_tdlib_JsonClient_create and Java_org_drinkless_tdlib_JsonClient_create__)
E/flutter (20174): at org.drinkless.tdlib.JsonClient.create(Native Method)
E/flutter (20174): at org.naji.td.tdlib.TdlibPlugin.onMethodCall(TdlibPlugin.java:38)
E/flutter (20174): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/flutter (20174): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter (20174): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/flutter (20174): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (20174): at android.os.MessageQueue.next(MessageQueue.java:325)
E/flutter (20174): at android.os.Looper.loop(Looper.java:142)
E/flutter (20174): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/flutter (20174): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (20174): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/flutter (20174): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/flutter (20174):
F/flutter (20174): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).
F/libc (20174): Fatal signal 6 (SIGABRT), code -6 in tid 20174 (e.hello_flutter), pid 20174 (e.hello_flutter)
Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.1.0/OSM1.180201.007/4586646:user/release-keys'
Revision: '0'
ABI: 'x86'
pid: 20174, tid: 20174, name: e.hello_flutter >>> com.example.hello_flutter <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).
'
eax 00000000 ebx 00004ece ecx 00004ece edx 00000006
esi b042b1b0 edi 00004ece
xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
eip b4c3dac4 ebp bf97a7d8 esp bf97a768 flags 00200286
backtrace:
#00 pc 00000ac4 [vdso:b4c3d000] (__kernel_vsyscall+16)
#1 pc 0001edf8 /system/lib/libc.so (syscall+40)
#2 pc 0001f073 /system/lib/libc.so (abort+115)
#3 pc 011c5cb1 /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#4 pc 011b26e7 /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#5 pc 011b0480 /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#6 pc 01219191 /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#7 pc 011c40c3 /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#8 pc 011c6a09 /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#9 pc 011c694e /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#10 pc 011ccb5a /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#11 pc 011ccb88 /data/app/com.example.hello_flutter-ZgwdxMbtgzKhSWdi9d4y_A==/lib/x86/libflutter.so (offset 0x11a9000)
#12 pc 00014af7 /system/lib/libutils.so (android::SimpleLooperCallback::handleEvent(int, int, void*)+39)
#13 pc 00015936 /system/lib/libutils.so (android::Looper::pollInner(int)+982)
#14 pc 000154d6 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+118)
#15 pc 000e25cb /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+59)
#16 pc 007d5428 /system/framework/x86/boot-framework.oat (offset 0x606000) (android.app.NativeActivity.onWindowFocusChangedNative [DEDUPED]+136)
#17 pc 00002d4e /dev/ashmem/dalvik-jit-code-cache (deleted)
Lost connection to device.
Exited (sigterm)
`
I think this might be my mistake, but I am rather confused by the instructions in the README. I understand that I need to use the .so files from the actual tdlib to make this one work, but where exactly do I put the .so files if I am developing for android? Should I be compiling for Android or for Windows? I am just generally hazy on the specifics
I have a problem when I use SetTdlibParameters event to TDLib, the log show the following:
V/DartMessenger( 7563): Deferring to registered handler to process message.
I/DLTD ( 7563): [ 3][t16][1562713141.231503248][Td.cpp:4380][#4][!Td][&td_requests] Sending update: updateOption {
I/DLTD ( 7563): name = "version"
I/DLTD ( 7563): value = optionValueString {
I/DLTD ( 7563): value = "1.4.0 @tryexceptpass neo"
I/DLTD ( 7563): }
I/DLTD ( 7563): }
I/DLTD ( 7563): [ 3][t16][1562713141.232669115][Td.cpp:4380][#4][!Td][&td_requests] Sending update: updateAuthorizationState {
I/DLTD ( 7563): authorization_state = authorizationStateWaitTdlibParameters {
I/DLTD ( 7563): }
I/DLTD ( 7563): }
I/flutter ( 7563): 3551649040
V/DartMessenger( 7563): Received message from Dart over channel 'channel/to/tdlib'
V/DartMessenger( 7563): Deferring to registered handler to process message.
E/DLTD ( 7563): [ 1][t 0][1562713141.235162973][ClientJson.cpp:67] Failed to parse [request:{@type: setTdlibParameters, parameters: {@type: tdlibParameters, use_test_dc: null, database_directory: null, files_directory: null, use_file_database: null, use_chat_info_database: null, use_message_database: null, use_secret_chats: null, api_id: 111111, api_hash: 2b0650575da164175acd11d17a05e5d8, system_language_code: null, device_model: null, system_version: null, application_version: null, enable_storage_optimizer: null, ignore_file_names: null}, @extra: null}] [Error : 0 : Opening '"' expected]
My example code is:
import 'package:flutter/material.dart';
import 'package:tdlib/client.dart';
import 'package:tdlib/tdapi.dart' as tdapi;
import 'dart:convert';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Telegram Cloud'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int clientId = 0;
Client client = Client();
void getValueMethod(var valor){
print(valor);
}
void _clientCreator() async {
/*
Here we renew!
*/
tdapi.TdlibParameters params = new tdapi.TdlibParameters();
params.apiId = 111111;
params.apiHash = "2b0650575da2b0650575da2b0650575da";
int newClientId = await client.createClient();
print(newClientId);
client.clientSend(newClientId, new tdapi.SetTdlibParameters(parameters: params));
setState(() {
clientId = newClientId;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'TDLib Client ID\n$clientId',
),
Text(
'',
style: Theme.of(context).textTheme.display1,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _clientCreator,
tooltip: 'creator',
child: Icon(Icons.cached),
),
);
}
}
Only work if execute clientIdgenerator, but with authorization events doesn´t work.
Thanks for your work, its a good project!
hey , Great package , can we stream telegram videos , or if possible can we get a callback or something for download or upload progress ??
Hello! I am trying to add tdlib support for ios, but the link below in 2. no longer exists. I have tried many other methods described online but cant seem to get it to work. Could someone help me with step 2?
for IOS and macOS support:
Hello, I am going to develop a Flutter APP and I will need to use TdLib, does this plugin support Android and iOS now?
Please, can you update TDLib version to 1.6.0.
Thank you!
Trying to run the example or making a clean app and adding tdlib has this error upon running.
Trying to run example project with flutter tdlib.
main.dart:
/*
* just a example! client creator :)
*/
import 'package:flutter/material.dart';
import 'package:tdlib/td_client.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'TDLib Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter TDLib Example'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
/*
Here we go!
*/
int clientId = 0;
void _clientCreator() async {
/*
Here we renew!
*/
int oldClientId = clientId;
int newClientId = await TdClient.createClient();
setState(() {
clientId = newClientId;
});
// closing after renewing! just to get NEW client identifier.
if (oldClientId != 0) {
await TdClient.destroyClient(oldClientId);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'TDLib Client ID\n$clientId',
),
Text(
'',
// ignore: deprecated_member_use
style: Theme.of(context).textTheme.display1,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _clientCreator,
tooltip: 'creator',
child: Icon(Icons.cached),
),
);
}
}
On click floatingActionButton getting next errors:
An Observatory debugger and profiler on sdk gphone x86 is available at: http://127.0.0.1:43629/SLxpUgM8P80=/
D/HostConnection(28686): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
D/EGL_emulation(28686): eglMakeCurrent: 0xf5360760: ver 2 0 (tinfo 0xf56b7dd0) (first time)
I/Choreographer(28686): Skipped 964 frames! The application may be doing too much work on its main thread.
W/System.err(28686): java.lang.UnsatisfiedLinkError: dlopen failed: library "libtdjson.so" not found
W/System.err(28686): at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
W/System.err(28686): at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
W/System.err(28686): at java.lang.System.loadLibrary(System.java:1664)
W/System.err(28686): at org.drinkless.tdlib.JsonClient.<clinit>(JsonClient.java:15)
W/System.err(28686): at org.drinkless.tdlib.JsonClient.create(Native Method)
W/System.err(28686): at org.naji.td.tdlib.TdlibPlugin.onMethodCall(TdlibPlugin.java:107)
W/System.err(28686): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
W/System.err(28686): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err(28686): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
W/System.err(28686): at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(28686): at android.os.MessageQueue.next(MessageQueue.java:335)
W/System.err(28686): at android.os.Looper.loop(Looper.java:183)
W/System.err(28686): at android.app.ActivityThread.main(ActivityThread.java:7656)
W/System.err(28686): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(28686): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
W/System.err(28686): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/ple.hello_worl(28686): No implementation found for long org.drinkless.tdlib.JsonClient.create() (tried Java_org_drinkless_tdlib_JsonClient_create and Java_org_drinkless_tdlib_JsonClient_create__)
E/flutter (28686): [ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(43)] java.lang.UnsatisfiedLinkError: No implementation found for long org.drinkless.tdlib.JsonClient.create() (tried Java_org_drinkless_tdlib_JsonClient_create and Java_org_drinkless_tdlib_JsonClient_create__)
E/flutter (28686): at org.drinkless.tdlib.JsonClient.create(Native Method)
E/flutter (28686): at org.naji.td.tdlib.TdlibPlugin.onMethodCall(TdlibPlugin.java:107)
E/flutter (28686): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
E/flutter (28686): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter (28686): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/flutter (28686): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (28686): at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter (28686): at android.os.Looper.loop(Looper.java:183)
E/flutter (28686): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/flutter (28686): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (28686): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/flutter (28686): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/flutter (28686):
F/flutter (28686): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env).
F/libc (28686): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 28686 (ple.hello_world), pid 28686 (ple.hello_world)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_x86/generic_x86_arm:11/RSR1.200819.001.A1/6823625:user/release-keys'
Revision: '0'
ABI: 'x86'
Timestamp: 2020-09-19 22:41:43+0300
pid: 28686, tid: 28686, name: ple.hello_world >>> com.example.hello_world <<<
uid: 10151
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: '[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env).
'
eax 00000000 ebx 0000700e ecx 0000700e edx 00000006
edi f0c1b80e esi ffbbd810
ebp f5a0fb90 esp ffbbd7b8 eip f5a0fb99
backtrace:
#00 pc 00000b99 [vdso] (__kernel_vsyscall+9)
#01 pc 0005ad68 /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: a690ed60a8b6a282b41dd991389b5fdb)
#02 pc 00076511 /apex/com.android.runtime/lib/bionic/libc.so (abort+209) (BuildId: a690ed60a8b6a282b41dd991389b5fdb)
#03 pc 0117efe2 /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#04 pc 0116b0c7 /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#05 pc 011661ee /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#06 pc 011d5dc3 /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#07 pc 0117d29d /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#08 pc 0117fddb /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#09 pc 0117fd1e /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#10 pc 0118617e /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#11 pc 011861ac /data/app/~~tzyR3n12WtmOvbpJV1ViwA==/com.example.hello_world-eYKN35FIsrUVuyGfUOW0rw==/lib/x86/libflutter.so (BuildId: ab1cd743c331d656739b38947d269b708c594cb6)
#12 pc 00019337 /system/lib/libutils.so (android::SimpleLooperCallback::handleEvent(int, int, void*)+39) (BuildId: ab4be013cda31e8c45d48aa23a89d0f8)
#13 pc 0001a367 /system/lib/libutils.so (android::Looper::pollInner(int)+1127) (BuildId: ab4be013cda31e8c45d48aa23a89d0f8)
#14 pc 00019e96 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+118) (BuildId: ab4be013cda31e8c45d48aa23a89d0f8)
#15 pc 0010ef8b /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+59) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#16 pc 0021be48 /system/framework/x86/boot-framework.oat (art_jni_trampoline+136) (BuildId: cd049c9ca9f46317ecd7d512d6b856181c4d6d60)
#17 pc 020013a6 /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.MessageQueue.next+230)
#18 pc 0013b922 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#19 pc 001d0381 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#20 pc 003866e1 /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#21 pc 0037aa1e /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#22 pc 007a1197 /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+967) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#23 pc 001357a1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#24 pc 00396968 /system/framework/framework.jar (offset 0x92b000) (android.os.Looper.loop+156)
#25 pc 0036fae2 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.12175385690420896393)+370) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#26 pc 00379bff /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+207) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#27 pc 0037b495 /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, true>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+2117) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#28 pc 0018e613 /apex/com.android.art/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<true, false>(art::interpreter::SwitchImplContext*)+81395) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#29 pc 00142de2 /apex/com.android.art/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#30 pc 001a1698 /system/framework/framework.jar (android.app.ActivityThread.main)
#31 pc 0036fa6e /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.12175385690420896393)+254) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#32 pc 00379ae0 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#33 pc 0078b305 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#34 pc 0014220d /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#35 pc 0013baf2 /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#36 pc 001d0392 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#37 pc 0062ffe8 /apex/com.android.art/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+1464) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#38 pc 00588680 /apex/com.android.art/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+80) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#39 pc 0008a778 /apex/com.android.art/javalib/x86/boot.oat (art_jni_trampoline+168) (BuildId: b386118502376442aa402e8d28c29e95a6eb8614)
#40 pc 0013b922 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#41 pc 001d0381 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#42 pc 003866e1 /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#43 pc 0037aa1e /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#44 pc 007a1197 /apex/com.android.art/lib/libart.so (MterpInvokeVirtual+967) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#45 pc 001357a1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#46 pc 004492d2 /system/framework/framework.jar (offset 0x125d000) (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
#47 pc 0036fae2 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.12175385690420896393)+370) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#48 pc 00379ae0 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#49 pc 0078b305 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#50 pc 0014220d /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#51 pc 00893696 /system/framework/x86/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2102) (BuildId: cd049c9ca9f46317ecd7d512d6b856181c4d6d60)
#52 pc 0013baf2 /apex/com.android.art/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#53 pc 001d0392 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+258) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#54 pc 0062e633 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, char*)+579) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#55 pc 0062eb05 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, char*)+85) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#56 pc 004ce62f /apex/com.android.art/lib/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+735) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#57 pc 003f8a8e /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, char*, art::Primitive::Type, art::InvokeType)+2846) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#58 pc 003e60b9 /apex/com.android.art/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+73) (BuildId: 123e60096a46399e6f56e4eb5c70759a)
#59 pc 0008f90e /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+62) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#60 pc 00098c8e /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+910) (BuildId: 588f2cd5873ff4273bb25b25edb82606)
#61 pc 00003804 /system/bin/app_process32 (main+1588) (BuildId: c5eedbfb6130af84c3db8e121fb1202e)
#62 pc 000522e3 /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+115) (BuildId: a690ed60a8b6a282b41dd991389b5fdb)
Lost connection to device.
Maybe i am missing something? Seems like the problem in that library "libtdjson.so" not found. I supposed that i should compile libtdjson.so by myself and put somewhere in the project(that kinda non-obvious, because documentation tells no word about this). I tried to put lib into core dir of project and still getting errors.
What am i doing wrong?
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.4, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.49.0)
[✓] Connected device (1 available)
• No issues found!
This is really cool project! Would you mind adding instructions on how to generate the jniLibs: https://github.com/i-Naji/tdlib/tree/master/android/src/main/jniLibs? Thanks!
Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.
flutter pub get
_CastError: type 'Null' is not a subtype of type 'String' in type cast
#0 new WebPlugin.fromYaml (package:flutter_tools/src/platform_plugins.dart:548:34)
#1 new Plugin._fromMultiPlatformYaml (package:flutter_tools/src/plugins.dart:142:21)
#2 new Plugin.fromYaml (package:flutter_tools/src/plugins.dart:78:21)
#3 _pluginFromPackage (package:flutter_tools/src/flutter_plugins.dart:63:17)
#4 findPlugins (package:flutter_tools/src/flutter_plugins.dart:88:28)
<asynchronous suspension>
#5 refreshPluginsList (package:flutter_tools/src/flutter_plugins.dart:1080:32)
<asynchronous suspension>
#6 FlutterProject.ensureReadyForPlatformSpecificTooling (package:flutter_tools/src/project.dart:357:5)
<asynchronous suspension>
#7 PackagesGetCommand.runCommand (package:flutter_tools/src/commands/packages.dart:182:7)
<asynchronous suspension>
#8 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1257:27)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#11 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:283:9)
<asynchronous suspension>
#12 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#13 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#14 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
[✓] Flutter (Channel stable, 3.7.8, on Microsoft Windows [Version 10.0.19044.2728], locale en-US)
• Flutter version 3.7.8 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 90c64ed42b (3 days ago), 2023-03-21 11:27:08 -0500
• Engine revision 9aa7816315
• Dart version 2.19.5
• DevTools version 2.20.1
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at C:\Users\marcu\AppData\Local\Android\sdk
• Platform android-33-ext5, build-tools 33.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.24)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
• Visual Studio Build Tools 2019 version 16.11.33328.57
• Windows 10 SDK version 10.0.19041.0
[✓] Android Studio (version 2022.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
[✓] VS Code (version 1.76.2)
• VS Code at C:\Users\marcu\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.60.0
[✓] Connected device (4 available)
• SM J260M (mobile) • 4200c1f102e12663 • android-arm • Android 8.1.0 (API 27)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.2728]
• Chrome (web) • chrome • web-javascript • Google Chrome 111.0.5563.111
• Edge (web) • edge • web-javascript • Microsoft Edge 111.0.1661.51
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
This is not the result of hot reload,
Launching lib/main.dart on Android SDK built for x86 64 in debug mode...
lib/main.dart
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:37311/7dYhxWJixZc=/ws
D/EGL_emulation( 6459): eglMakeCurrent: 0x7cc65b7310a0: ver 2 0 (tinfo 0x7cc653866880)
I/DLTD ( 6459): [ 3][t 4][1606299166.683610200][Td.cpp:4490][#1][!Td][&td_requests] Sending update: updateOption {
I/DLTD ( 6459): name = "version"
I/DLTD ( 6459): value = optionValueString {
I/DLTD ( 6459): value = "1.6.8"
I/DLTD ( 6459): }
I/DLTD ( 6459): }
I/DLTD ( 6459): [ 3][t 4][1606299166.683663129][Td.cpp:4490][#1][!Td][&td_requests] Sending update: updateAuthorizationState {
I/DLTD ( 6459): authorization_state = authorizationStateWaitTdlibParameters {
I/DLTD ( 6459): }
I/DLTD ( 6459): }
I/DLTD ( 6459): [ 3][t 7][1606299166.891062021][Td.cpp:4490][#2][!Td][&td_requests] Sending update: updateOption {
I/DLTD ( 6459): name = "version"
I/DLTD ( 6459): value = optionValueString {
I/DLTD ( 6459): value = "1.6.8"
I/DLTD ( 6459): }
I/DLTD ( 6459): }
I/DLTD ( 6459): [ 3][t 7][1606299166.891098260][Td.cpp:4490][#2][!Td][&td_requests] Sending update: updateAuthorizationState {
I/DLTD ( 6459): authorization_state = authorizationStateWaitTdlibParameters {
I/DLTD ( 6459): }
I/DLTD ( 6459): }
E/EventChannel#channel/to/tdlib/receive( 6459): Failed to close existing event stream
E/EventChannel#channel/to/tdlib/receive( 6459): java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Number.longValue()' on a null object reference
E/EventChannel#channel/to/tdlib/receive( 6459): at org.naji.td.tdlib.TdlibPlugin.onCancel(TdlibPlugin.java:175)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:182)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.os.MessageQueue.nativePollOnce(Native Method)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.os.MessageQueue.next(MessageQueue.java:323)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.os.Looper.loop(Looper.java:136)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.app.ActivityThread.main(ActivityThread.java:6077)
E/EventChannel#channel/to/tdlib/receive( 6459): at java.lang.reflect.Method.invoke(Native Method)
E/EventChannel#channel/to/tdlib/receive( 6459): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
E/EventChannel#channel/to/tdlib/receive( 6459): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
E/EventChannel#channel/to/tdlib/receive( 6459): Failed to close existing event stream
E/EventChannel#channel/to/tdlib/receive( 6459): java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Number.longValue()' on a null object reference
E/EventChannel#channel/to/tdlib/receive( 6459): at org.naji.td.tdlib.TdlibPlugin.onCancel(TdlibPlugin.java:175)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:182)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/EventChannel#channel/to/tdlib/receive( 6459): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.os.MessageQueue.nativePollOnce(Native Method)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.os.MessageQueue.next(MessageQueue.java:323)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.os.Looper.loop(Looper.java:136)
E/EventChannel#channel/to/tdlib/receive( 6459): at android.app.ActivityThread.main(ActivityThread.java:6077)
E/EventChannel#channel/to/tdlib/receive( 6459): at java.lang.reflect.Method.invoke(Native Method)
E/EventChannel#channel/to/tdlib/receive( 6459): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
E/EventChannel#channel/to/tdlib/receive( 6459): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
flutter run
Using hardware rendering with device sdk gphone64 arm64. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Plugin project :tdlib not found. Please update settings.gradle.
FAILURE: Build failed with an exception.
* Where:
Script '/opt/homebrew/Caskroom/flutter/2.8.1/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 473
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Cannot invoke method afterEvaluate() on null object
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Running Gradle task 'assembleDebug'... 2 451ms
Exception: Gradle task assembleDebug failed with exit code 1
OS : Mac OS 12.4 Monterey
Arch : ARM - 64 - Apple M1 chip
Flutter version : 3.3.4 (I installed flutter with homebrew, and ran flutter upgrade since)
Tdlib version : ^1.5.9 as of pubspec.yml
The same error happens when using flutter run in the provided example flutter project.
The installation of the package creates a file
generated_plugin_registrant.dart
with wrong paths (which makes it impossible to start the project in any way) also please fix the example for ios
please If possible, contact me on telegram @denisdandy
i upgrade Dart to 3.0, and i got this error
The plugin tdlib
is missing the required field fileName
in pubspec.yaml
It is very stranger that some classes in TdObject or TdFunction caught some unexpected errors while others are fine. it says
Classes and mixins can only implement other classes and mixins. Try specifying a class or mixin, or remove the name from the list.dartimplements_non_class
or Undefined class 'TdObject'. Try changing the name to the name of an existing class, or creating a class with the name 'TdObject'.dart undefined_class
And
Classes can only extend other classes. Try specifying a different superclass, or removing the extends clause.dart(extends_non_class) Undefined class 'TdFunction'. Try changing the name to the name of an existing class, or creating a class with the name 'TdFunction'.dart undefined_class
I try to import certain parent packages, but it does not work, and wh
any suggestions? Thank you in advance!
Can you please update the example to make request functions and receive the updates of sent functions?
I builded at the files for ios in this tutorial - https://github.com/tdlib/td/tree/master/example/ios, but I do not know how to connect them, where to put them, in which folder? And how to make the ios version work?
Error causing function:
sendMessage() async {
TdApi.FormattedText messageText = TdApi.FormattedText(text: messageGetter.text, entities: []);
TdApi.MessageSendOptions messageSendOptions = TdApi.MessageSendOptions(disableNotification: false) ;
TdApi.InputMessageText message = TdApi.InputMessageText(text: messageText);
final result = await context.read<TelegramService>().send(
TdApi.SendMessage(chatId: contact_id, inputMessageContent: message, options: messageSendOptions),
);
print(result);
}
The stacktrace returned:
E/flutter (13086): #0 _JsonStringifier.writeObject (dart:convert/json.dart:688:7)
E/flutter (13086): #1 _JsonStringStringifier.printOn (dart:convert/json.dart:877:17)
E/flutter (13086): #2 _JsonStringStringifier.stringify (dart:convert/json.dart:862:5)
E/flutter (13086): #3 JsonEncoder.convert (dart:convert/json.dart:262:30)
E/flutter (13086): #4 JsonCodec.encode (dart:convert/json.dart:172:45)
E/flutter (13086): #5 TdClient.clientSend (package:tdlib/src/tdclient/tdclient.dart:32:63)
E/flutter (13086): #6 TelegramService.send (package:fima/services/telegram_service.dart:195:22)
E/flutter (13086): #7 _ChatScreenState.sendMessage (package:fima/screens/main/chat.dart:210:58)
E/flutter (13086): #8 _ChatScreenState.build.<anonymous closure>.<anonymous closure> (package:fima/screens/main/chat.dart:94:50)
E/flutter (13086): #9 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:989:21)
E/flutter (13086): #10 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (13086): #11 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:607:11)
E/flutter (13086): #12 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:296:5)
E/flutter (13086): #13 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:230:7)
E/flutter (13086): #14 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
E/flutter (13086): #15 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:93:12)
E/flutter (13086): #16 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:138:9)
E/flutter (13086): #17 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
E/flutter (13086): #18 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:136:18)
E/flutter (13086): #19 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:122:7)
E/flutter (13086): #20 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:439:19)
E/flutter (13086): #21 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:419:22)
E/flutter (13086): #22 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:287:11)
E/flutter (13086): #23 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374:7)
E/flutter (13086): #24 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338:5)
E/flutter (13086): #25 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296:7)
E/flutter (13086): #26 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279:7)
E/flutter (13086): #27 _rootRunUnary (dart:async/zone.dart:1370:13)
E/flutter (13086): #28 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (13086): #29 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
E/flutter (13086): #30 _invoke1 (dart:ui/hooks.dart:182:10)
E/flutter (13086): #31 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:282:7)
E/flutter (13086): #32 _dispatchPointerDataPacket (dart:ui/hooks.dart:96:31)
Hi I am New to Dart and telegram.
Can you share Some basic examples for Authentication and sending the Message.
It will be great help
Building lib (Replacing prebuild libs) and support for IOS are in progress but I'm out of time to catch them up.
Hi, great work with the library!
Is it possible to share the script you used to generate the dart files under /tdapi/.. ?
The reason is, you've used int64 of tl as int of dart. I think dart converts int64 to string. So some of the autogenerated files breaks.
Also, some of the objects received from tdclient are null, which breaks the toJson() of certain objects in your library.
There seems to be some inconsistency between the types returned by the Telegram server and the definition. For example, I got the following error:
I/flutter ( 6625): res =>>>> {@type: updateConnectionState, state: {@type: connectionStateReady}}
E/flutter ( 6625): [ERROR:flutter/lib/ui/ui_dart_state.cc(171)] Unhandled Exception: type 'String' is not a subtype of type 'int'
E/flutter ( 6625): #0 new ProfilePhoto.fromJson (package:tdlib/src/tdapi/objects/profile_photo.dart:21:10)
E/flutter ( 6625): #1 new User.fromJson (package:tdlib/src/tdapi/objects/user.dart:64:38)
E/flutter ( 6625): #2 new UpdateUser.fromJson (package:tdlib/src/tdapi/objects/update.dart:1598:22)
E/flutter ( 6625): #3 allObjects.<anonymous closure> (package:tdlib/src/tdapi/tdapi.dart:1484:37)
E/flutter ( 6625): #4 convertToObject (package:tdlib/src/tdapi/convertor.dart:6:48)
E/flutter ( 6625): #5 TdClient.clientEvents.<anonymous closure> (package:tdlib/src/tdclient/tdclient.dart:39:25)
E/flutter ( 6625): #6 _MapStream._handleData (dart:async/stream_pipe.dart:219:31)
E/flutter ( 6625): #7 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:157:13)
E/flutter ( 6625): #8 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter ( 6625): #9 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter ( 6625): #10 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter ( 6625): #11 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
E/flutter ( 6625): #12 _DelayedData.perform (dart:async/stream_impl.dart:611:14)
E/flutter ( 6625): #13 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:730:11)
E/flutter ( 6625): #14 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:687:7)
E/flutter ( 6625): #15 _rootRun (dart:async/zone.dart:1182:47)
E/flutter ( 6625): #16 _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 6625): #17 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter ( 6625): #18 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
E/flutter ( 6625): #19 _rootRun (dart:async/zone.dart:1190:13)
E/flutter ( 6625): #20 _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 6625): #21 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter ( 6625): #22 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
E/flutter ( 6625): #23 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter ( 6625): #24 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
E/flutter ( 6625):
According to the API definition (https://github.com/i-Naji/tdlib/blob/master/data/td_api.tl#L315 as well as upstream https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl#L315), ProfilePhoto.id
is an int. But I'm getting the error above. I'm wondering whether the upstream definition is out of date with the Telegram server for some reason. BTW, there are quite some types that have the string to int mismatch issue when running the example in this repo.
Please, update base TDLib version to 1.5.0.
Thank you!
A problem occurred configuring project ':tdlib'.
NDK not configured.
Download it with SDK manager.
Does anyone know of a way to persist the user's session such as saving the session and loading it back into the app without the user needing to enter their phone number and go through the sign in process again?
The issue I have is that, every time I hot reload in Flutter, I need to go through that sign in process again whenever I change my code. There is a python library called Telethon which lets you save the session, but I was wondering if you could do that with this library.
I've tried to read the source code to find out if there is anything I could use, but I cannot find anything so would really appreciate it if someone could guide me on how I can persist the user's session.
Could you provide a documentation to help us easily implement the stuff
When the example is hot restarted, I receive the following TDLib error:
E/EventChannel#channel/to/tdlib/receive(19857): Failed to close existing event stream E/EventChannel#channel/to/tdlib/receive(19857): java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Number.longValue()' on a null object reference E/EventChannel#channel/to/tdlib/receive(19857): at org.naji.td.tdlib.TdlibPlugin.onCancel(TdlibPlugin.java:175) E/EventChannel#channel/to/tdlib/receive(19857): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:182) E/EventChannel#channel/to/tdlib/receive(19857): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167) E/EventChannel#channel/to/tdlib/receive(19857): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/EventChannel#channel/to/tdlib/receive(19857): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692) E/EventChannel#channel/to/tdlib/receive(19857): at android.os.MessageQueue.nativePollOnce(Native Method) E/EventChannel#channel/to/tdlib/receive(19857): at android.os.MessageQueue.next(MessageQueue.java:336)
Hi, i was using telethon library and there was a method to handle updates like incomming message etc. How i can archive this With this flutter packache. Thaknsss
I've noticed new method in version 1.5.9. It is not useful to it's max extent I think.
For instance, if I recieve an update of a draft with UpdateChatDraftMessage
that event may contain draft message but also may contain null
if draftMessage was deleted. And if in my code I do
var chatCopy = chat.copyWith(draftMessage: event.draftMessage)
then if event.draftMessage is null it doesn't work, because you've put null-aware operator in that method.
Your code:
Chat copyWith({
int? id,
/*.......*/
DraftMessage? draftMessage,
/*.......*/
}) =>
Chat(
id: id ?? this.id,
/*.......*/
draftMessage: draftMessage ?? this.draftMessage, // <-- this right here will always keep the draft message of original object
/*.......*/
);
Despite the fact that draftmessage is allowed to be null by design. Same goes for many other fields in many other classes.
I need this method, because previously I was doing fromJson(Chat.toJson()) but you have type mistakes in "fromJson" method in some classes(I can fire separate issue for those if you need)
Hey @i-Naji !
Just wanted to say I find this project super cool.
I can see thousands of apps that instead of building their own chat could and embedded white-branded Telegram's, starting with our own humble Point of Sale solution.
Very little help in terms of coding I would be happy to provide design if it can be be of any support. Good luck on this ambitious endeavour,
how to get all chats? i dont understand how to call method
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.