Demonstrates how to use the libtdjson plugin.
-
Go to Telegram my apps to create your own app
-
Create
./assets/cfg/app.json
file, 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
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
flutter run -d emulator-5554
flutter create -i objc --template plugin --platforms ios --project-name libtdjson _tmp
rm -fr ios
mv ./_tmp/example/ios .
rm -fr _tmp
cd ios
rm Podfile.lock
pod install --repo-update
cd ..
./ios_cleanup_run.sh
./ios_cleanup_run.sh
flutter create --template plugin --platforms macos --project-name libtdjson _tmp
rm -fr macos
mv ./_tmp/example/macos .
rm -fr _tmp
Add following part to ./macos/Runner/DebugProfile.entitlements
, see setup entitlements
<dict>
<key>com.apple.security.network.client</key>
<true/>
</dict>
flutter run -d macos
cd macos
rm Podfile.lock
pod install --repo-update
cd ..
flutter run -d macos
macos: [!] CocoaPods could not find compatible versions for pod "flutter_libtdjson": In snapshot (Podfile.lock)
pod repo update
./macos_cleanup_run.sh