Skip to content

Latest commit

 

History

History
147 lines (116 loc) · 4.81 KB

README.md

File metadata and controls

147 lines (116 loc) · 4.81 KB

Push Protocol is a web3 communication network, enabling cross-chain notifications, messaging, video, and NFT chat for dapps, wallets, and services.🚀

Push Dart Socket Client

This package helps to connect to Push backend using websockets built on top of Socket.IO

📚 Table of Contents


Documentation

Visit Developer Docs or Push.org to learn more.

🚀 Getting Started

🖥 Installation

Add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  push_socket_client_dart: ^0.0.1-alpha

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Try it:

import 'package:push_socket_client_dart/push_socket_client_dart.dart';

void main() {
  final options = SocketInputOptions(
    user: '0x08f890A796E757714c3472032383634565aF6044',
    env: ENV.DEV,
    socketType: SOCKETTYPES.NOTIFICATION,
    socketOptions: SocketOptions(
      autoConnect: true,
      reconnectionAttempts: 5,
    ),
  );
  final pushSocket = createSocketConnection(options);
  print('Result: $pushSocket');

  if (pushSocket != null) {
    pushSocket.connect();

    pushSocket.on(
      EVENTS.CONNECT,
      (data) {
        print(' EVENTS.CONNECT: $data');
      },
    );
    pushSocket.on(
      EVENTS.CHAT_RECEIVED_MESSAGE,
      (data) {
        print(' EVENTS.CHAT_RECEIVED_MESSAGE: $data');
      },
    );
    pushSocket.on(
      EVENTS.CHAT_GROUPS,
      (data) {
        print(' EVENTS.CHAT_GROUPS: $data');
      },
    );
    pushSocket.on(
      EVENTS.USER_FEEDS,
      (data) {
        print(' EVENTS.USER_FEEDS: $data');
      },
    );
    pushSocket.on(
      EVENTS.USER_SPAM_FEEDS,
      (data) {
        print(' EVENTS.USER_SPAM_FEEDS: $data');
      },
    );
    pushSocket.on(
      EVENTS.DISCONNECT,
      (data) {
        print(' EVENTS.DISCONNECT: $data');
      },
    );
  }
}

Resources

  • Website To checkout our Product.
  • Docs For comprehensive documentation.
  • Blog To learn more about our partners, new launches, etc.
  • Discord for support and discussions with the community and the team.
  • GitHub for source code, project board, issues, and pull requests.
  • Twitter for the latest updates on the product and published blogs.

Contributing

Push Protocol is an open source Project. We firmly believe in a completely transparent development process and value any contributions. We would love to have you as a member of the community, whether you are assisting us in bug fixes, suggesting new features, enhancing our documentation, or simply spreading the word.

  • Bug Report: Please create a bug report if you encounter any errors or problems while utilising the Push Protocol.
  • Feature Request: Please submit a feature request if you have an idea or discover a capability that would make development simpler and more reliable.
  • Documentation Request: If you're reading the Push documentation and believe that we're missing something, please create a docs request.

Read how you can contribute HERE

Not sure where to start? Join our discord and we will help you get started!

Discord

License

Check out our License HERE