Skip to main content

beeappie_flutter 1.0.0 copy "beeappie_flutter: ^1.0.0" to clipboard
beeappie_flutter: ^1.0.0 copied to clipboard

Users, analytics, crash reports, leaderboards, polls, announcements, feedback, support chat and push for Flutter apps, without a backend.

BeeAppie for Flutter #

Users, sign-in, analytics, sessions, crash reports, leaderboards, polls, announcements, feedback, real-time support chat, push notifications and ready-made screens for Flutter apps on iOS and Android, without a backend of your own. The plugin runs on BeeAppie's native SDKs: crashes of the app's native code, sessions, the offline queue and the screens are theirs.

iOS 15 and Android 8 (API 26) and later. On iOS the plugin uses Swift Package Manager (on by default in current Flutter), not CocoaPods: if your project turned it off, the build says the plugin is "only compatible with Swift Package Manager"; turn it on with flutter config --enable-swift-package-manager.

Setup #

dependencies:
  beeappie_flutter: ^1.0.0

On Android, set minSdk = 26 in android/app/build.gradle.kts (new Flutter apps start at 24, and the build stops with "requires a higher Android SDK version" until you do).

If your android/settings.gradle.kts sets RepositoriesMode.FAIL_ON_PROJECT_REPOS or PREFER_SETTINGS, add BeeAppie's Maven repository there, under dependencyResolutionManagement › repositories:

maven("https://maven.beeappie.com") { content { includeGroup("com.beeappie") } }
import 'package:beeappie_flutter/beeappie_flutter.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  BeeAppie.start('your-app-key');
  runApp(const ShopApp());
}

That is all: BeeAppie restores this device's user (or creates one), opens and closes sessions as the app goes to the foreground and background, and captures crashes: native ones, and Dart errors nobody caught (with their Dart stack; any FlutterError.onError or PlatformDispatcher.onError you set keeps working).

Privacy #

Nothing is collected until the user agrees. Ask with the ready-made screen, once your first screen shows (it asks only if the user has never answered):

@override
void initState() {
  super.initState();
  BeeAppie.showConsentIfNeeded();
}

Or set the choice from your own privacy screen:

await BeeAppie.setConsent(Consent.all);

No user is created when the app starts: remote config, news and polls work with the app key alone, and a user appears when someone allows something (as above) or first uses a feature that needs one (chat, feedback, a vote, a score, signing in). "No thanks" before then stays on the device. Call await BeeAppie.ensureUser() if the app needs the user's id earlier.

BeeAppie.deleteUser() permanently erases the user and all their data; BeeAppie.exportUserData() saves a ZIP of it.

Analytics and errors #

BeeAppie.trackEvent('level_completed', properties: {'level': '3'});
BeeAppie.reportError(error, stackTrace);
BeeAppie.addBreadcrumb('Sync started');
BeeAppie.screen('Cart'); // e.g. from a NavigatorObserver, for the activity trail

Errors are grouped by the first function of your own code in their Dart stack. Each report also carries the device's state when it happened (build number from your pubspec.yaml's +N, how long the app had run, memory, storage, screen, where the app was installed from), read by the native SDK.

Release builds #

Dart errors arrive with their Dart stack, so a release build reads as it is, unless it was built with --obfuscate: then Dart names stay hidden, so leave it off to read them. Crashes of the native side (Kotlin, Swift, and C or C++ libraries) need each release's mapping and symbols, as for a native app: add the BeeAppie Gradle plugin to android/app/build.gradle(.kts) and the dSYM upload script to the iOS app's build phases, as in the Android and iOS SDKs' "Release builds" sections. Both use the app's upload key (bu_…, dashboard → Crash reports → Readable crashes) from the BEEAPPIE_UPLOAD_KEY environment variable, or add a line <bundle id> = bu_… to ~/.beeappie/upload-keys in your home folder, which every BeeAppie build tool reads (also Xcode opened from the Dock, which never sees ~/.zshrc); never from the project, where it would end up in git. Uploads come with paid plans; a missing key or a failed upload only warns.

Users and sign-in #

final result = await BeeAppie.signIn(idToken); // Sign in with Apple, Google, Firebase, any OpenID Connect issuer…
await BeeAppie.signOut();                      // the device continues with a new anonymous user
await BeeAppie.setUserProperties({'plan': 'gold', 'birth_year': 1990}); // to target announcements and pushes
BeeAppie.onUserChanged = (user) => reload();
BeeAppie.onSuspended = (s) => showSuspended(s.until, s.reason); // suspended from the dashboard: nothing works until it ends

Ready-made screens #

