Skip to content

Files

Latest commit

38ecc20 · Jun 28, 2024

History

History

example

libtdjson_example

Demonstrates how to use the libtdjson plugin.

Getting Started

  • 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

Dev memo

Regenerate ./android

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

Run android

flutter run -d emulator-5554

Regenerate ./ios

flutter create -i objc --template plugin --platforms ios --project-name libtdjson _tmp
rm -fr ios
mv ./_tmp/example/ios .
rm -fr _tmp

ios: Exception: Error running pod install

cd ios
rm Podfile.lock
pod install --repo-update
cd ..
./ios_cleanup_run.sh

ios: Error: Undefined symbols for ...

./ios_cleanup_run.sh

Regenerate ./macos

flutter create --template plugin --platforms macos --project-name libtdjson _tmp
rm -fr macos
mv ./_tmp/example/macos .
rm -fr _tmp

Run macos

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

macos: Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.

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