{"id":20078096,"url":"https://github.com/quickblox/quickblox-flutter-sdk","last_synced_at":"2025-03-02T13:13:49.993Z","repository":{"id":41415825,"uuid":"233862356","full_name":"QuickBlox/quickblox-flutter-sdk","owner":"QuickBlox","description":"quickblox-flutter-sdk","archived":false,"fork":false,"pushed_at":"2025-01-30T17:17:46.000Z","size":124,"stargazers_count":9,"open_issues_count":5,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-30T18:25:58.493Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QuickBlox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-14T14:40:50.000Z","updated_at":"2025-01-30T17:17:45.000Z","dependencies_parsed_at":"2024-03-20T14:45:53.003Z","dependency_job_id":"630248b1-6933-4aa2-af3e-921e4a3b4ed2","html_url":"https://github.com/QuickBlox/quickblox-flutter-sdk","commit_stats":{"total_commits":13,"total_committers":3,"mean_commits":4.333333333333333,"dds":"0.46153846153846156","last_synced_commit":"d9f9db1b1106bcbd51b6d64d4d733417d2f17fad"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuickBlox%2Fquickblox-flutter-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuickBlox%2Fquickblox-flutter-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuickBlox%2Fquickblox-flutter-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuickBlox%2Fquickblox-flutter-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuickBlox","download_url":"https://codeload.github.com/QuickBlox/quickblox-flutter-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241509656,"owners_count":19974071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T15:12:50.804Z","updated_at":"2025-03-02T13:13:49.985Z","avatar_url":"https://github.com/QuickBlox.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cp\u003e\n\t\t\u003ca href=\"https://discord.com/invite/3cKRunq8ZZ\"\u003e\u003cimg src=\"https://img.shields.io/discord/1042743094833065985?color=5865F2\u0026logo=discord\u0026logoColor=white\u0026label=QuickBlox%20Discord%20server\u0026style=for-the-badge\" alt=\"Discord server\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n# Quickblox Flutter  SDK\n\n## Quick Start\nThis guide demonstarates how to connect Quickblox Flutter SDK to your project and start development.\n\nDocumentation: https://docs.quickblox.com/docs/flutter-quick-start\n\npub.dev package: https://pub.dev/packages/quickblox_sdk\n\n### Create a new app in the Admin Panel\nQuickblox application includes everything that brings messaging right into your application - chat, video calling, users, push notifications, etc. To create a QuickBlox application, follow the steps below:\n\n1. Register a new account. Type in your email and password to sign in. You can also sign in with your Google or Github accounts. \n2. Create the app clicking **New app** button. \n3. Configure the app. Type in the information about your organization into corresponding fields and click **Add** button.\n4. Go to the screen with credentials. Locate **Credentials** groupbox and copy your **Application ID**, **Authorization Key**, and **Authorization Secret**. These data are needed to run your application on QuickBlox server.\n\n### Install Flutter SDK into your app\n\nTo create a new Flutter chat messaging app with QuickBlox SDK from scratch follow these steps:\n1. Install [Flutter](https://flutter.dev/docs/get-started/install) for your platform\n2. Run `flutter create myapp` to create a new project\n4. Add QuickBlox SDK into your project's dependencies into **dependencies** section in \\**pubspec.yaml*\\* file in your root project dir.  \n\n`\ndependencies:\nquickblox_sdk: 0.16.5\n`\n\n### Send your first message\n#### Initialize QuickBlox SDK\n\nInitialize the framework with your application credentials. Pass `appId`, `authKey`, `authSecret`, `accountKey` to the `QB.settings.init` method using the code snippet below. As a result, your application details are stored in the server database and can be subsequently identified on the server. \n\n```dart\nconst String APP_ID = \"XXXXX\";\nconst String AUTH_KEY = \"XXXXXXXXXXXX\";\nconst String AUTH_SECRET = \"XXXXXXXXXXXX\";\nconst String ACCOUNT_KEY = \"XXXXXXXXXXXX\";\nconst String API_ENDPOINT = \"\"; //optional\nconst String CHAT_ENDPOINT = \"\"; //optional\n\ntry {\n      await QB.settings.init(APP_ID, AUTH_KEY, AUTH_SECRET, ACCOUNT_KEY,\n          apiEndpoint: API_ENDPOINT, chatEndpoint: CHAT_ENDPOINT);\n    } on PlatformException catch (e) {\n        // Some error occured, look at the exception message for more details \n    }\n```\n\n#### Authorize user\n\nIn order to use the abilities of QuickBlox SDK, you need to authorize your app on the server, log in to your account and create a session. To get it all done call `QB.auth.login` method and pass `login` and `password` parameters to it using the code snippet below. \n\n```dart\ntry {\n      QBLoginResult result = await QB.auth.login(login, password);\n      QBUser qbUser = result.qbUser;\n      QBSession qbSession = result.qbSession;\n    } on PlatformException catch (e) {\n         // Some error occured, look at the exception message for more details     \n    }\n```    \n**Note!**\nYou must initialize SDK before calling any methods through the SDK except for the method initializing your QuickBlox instance. If you attempt to call a method without connecting, the error is returned.\n\n#### Connect to chat\n\nTo connect to chat server, use the code snippet below:\n\n```dart\ntry {\n      await QB.chat.connect(userId, userPassword);\n     } on PlatformException catch (e) {\n          // Some error occured, look at the exception message for more details     \n     }\n```\n\n#### Create dialog\n\nQuickBlox provides three types of dialogs: **1-1 dialog**, **group dialog**, and **public dialog**.\n\nLet’s create **1-1 dialog**. Call `QB.chat.createDialog` method and pass `QBChatDialogTypes.CHAT` parameter as a dialog type to it. `QBChatDialogTypes.CHAT` parameter allows specifying that two occupants are going to participate in the dialog.\n\n```dart\ntry {\n      QBDialog createdDialog = await QB.chat.createDialog(occupantsIds, dialogName, dialogType: dialogType);\n      } on PlatformException catch (e) {\n           // Some error occured, look at the exception message for more details     \n      }\n```      \n\n#### Subscribe to receive messages\n\nQuickBlox provides chat event handler allowing to notify client apps of events that happen on the chat. Thus, when a dialog has been created, a user can subscribe to receive notifications about new incoming messages. To subscribe to message events call `QB.chat.subscribeChatEvent` method and pass QBChatEvents.RECEIVED_NEW_MESSAGE as an event parameter to it using the following code snippet.\n\n`event` - provides some values:\n\n- `QBChatEvents.RECEIVED_NEW_MESSAGE` - subscribe to `new messages` event\n- `QBChatEvents.RECEIVED_SYSTEM_MESSAGE` - subsccribe to `system messages` event\n- `QBChatEvents.MESSAGE_DELIVERED` - subscribe to `message delivered` event\n- `QBChatEvents.MESSAGE_READ` - subscribe to `message read` event\n\n```dart\n\nStreamSubscription? _someSubscription;\n\n...\n\n@override\nvoid dispose() {\n  if(_someSubscription != null) {\n    _someSubscription!.cancel();\n    _someSubscription = null;\n  }\n}\n\n...\n\nString event = QBChatEvents.RECEIVED_NEW_MESSAGE;\n\ntry {\n  _someSubscription = await QB.chat.subscribeChatEvent(event, (data) {\n        Map\u003cdynamic, dynamic\u003e map = Map\u003cdynamic, dynamic\u003e.from(data);\n    Map\u003cdynamic, dynamic\u003e payload = Map\u003cdynamic, dynamic\u003e.from(map[\"payload\"]);\n    String? messageId = payload[\"id\"];\n  }\n});\n} on PlatformException catch (e) {\n  // Some error occurred, look at the exception message for more details\n}\n```  \n\n#### Send message\n\nWhen a dialog is created, a user can send a message. To create and send your first message, call `QB.chat.sendMessage` method and specify the `dialogId` and `body` parameters to it. Pass `saveToHistory` parameter if you want this message to be saved in chat history that is stored forever.\n\n```dart\ntry {\n      await QB.chat.sendMessage(dialogId, body: messageBody, saveToHistory: true);\n      } on PlatformException catch (e) {\n          // Some error occured, look at the exception message for more details     \n      }\n```      \n\n## LICENSE\nFor license information, please visit: https://quickblox.com/terms-of-use/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquickblox%2Fquickblox-flutter-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquickblox%2Fquickblox-flutter-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquickblox%2Fquickblox-flutter-sdk/lists"}