BeeAppie.openScreen(BeeAppieScreen.support);  // also feedback, rankings, polls, communications, profile
BeeAppie.openConversation(conversationId);
BeeAppie.openCommunication(communicationId);  // one announcement; openPoll(pollId) one poll
await BeeAppie.showMaintenanceIfNeeded();     // the maintenance message under App status
await BeeAppie.showUpdatePromptIfNeeded();    // what you chose under App status › Versions

They are the native SDKs' screens (SwiftUI on iOS, Jetpack Compose on Android), in the device language, over your app.

showUpdatePromptIfNeeded() shows a screen with no way back until the user updates (require), or a prompt they can dismiss, asked again after the chosen time (recommend). Pass allowBlocking: false if the app must never be blocked. showMaintenanceIfNeeded() blocks the app with your maintenance message, and a Try again button, until you clear it; allowBlocking: false shows it in a dialog instead.

Feature surveys #

One question about a feature, set up under Surveys in the dashboard and shown by its key, drawn by the native views:

const BeeAppieSurveyView(surveyKey: 'flow-value'),                          // inline in your layout
final result = await BeeAppie.showSurvey('flow-value', position: SurveyPosition.bottom);  // a card over the screen

When there is nothing to ask (not live, not for this platform or version, answered already, asked lately, offline before surveys were fetched, a plan without surveys) the inline survey takes no space and the card returns "not shown", never an error. Each install is asked once (or again on a new version or after some days, as set in the dashboard), and at most one survey every few days across all of them; the close button counts as asked. Answers are anonymous unless a user already exists; a low answer with a comment also arrives under Feedback, so you can reply. Feature surveys are included in paid plans.

Promos of your other apps #

Once a promo is approved for one of your apps (dashboard › App › Promos), your other apps can show it:

const BeeAppiePromoBanner(),                         // full width, 50–90 high, e.g. in Scaffold.bottomNavigationBar
BeeAppiePromoCard(onNoPromo: () {}),                 // 300×250
await BeeAppie.showFullscreenPromo();                // e.g. between levels; false when there was nothing to show

They are BeeAppie's native views (Jetpack Compose on Android, SwiftUI on iOS): they load, rotate (every minute, while on screen) and count views and taps on their own. A view counts when at least half of the promo is on screen for a second with the app in the foreground, and a tap opens the app's store listing. When there is nothing to show (no other app to promote, promos turned off, an app made for kids, offline before the first promos) they take no space and call onNoPromo, never an error. The same app shows at most 3 times per app run; a fullscreen at most once every few minutes (set in the dashboard), never on the app's first launch. Tapping the "Also by us" label lets users report a promo.

Use your bak_test_… key in debug builds: its promos are marked "Test", as test ads are, and their views, taps and reports don't count. On an emulator or simulator that holds for the live key too.

Promos need no user or consent: they send no user, device or advertising id, only a random key for the app run, kept in memory.

Anonymous counts: if you chose to count active and new installs for the app (a Yes or No when you add it in the dashboard, later in its settings), each open is counted with no id, for everyone, whatever the user chose on the consent screen. The device keeps only the day it was last counted and the week it was installed. The ready-made profile screen has a "Count my visits anonymously" switch; from your own, call await BeeAppie.setAnonymousCountingEnabled(false).

Everything else #

BeeAppie.client is the full API client:

final entry = await BeeAppie.client.submitScore('high-score', 1200);
final top = await BeeAppie.client.getTopEntries('high-score', top: 10);
final polls = await BeeAppie.client.getPolls();
final news = await BeeAppie.client.getCommunications();
final conversation = await BeeAppie.client.submitFeedback(FeedbackCategory.idea, 'Dark mode please');
await BeeAppie.client.sendMessage(conversation.id, text: 'Thanks!');

API errors are BeeAppieApiExceptions: branch on code (ErrorCodes).

Achievements #

Create them in the dashboard (App › Achievements) with a key, a goal (1 for a one-off), an icon and, if you like, other languages. Each call applies at once to a copy on the device and is sent later in a batch with the time it happened, so it works offline and never throws; sending creates the user, as other features do. The native screens show "Achievement unlocked" at the top by themselves (BeeAppie.achievements.celebrate(false) to turn it off), and the achievements screen reads the copy, so it works offline too.

await BeeAppie.achievements.unlock('first-entry');
await BeeAppie.achievements.increment('days-written');               // +1; reaching the goal unlocks it
await BeeAppie.achievements.setProgress('longest-streak', 12);       // never goes down
await BeeAppie.achievements.unlock('first-entry', at: earnedAt);     // a badge earned before BeeAppie: the earlier date wins

