laravel_flutter_pusher

Last updated:

0 purchases

laravel_flutter_pusher Image
laravel_flutter_pusher Images
Add to Cart

Description:

laravel flutter pusher

Laravel Flutter Pusher #

An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS.
This is a continued plugin for Flutter Pusher Client
This package lets you consume events from a Pusher server. In order to use this library, you need to have a free account on https://pusher.com. After registering, you will need the application credentials for your app.
NOTE This package requires json_annotation : ^4.0.0
How to install #

Add to your pubspec.yaml

dependencies:
laravel_flutter_pusher: ^0.0.4
copied to clipboard

Getting Started #
import 'package:laravel_flutter_pusher/laravel_flutter_pusher.dart';

void main() {

var options = PusherOptions(
host: '10.0.2.2',
port: 6001,
encrypted: false,
cluster: 'eu'
);

LaravelFlutterPusher pusher = LaravelFlutterPusher('app_key', options, enableLogging: true);
pusher
.subscribe('channel')
.bind('event', (event) => log('event =>' + event.toString()));
}
copied to clipboard
Lazy Connect #
Connection to the server can be delayed, so set the lazyConnect prop on the client constructor.
R8/Proguard code obfuscation
If you have enabled code obfuscation with R8 or proguard, you need to add the following rule.
android/app/build.gradle:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
copied to clipboard
android/app/proguard-rules.pro:
-keep class com.github.olubunmitosin.laravel_flutter_pusher.** { *; }
copied to clipboard
Development #
Generate the models and the factories: flutter packages pub run build_runner build --delete-conflicting-outputs

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.