smartpush 0.0.3
smartpush: ^0.0.3 copied to clipboard
A Flutter Plugin to use Pluggable's SDK for AI optimized delivery of push notifications in Flutter.
Pluggable's Smartpush for Flutter apps #
A Flutter plugin for Flutter apps.
Usage #
The library exposes two methods which can be imported like this:
import 'package:smartpush/smartpush.dart';
pluggableExecute #
This method is used to execute the SDK AI models to deliver push notifications as soon as they are received in the app:
final _smartpushPlugin = Smartpush();
await _smartpushPlugin.pluggableExecute(notificationChannelId, notificationChannelName, notificationActivity, notificationData, notificationIcon);
pluggableStoreFeedback #
This method is used to obtain engagemente metrics (used as soon as a notification is opened):
final _smartpushPlugin = Smartpush();
await _smartpushPlugin.pluggableStoreFeedback();
subscribeToTopic #
You can also subscribe your customers to specific topics, as follows:
// Initializing Firebase.
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
await FirebaseMessaging.instance.subscribeToTopic('a_specific_topic');
getToken #
You can also get a specific token to identify each single device as follows:
// Initializing Firebase.
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
String? token = await FirebaseMessaging.instance.getToken();
print('Device token is as follows: $token');
// Save the initial token to the database
// ...
Getting Started #
For more info visit https://pluggableai.xyz/ or give us feedback to [email protected].