Skip to content

Flutter SDK

The Flutter plugin plingbuddy registers your app's devices with PlingBuddy, keeps them in sync, and reports what happens to the service's notifications. The work is done by the PlingBuddy SDKs for iOS and Android; the plugin forwards each call to them.

  • On iOS it uses APNs directly, with no Firebase.
  • On Android it uses Firebase Cloud Messaging (FCM).

The SDK:

  • asks the user for notification permission. If the user turned notifications off for good, it offers to open the app's settings instead.
  • registers this install of the app with the service, and keeps its push token, permission, app and OS versions and data in sync. Every call returns once its change is saved on the device (see Concepts).
  • knows the app's signed-in user, and moves the device between users when they sign in and out.
  • shows the service's notifications on Android, where they arrive as data messages that Android doesn't show by itself. See Android setup.
  • ships a helper for an optional iOS Notification Service Extension. See iOS setup.
  • reports what happens to the service's notifications and to the device. See Events.

Supported platforms: iOS 15+ and Android 7.0 (API 24)+. On other platforms every call reports an unsupported_platform error (see Errors) and does nothing else.

Before you install it, create your app's application in the PlingBuddy dashboard and add its Apple and Firebase connections; Getting started walks through it.

Install

Neither the plugin nor the native SDKs are published yet, so the app builds them from a checkout of the plingbuddy-sdks repository. With the repository cloned at path/to/plingbuddy-sdks:

YAML
# pubspec.yaml
dependencies:
  plingbuddy:
    path: path/to/plingbuddy-sdks/flutter
Kotlin
// android/settings.gradle.kts, after include(":app")
includeBuild("path/to/plingbuddy-sdks/android")
Ruby (Podfile)
# ios/Podfile, inside target 'Runner'
pod 'PlingBuddySDK', :path => 'path/to/plingbuddy-sdks/ios'
pod 'PlingBuddyExtension', :path => 'path/to/plingbuddy-sdks/ios'

Paths in settings.gradle.kts are relative to android/, and in the Podfile to ios/. The iOS side is CocoaPods only for now; Swift Package Manager comes back once the SDKs are published.

Next steps

  1. iOS setup and Android setup: what each platform needs.
  2. Usage: starting the SDK and asking for permission.
  3. Users and data: signing users in and out, and the data you can send about them.
  4. Privacy: what the SDK collects, for your store listings.