All Projects → ninjasolutions → flutter_pusher

ninjasolutions / flutter_pusher

Licence: MIT license
An unofficial Pusher Channels library for Flutter

Programming Languages

java
68154 projects - #9 most used programming language
dart
5743 projects
swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to flutter pusher

Pusher Fake
A fake Pusher server for development and testing.
Stars: ✭ 148 (+640%)
Mutual labels:  pusher
coebot-www
A web interface for CoeBot, a Twitch chat bot
Stars: ✭ 12 (-40%)
Mutual labels:  pusher
pusher-for-codeigniter
CodeIgniter library for Pusher PHP SDK
Stars: ✭ 27 (+35%)
Mutual labels:  pusher
Laravel Realtime Example
Realtime 🍕 Pizza Order Tracker 🍕 - Laravel, Vue & Pusher
Stars: ✭ 165 (+725%)
Mutual labels:  pusher
Vue Echo
Vue integration for the Laravel Echo library.
Stars: ✭ 229 (+1045%)
Mutual labels:  pusher
food-delivery-ios-app
A food delivery application built using Swift for iOS. The application uses Pushers notifications feature to send push notifications to mobile devices.
Stars: ✭ 36 (+80%)
Mutual labels:  pusher
Hyperledger Typescript Boilerplate
This is a boilerplate that interacts between Hyperledger Fabric Peers and a front end.
Stars: ✭ 109 (+445%)
Mutual labels:  pusher
pusher
Pusher client library for Go
Stars: ✭ 15 (-25%)
Mutual labels:  pusher
Pusher Angular
Pusher Angular Library | [email protected]
Stars: ✭ 233 (+1065%)
Mutual labels:  pusher
project-manager-laravel
Project manager system - PHP and AngularJS
Stars: ✭ 17 (-15%)
Mutual labels:  pusher
Gateway
🚀构建分布式即时聊天、消息推送系统。 Building distributed instant messaging, push notification systems.
Stars: ✭ 188 (+840%)
Mutual labels:  pusher
Webhook.site
⚓️ Easily test HTTP webhooks with this handy tool that displays requests instantly.
Stars: ✭ 2,842 (+14110%)
Mutual labels:  pusher
devto-scheduler
Live appointment scheduling, created for dev.to contest. Video: https://youtu.be/LT6YtcJ6dZI
Stars: ✭ 32 (+60%)
Mutual labels:  pusher
Dashboard.spatie.be
The source code of dashboard.spatie.be
Stars: ✭ 1,916 (+9480%)
Mutual labels:  pusher
python-realtime-table
Building realtime table using Python and Channels
Stars: ✭ 12 (-40%)
Mutual labels:  pusher
Ember Socket Guru
Addon for easy integration with Pusher.js, ActionCable, Socket.io and Phoenix Channels
Stars: ✭ 119 (+495%)
Mutual labels:  pusher
octopub
Publish data easily, quickly and correctly
Stars: ✭ 41 (+105%)
Mutual labels:  pusher
akka-pusher
Pusher meets Akka
Stars: ✭ 18 (-10%)
Mutual labels:  pusher
chatkit-swift
Swift SDK for Pusher Chatkit
Stars: ✭ 40 (+100%)
Mutual labels:  pusher
chatkit-server-node
Node.js SDK for Pusher Chatkit
Stars: ✭ 16 (-20%)
Mutual labels:  pusher

Pusher Flutter Client

pub package

An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

How to install

  • Add to your pubspec.yaml
dependencies:
  flutter_pusher: ^1.0.2
  • In /ios/Podfile, set global platform to at least 9.0 platform :ios, '9.0'

For iOS Objective-C based Flutter apps

It is currently a bit difficult to get some Swift based Flutter plugins working in an Objective-C based Flutter app. See here for info and here for a way to fix.

This set of steps should work to fix this for your project.

  • Add use_frameworks! to the end of the Runner section in /ios/Podfile
  • Set Swift version in your iOS Runner project.
    • Open the project with Xcode.
    • In Runner, File -> New -> File -> Swift File. Name it anything.
    • Xcode will ask you if you wish to create Bridging Header, click yes.
    • Go to Runner Build Settings and set SWIFT_VERSION to either 4.2 or 5.0
    • Delete the Swift file created in step 2
    • Delete the Bridging Header created in step 3
  • flutter clean
  • In /ios pod install --repo-update

How to use

Pusher.init( ... )

Parameter Type Description
appKey String Required - The application key is a string which is globally unique to your application. It can be found in the API Access section of your application within the Channels user dashboard.
options PusherOptions Required - The options provided to pusher, more information in the PusherOptions section.
enableLogging bool Optional - Enabling this will activate the logging of important events to the console.

Pusher.connect( ... )

Parameter Type Description
onConnectionStateChange Function(ConnectionStateChange) Optional - Callback when the state of the connection changes (eg. CONNECTING, CONNECTED, DISCONNECTED, ... ).
onError Function(ConnectionError) Optional - Callback when the connection fires an error (eg. UnauthorizedException).

Pusher.subscribe( ... )

Parameter Type Description
channelName String Required - provide the channel name to subscribe to (eg. mychannel, private-mychannel or presence-mychannel).

PusherOptions

Parameter Type Description
auth PusherAuth Optional - A mechanism for authenticating a user's access to a channel at the point of subscription.
cluster String Optional - The identifier of the cluster your application was created in. When not supplied, will connect to the mt1(us-east-1) cluster.
host String Optional - Provide your own (websocket) host instead of the default ws.pusherapp.com
port int Optional - Provide your own (websocket) port instead of the default 443 (when encryption is enabled) or port 80 (when encryption is disabled).
encrypted bool Optional - Tell pusher to only connect over TLS connections to ensure connection traffic is encrypted. This means using wss:// instead of ws://, encryption is enabled by default.
activityTimeout int Optional - After this time (in milliseconds) without any messages received from the server, a ping message will be sent to check if the connection is still working. Default value is supplied by the server, low values will result in unnecessary traffic. The default is set to 30000.

PusherAuth

Parameter Type Description
endpoint String Required - The endpoint pusher should query to make the post request (eg. https://api.example.com/broadcating/auth).
headers Map<String,String> Optional - The headers that should be sent with the POST request to the above endpoint. 2 Different Content-Types are supported: application/x-www-form-urlencoded & application/json. Supplying any of the above types will result into the request body being sent in form-urlencoded format or JSON format. Defaults to {'Content-Type': 'application/x-www-form-urlencoded'}

Development

Generate the models and the factories: flutter packages pub run build_runner build --delete-conflicting-outputs

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].