パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.2.1

signalr_flutter

.net SignalR クライアント用のFlutterプラグイン。このクライアントはASP.Net SignalR用であり、.Net Core SignalR用ではない。

AndroidiOS
30日間ダウンロード
185
いいね数
83
Pub ポイント
150

パッケージをインストール

flutter pub add signalr_flutter

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

signalr_flutter は、ASP.NET SignalR サーバーとのリアルタイム通信を可能にする Flutter プラグインです。Flutter アプリと .NET ベースの SignalR バックエンド間での双方向メッセージングを促進し、接続管理、イベント処理、自動再接続などの機能をサポートしています。.NET Core ではなく ASP.NET SignalR 専用に設計されており、Android および iOS アプリケーションにスムーズに統合できます。このプラグインにより、Flutter アプリでライブアップデート、チャットシステム、通知、共同作業ツールの実装が簡単になります。

用途

  • リアルタイムチャットアプリケーション
  • ライブダッシュボードの更新
  • プッシュ通知
  • 共同編集ツール
  • IoTデバイスのモニタリング

主な機能

  • ASP.NET SignalR のみをサポート
  • 双方向通信
  • 自動再接続
  • イベント駆動型メッセージ処理
  • 軽量でプラットフォームに依存しない

適している対象

  • ASP.NET SignalR を使用する開発者
  • リアルタイムデータ同期を必要とするアプリ
  • ライブ更新が必要なモバイルアプリ
  • インタラクティブな体験を構築するチーム

注意事項

  • .NET Core SignalR と互換性がありません
  • サーバーサイドのASP.NET SignalR設定が必要です
  • AndroidおよびiOSプラットフォームに限定

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

signalr_flutter

A flutter plugin for .net SignalR client.

Usage

First of all, Initialize SignalR and connect to your server.

SignalR signalR = SignalR(
        '<Your server url here>',
        "<Your hub name here>",
        hubMethods: ["<Your Hub Method Names>"]
        statusChangeCallback: (status) => print(status),
        hubCallback: (methodName, message) => print('MethodName = $methodName, Message = $message'));
signalR.connect();

Here statusChangeCallback will get called whenever connection status with server changes.

hubCallback will receive calls from the server if you subscribe to any hub method. You can do that with hubMethods.

hubMethods are the hub method names you want to subscribe.

There is a headers parameters also which takes a Map<String, String>.

You can also invoke any server method.

signalR.invokeMethod("<Your method name here>", arguments: ["argument1", "argument2"]);

If you are trying to connect with a HTTP url, then you need to add the following lines to the manifest of your android project.

<application
        android:usesCleartextTraffic="true">
</application>

This is because of the Network Security Config.

R8 may strip away some SignalR classes for the Android in Release Builds. Add the following line in your proguard-rules.pro file to solve this issue.

-keep class microsoft.aspnet.signalr.client.hubs.** { *; }

For more info check example.

Any issue or PR is always welcome.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。