final done = await BeeAppie.achievements.isUnlocked('first-entry');  // from the copy on the device
final all = await BeeAppie.achievements.current();
BeeAppie.achievements.onUnlocked = (achievement) => showMyPopup(achievement);

With Send achievements only with consent on in the app's settings, nothing leaves the device (and no user is made for achievements) until the user allows usage statistics; the page, progress and message still work. BeeAppie.client.unlockAchievement and the other raw calls stay for when you need BeeAppie's answer.

Scores, feedback and news offline #

Scores, feedback and announcement views, taps and confirmations are kept on the device and sent once BeeAppie can be reached, so they work offline and never throw. A score counts in the season it was made in if it arrives within 7 days. Leaderboards and the first 50 announcements are kept for offline reading. News, polls and push notifications come in the device's language when your team added it in the dashboard (otherwise in the app's main language): the SDK sends the language for you.

Seasons: a leaderboard with repeating seasons keeps past ones to look back at, in the ready-made leaderboard screen (a row of choices) and through leaderboards.seasons('daily'): newest first, kept for offline, each with name, your team's name for it from the dashboard ("Yesterday", "Round 12") in the player's language, or none (then use your own words). Load one with its key as the season, or open the screen at it: BeeAppie.openLeaderboard('daily', season: key). leaderboards.list() reads the app's leaderboards, also offline.

Times and "lower is better": a leaderboard can rank the lowest score first (races, moves) and show scores as times, both set in the dashboard. For a time, submit milliseconds; entries carry scoreText ("1:23.45") to show as it is, ScoreFormats.format formats one you hold, and the player's best (also the one waiting offline) follows the leaderboard's order.

await BeeAppie.leaderboards.submitScore('high-score', 1250);        // with its time; sent now or later
final board = await BeeAppie.leaderboards.load('high-score');      // offline: the last copy (isUpToDate false), pendingBest
final sent = await BeeAppie.feedback.send(FeedbackCategory.problem, 'Sync fails', rating: 2); // false: waits on the device
final news = await BeeAppie.loadCommunications();                  // news.items; offline: the last copy
await BeeAppie.markCommunicationAcknowledged(news.items.first.id); // also offline

The native SDKs keep and send them; the ready-made screens use them too. client.submitScore and client.submitFeedback stay for when you need BeeAppie's answer at once.

Entitlements #

