sfmc_mobileappmessaging 1.1.0 copy "sfmc_mobileappmessaging: ^1.1.0" to clipboard
sfmc_mobileappmessaging: ^1.1.0 copied to clipboard

Flutter bridge for Salesforce MobileAppMessaging SDK

SFMC MobileAppMessaging SDK #

Salesforce Marketing Cloud MobileAppMessaging SDK for Flutter — analytics and registration.

Installation #

flutter pub add sfmc_mobileappmessaging

iOS:

cd ios && pod install

Android: no additional steps — Gradle resolves the dependency automatically.

Required SDK configuration #

Usage #

import 'package:sfmc_mobileappmessaging/sfmc_mobileappmessaging.dart';

// Initialize the MobileAppMessaging module
await MobileAppMessaging.requestSdk();

// Device identity
final deviceId = await MobileAppMessaging.getDeviceId();

// Analytics
await MobileAppMessaging.enableAnalytics();
final enabled = await MobileAppMessaging.isAnalyticsEnabled();

// Registration callback
await MobileAppMessaging.setRegistrationCallback();
MobileAppMessaging.registrationEvents.listen((registration) {
  print('MAM registration changed: $registration');
});

// Cleanup
await MobileAppMessaging.unsetRegistrationCallback();

API #

Method Return Description
requestSdk() Future<void> Initialize the MobileAppMessaging SDK module
getDeviceId() Future<String?> Get device identifier
enableAnalytics() Future<void> Enable analytics
disableAnalytics() Future<void> Disable analytics
isAnalyticsEnabled() Future<bool> Check analytics state
setRegistrationCallback() Future<void> Start receiving registration change events
unsetRegistrationCallback() Future<void> Stop receiving registration change events

Streams #

Stream Type Description
registrationEvents Stream<Map<String, dynamic>> Emitted when registration state changes

Notes #

Installing this package auto-resolves the shared sfmc_core foundation package. sfmc_push and sfmc_iam are independent, opt-in feature packages — add them explicitly with flutter pub add sfmc_push / flutter pub add sfmc_iam if you need push or in-app messaging.

Versions #

  • Flutter: >=3.3.0
  • Dart SDK: >=3.0.6 <4.0.0
  • Android: mobileappmessagingsdk 1.1.+
  • iOS: SFMobileAppMessagingSDK ~> 2.0.0

License #

BSD 3-Clause.