Demonstrates how to use the libtdjson plugin.
-
Go to Telegram my apps to create your own app
-
Create
./assets/cfg/app.jsonfile, and put your credential in:{ "telegram_api_id": 123456, "telegram_api_hash": "xxxxxx" } -
Follow the plugin installation
-
To get the device id by running
flutter devices -
flutter run -d <device id>, e.q. flutter run -d emulator-5554- if the target device not exist, launch the emulator:
flutter emulators,flutter emulators --launch <id>
- if the target device not exist, launch the emulator:
flutter create -a java --template plugin --platforms android --project-name libtdjson --org io.github.up9cloud _tmp
rm -fr android
mv ./_tmp/example/android .
rm -fr _tmp
# remember add the permission back to file `./android/app/src/main/AndroidManifest.xml`flutter run -d emulator-5554flutter create -i objc --template plugin --platforms ios --project-name libtdjson _tmp
rm -fr ios
mv ./_tmp/example/ios .
rm -fr _tmpcd ios
rm Podfile.lock
pod install --repo-update
cd ..
./ios_cleanup_run.sh./ios_cleanup_run.shflutter create --template plugin --platforms macos --project-name libtdjson _tmp
rm -fr macos
mv ./_tmp/example/macos .
rm -fr _tmpAdd following part to ./macos/Runner/DebugProfile.entitlements, see setup entitlements
<dict>
<key>com.apple.security.network.client</key>
<true/>
</dict>flutter run -d macoscd macos
rm Podfile.lock
pod install --repo-update
cd ..
flutter run -d macosmacos: [!] CocoaPods could not find compatible versions for pod "flutter_libtdjson": In snapshot (Podfile.lock)
pod repo update
./macos_cleanup_run.sh