buzz_booster 0.0.2 buzz_booster: ^0.0.2 copied to clipboard
BuzzBooster SDK
BuzzBooster SDK #
BuzzBooster Flutter SDK
Getting Started #
Initialize #
Initialize BuzzBooster SDK in main method
import 'package:buzz_booster/buzz_booster.dart';
final buzzBooster = BuzzBooster();
void main() async {
runApp(const MyApp());
await buzzBooster.init("APP_KEY");
}
Set User Id #
Called when the user is logged in
await buzzBooster.setUserId("USER_ID");
Campaign Entry Point #
You can add subviews to serve as campaign entry points.
CampaignEntryView(
child: YOUR_WIDGET,
width: WIDGET_WIDTH,
height: WIDGET_HEIGHT,
entryName: "YOUR ENTRY POINT NAME",
)
//example
CampaignEntryView(
child: Text("Go to campaign"),
width: 100,
height: 40,
entryName: "Text",
)
Campaign Floating Action Button #
Campaign Floating Action Button is the entry point to the campaign page. Add Campaign Floating Action Button to Scaffold's floatingActionButton property
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: const Center(
child: CampaignEntryView(child: Text("asdf"), width: 100, height: 100, entryName: "flutter_text_entry",)
),
floatingActionButton: CampaignFloatingActionButton()),
);
}
Full source code #
import 'package:flutter/material.dart';
import 'package:buzz_booster/buzz_booster.dart';
import 'package:buzz_booster/buzz_booster_campaign_floating_action_button.dart';
import 'package:buzz_booster/buzz_booster_campaign_entry_view.dart';
...
final buzzBooster = BuzzBooster();
void main() async {
runApp(const MyApp());
await buzzBooster.init("APP_KEY");
await buzzBooster.setUserId("USER_ID");
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: const Center(
child: CampaignEntryView(child: Text("asdf"), width: 100, height: 100, entryName: "flutter_text_entry",)
),
floatingActionButton: CampaignFloatingActionButton()),
);
}
}