Access your team grants in the dashboard (a user's page, a conversation) or from your server, e.g. pro for someone who bought your app on another platform. They add to your store purchases and never replace them: revoking one in BeeAppie never touches a purchase, so never lock a user out because BeeAppie does not list an entitlement.

var isPro = ownsInStore('pro') || await BeeAppie.hasEntitlement('pro'); // kept on the device, works offline
BeeAppie.onEntitlementsChanged = (e) => isPro = ownsInStore('pro') || e.has('pro');
await BeeAppie.refreshEntitlements(); // e.g. on "Restore purchases"; fetched at start and back in the foreground anyway

User data #

Small JSON objects your app stores for each signed-in user (settings, favourites, progress, save slots), the same on all their devices and back after a reinstall. Turn on User data in the app's settings in the dashboard (paid plans). Reads come from the copy on the device, so they work offline; writes apply at once and are sent when BeeAppie can be reached (last write wins). Writes made before the user signs in wait and are sent once they do.

It is encrypted in transit and at rest, but not end-to-end: BeeAppie's servers can read it, and it is included in your app's data export. Your team's dashboard shows how much each user stores, not what. Don't store passwords, keys, health or financial data there; if you must, encrypt it in your app before saving.

final data = BeeAppie.userData;
await data.put('settings', 'main', {'theme': 'dark', 'size': 14});
final settings = await data.get('settings', 'main'); // a Map, or null
final saves = await data.list('saves');             // every item of a collection, by key
await data.delete('saves', 'slot-3');
data.onChanged = () => reload();                    // another device changed something
data.onWriteRefused = (r) => debugPrint(r.error);   // e.g. item_too_large, user_storage_full

Remote content #

Lists your team writes in the dashboard under Remote content (quotes, tips, levels, word lists), imported from a spreadsheet or edited item by item, then published without a new release. Each item is any JSON under a stable key; your app decides what the fields mean (the collection's Code tab writes the model). Nothing downloads until the app asks; after the first time only what changed is sent, and a copy stays on the device for offline. It needs no user and no consent. Anyone with your app can read it: never put passwords, keys or private data in it.

final content = await BeeAppie.content.get('affirmations', Affirmation.fromJson); // timeout: is optional
for (final item in content.items) {
  show(item.value.text);                                                          // key and value
}
if (content.items.isEmpty && !content.isUpToDate) { /* first launch offline: your built-in copy */ }
final tips = await BeeAppie.content.getValues<String>('tips');                   // items that are plain values
final cached = await BeeAppie.content.cached('affirmations', Affirmation.fromJson); // the device copy, no request

get reads items that are JSON objects with your fromJson(Map<String, dynamic>); getValues<T> keeps the items that are a T (getValues<Object?> for the raw JSON). A call within 5 minutes of the last one for the same collection answers from the device without a request (forceRefresh checks anyway); with a timeout you get the device copy when it runs out, while the download finishes in the background. It never throws: offline, a collection that isn't published, or the month's downloads used up give the copy on the device (empty the first time) with isUpToDate false. An item that doesn't fit your type is skipped and logged. Items have no order: sort them in the app. For the very first launch offline, ship a copy from Export in your app.

Release on a date (a daily puzzle, a word of the day): give an item an Available from time in the dashboard, or _availableFrom when importing, and publish it ahead. Until then BeeAppie doesn't send the item or its key, whatever the device's clock says; at its time it arrives as a change. content.nextAt (a DateTime) says when the next one is due (null when nothing is scheduled; never what it is), and once it has passed the 5-minute check no longer holds a call back. For example if (content.nextAt != null) showCountdown(content.nextAt!);. Once released, everything in a collection is readable by anyone with your app, as before.

Real-time support chat #

final chat = await BeeAppie.chat();
await chat.joinConversation(conversation.id);
chat.events.listen((event) {
  switch (event) {
    case ChatMessage(:final message): setState(() => messages.add(message));
    case ChatTyping(:final fromTeam, :final isTyping): setState(() => teamTyping = fromTeam && isTyping);
    case ChatConnectionChanged(connected: true): reload(); // messages are not replayed after a drop
    default:
  }
});

TypingSender(chat, conversation.id) sends typing indicators at a sensible rate: call textChanged from the message box's onChanged.

Users can say no to conversations started by your team (the ready-made Profile and privacy screen has the switch):

await BeeAppie.setTeamChatsAllowed(false);     // or true; BeeAppie.teamChatsAllowed() reads it

Your team can't start a conversation with them then; they can still start one, and get your replies.

Push notifications #

BeeAppie sends through your Firebase (Android) and APNs (iOS) keys, uploaded in the dashboard. Get the device's token with your push plugin (e.g. firebase_messaging) and give it to BeeAppie:

final token = Platform.isIOS ? await FirebaseMessaging.instance.getAPNSToken() : await FirebaseMessaging.instance.getToken();
if (token != null) await BeeAppie.setPushToken(token);
FirebaseMessaging.onMessageOpenedApp.listen((message) => BeeAppie.handlePushOpened(message.data));
// A support reply, or the screen chosen in the dashboard ("When tapped, open"):
BeeAppie.onPushOpened = (push) => BeeAppie.openPush(push);

Replies in support conversations and announcements marked "also send as a push notification" are pushed automatically.

Users can turn BeeAppie's notifications off in the app and on again later; the ready-made Profile and privacy screen has the switch. For your own settings page:

final on = await BeeAppie.pushNotificationsAllowed();  // turned on in the app, and not blocked in the phone's settings
await BeeAppie.setPushNotificationsEnabled(false);     // or true; returns pushNotificationsAllowed()
if (await BeeAppie.pushPermission() == PushPermission.denied) await BeeAppie.openNotificationSettings();

The choice is saved on the device and on the server, and the token is kept, so turning them on again works at once (ask for the permission with your push plugin first if needed). BeeAppie reads the permission whenever the app comes back to the foreground, and sends nothing to a device turned off in the app or blocked in the settings.

Example #

example/ is a sample app with a page per feature. It asks for your app's test key when it first opens (dashboard: your app's settings › Setup › App keys), or build it in: flutter run --dart-define=APP_KEY=bak_test_…. --dart-define=SELF_TEST=true runs every call at launch. "Add the sample's content to Test" on the same dashboard page gives it a leaderboard, achievements and remote config to show.

0
likes
150
points
--
downloads

Documentation

Documentation
API reference

Publisher

verified publisherbeeappie.com

Users, analytics, crash reports, leaderboards, polls, announcements, feedback, support chat and push for Flutter apps, without a backend.

Homepage

Topics

#analytics #crash-reporting #leaderboards #push-notifications #chat

License

unknown (license)

Dependencies

flutter

More

Packages that depend on beeappie_flutter

Packages that implement beeappie_flutter