SFMCSDK.Net.Android 3.3.0.1-beta.13.14

This is a prerelease version of SFMCSDK.Net.Android.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SFMCSDK.Net.Android --version 3.3.0.1-beta.13.14
                    
NuGet\Install-Package SFMCSDK.Net.Android -Version 3.3.0.1-beta.13.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SFMCSDK.Net.Android" Version="3.3.0.1-beta.13.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SFMCSDK.Net.Android" Version="3.3.0.1-beta.13.14" />
                    
Directory.Packages.props
<PackageReference Include="SFMCSDK.Net.Android" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SFMCSDK.Net.Android --version 3.3.0.1-beta.13.14
                    
#r "nuget: SFMCSDK.Net.Android, 3.3.0.1-beta.13.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SFMCSDK.Net.Android@3.3.0.1-beta.13.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SFMCSDK.Net.Android&version=3.3.0.1-beta.13.14&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SFMCSDK.Net.Android&version=3.3.0.1-beta.13.14&prerelease
                    
Install as a Cake Tool

SFMCSDK.Net.Android

NuGet release Targets: net8.0 | net9.0 | net10.0 sfmcsdk 3.3.0 Licence: MIT AND BSD-3-Clause

.NET for Android bindings for the Salesforce Marketing Cloud SFMC SDK core module (com.salesforce.marketingcloud:sfmcsdk) — identity, event tracking, logging, and the module plumbing the MobilePush module plugs into.

dotnet add package SFMCSDK.Net.Android
using Com.Salesforce.Marketingcloud.Sfmcsdk;

var config = new SFMCSdkModuleConfig.Builder().Build();

// The Action overload is this package's addition - natively this takes a Kotlin Function1.
SFMCSdk.Configure(Android.App.Application.Context, config, status =>
    Console.WriteLine($"SFMC SDK initialization: {status}"));

SFMCSdk.RequestSdk(sdk =>
    sdk.Identity = sdk.Identity.NewBuilder().SetProfileId("contact-key").Build());

Push notifications live in the sibling MarketingCloudSDK.Net.Android, which depends on this package the same way the native MobilePush module depends on sfmcsdk. A cross-platform ergonomic layer lives in SFMCSDK.Net.


Contents

Packages

Package Wraps Depends on What it is for
SFMCSDK.Net.Android sfmcsdk 3.3.0 (+ common-internal 1.1.0, unbound) Xamarin.Kotlin.StdLib, AndroidX, Play services basement The SFMC SDK core: SFMCSdk.Configure, identity, custom events, logging

Versions are <sfmcsdk version>.<binding revision> — 3.3.0.1 is sfmcsdk 3.3.0, binding revision 1. The fourth component belongs to this repository and moves when the binding or packaging changes over an unchanged native SDK.

What is bound

The whole public surface of sfmcsdk, generated by class-parse with Java-package-derived namespaces (com.salesforce.marketingcloud.sfmcsdk → Com.Salesforce.Marketingcloud.Sfmcsdk), so a type's C# name can always be derived from its Kotlin one. On top of the generated tier, Additions/ supplies the pieces raw JNI makes painful:

Instead of Write
a Java.Lang.Object, IFunction1 subclass per callback SFMCSdk.Configure(context, config, status => …)
a Java.Lang.Object, ISFMCSdkReadyListener subclass SFMCSdk.RequestSdk(sdk => …)

common-internal ships inside this package as an unbound .aar — it is Salesforce-internal plumbing the SDK needs on the classpath, with no public API worth a projection. The deliberately-unbound roster, with reasons, lives in build/packages.tsv.

Installing

<PackageReference Include="SFMCSDK.Net.Android" Version="3.3.0.1" />

Target frameworks: net8.0-android34.0, net9.0-android35.0, net10.0-android36.0. The SFMC SDK's own floor is Android 8.0 (API 26).

net8 note. The AndroidX generation sfmcsdk 3.x depends on has partially dropped net8 assets; the net8 head pins Xamarin.AndroidX.Lifecycle.Process one minor below the .pom (2.9.4 vs 2.10.0), which is API-stable for what the SDK reaches. The net9/net10 heads carry the .pom-exact versions and are the ones Java dependency verification runs on.

Usage

Everything is the raw binding, in the same shapes Salesforce's Kotlin documentation uses. Initialize once, early — Application.OnCreate in a plain app, MauiProgram in MAUI:

SFMCSdk.SetLogging(LogLevel.Debug!, myListener);          // optional, before Configure
SFMCSdk.Configure(context, new SFMCSdkModuleConfig.Builder().Build(), status => { });

Identity (v3 is an immutable record — rebuild and assign):

SFMCSdk.RequestSdk(sdk =>
    sdk.Identity = sdk.Identity.NewBuilder()
        .SetProfileId("contact-key")
        .PutAttribute("tier", "gold")
        .Build());

Custom events:

var checkout = EventManager.CustomEvent(
    "checkout_completed",
    new Dictionary<string, Java.Lang.Object> { ["total"] = 42.50 });
SFMCSdk.Track(checkout);

Reach for the generated namespaces directly when you need something these snippets do not show — nothing is hidden.

How this repository works

Nothing native is committed. @(AndroidMavenLibrary) resolves sfmcsdk and common-internal straight from Salesforce's own Maven repository (salesforce-marketingcloud.github.io — the group is not on Maven Central), feeds the SDK's Java dependency verification, and every resolved byte is checked against the SHA-256 pins in build/maven-checksums.txt. The net8 head predates @(AndroidMavenLibrary) and takes a DownloadFile fallback with the same pins.

Each .NET SDK's Android workload builds two target frameworks, so build/BuildNugets.sh packs twice (net9 band, then net10 from a scratch global.json) and build/merge-packages.py grafts the net10 assets into one package.

Layout

Path What
src/Sfmc.Binding.props Everything the binding project(s) share: TFM bands, Maven resolution, checksum verification, packaging
src/SFMCSDK.Net.Android/ The binding: Transforms/, Additions/, consumer R8 rules under buildTransitive/
build/ Pack, checksum, R8-rule and upgrade scripts; packages.tsv is the package roster
tests/ PackageTests (nupkg shape, no workloads needed) and DeviceTests (a bare Activity driving the real SDK on an emulator)
samples/ A MAUI app driving initialization, identity and events
.github/workflows/ pr (beta to nuget.org), release (tag → nuget.org + GitHub release), auto-release (merged release note → tag), upstream-drift/upstream-watch

Building locally

./build/BuildNugets.sh                  # packs 3.3.0.1 into ./artifacts
dotnet test tests/SFMCSDK.Net.Android.PackageTests

The sample needs the .NET 10 SDK (MAUI 9 cannot build against this AndroidX generation):

cd "$(mktemp -d)" && dotnet new globaljson --sdk-version 10.0.100 --roll-forward latestFeature
dotnet build <repo>/samples/SFMCSDK.Net.Android.Example -c Debug

Tests

dotnet test tests/SFMCSDK.Net.Android.PackageTests    # nupkg layout, deps, checks the merge
./.github/scripts/run-emulator-tests.sh 3.3.0.1 net9.0-android35.0        # needs a running emulator
./.github/scripts/run-emulator-tests.sh 3.3.0.1 net9.0-android35.0 r8    # the shrunk leg

The device tests run without credentials on purpose: they prove the native classes are present, the JNI surface works and the Kotlin callback bridges fire — not that a tenant accepts the traffic.

Upgrading the SFMC SDK

./build/BumpNativeVersion.sh <sfmcsdk-version> [common-internal-version]

which pins, re-checksums, regenerates R8 rules, packs and tests — then review what it prints that it does not automate (checksum diff review, Transforms re-validation, README pins, release notes). Read the new .pom first: when it names a different common-internal, pass that version as the second argument. The two are a pair — sfmcsdk 3.3.0 calls classes that only common-internal 1.1.0 has. The upstream-watch workflow files an issue when Salesforce ships a version this repository does not bind.

Releasing

Merging a file named docs/release-notes/<four-part-version>.md to main is the release: auto-release tags it, release packs with verification off (the PR that merged it already verified), pushes to nuget.org via trusted publishing (OIDC — no stored API key) and creates the GitHub release with those notes. Every PR also publishes a -beta.<pr>.<run> prerelease of the full set.

Troubleshooting

ClassNotFoundException in Release builds only. Your app shrinks with R8 and something stripped the SDK. The package ships consumer keep-rules under buildTransitive/ that attach automatically; if you maintain your own -keep configuration make sure it does not override them.

XA4241: Java dependency ... is not satisfied. A .pom dependency has no NuGet binding in your app's graph. The package declares everything sfmcsdk 3.3.0 needs; if you see this after adding other Android bindings, your graph resolved an AndroidX version below the .pom's floor.

javac error JAVAC0000: class file has wrong version 61.0, should be 55.0 in a net8.0-android34.0 app. The sfmcsdk .aar is Java 17 bytecode and the build compiled against it with JDK 11, which .NET 8 for Android still accepts (the net9 and net10 workloads refuse anything older than 17). Build with JDK 17: pass -p:JavaSdkDirectory=<path to JDK 17> or set that property in the project. JAVA_HOME alone is not a guarantee: the build skips it when it names a JDK newer than the workload supports and falls back to another installed one.

Restore fails with NU1301 about a missing artifacts source. The repository's NuGet.config declares ./artifacts as a local feed for samples and device tests. Run ./build/BuildNugets.sh once, or build your own project outside this repository.

Licence

The binding code in this repository is MIT. The native SFMC SDK artifacts inside the package are © Salesforce, BSD-3-Clause. The package licence expression is MIT AND BSD-3-Clause and both texts ship in every package under licenses/.

Product Compatible and additional computed target framework versions.
.NET net8.0-android34.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SFMCSDK.Net.Android:

Package Downloads
MarketingCloudSDK.Net.Android

.NET for Android bindings for the Salesforce Marketing Cloud MobilePush module (com.salesforce.marketingcloud:marketingcloudsdk) - push registration, inbox, in-app messages, geofence and beacon messaging - plus the modular feature .aars of the Unified SDK architecture. Successor to the sfmc-net-bindings-mobile packages, at the v11 generation.

SFMCSDK.Net

One cross-platform API for the Salesforce Marketing Cloud SFMC SDK core: awaitable initialization, identity (contact key and attributes) and custom event tracking on Android and iOS from shared code, over the SFMCSDK.Net.Android and SFMCSDK.Net.iOS bindings. Restores on plain target frameworks too, so shared class libraries and unit tests need no platform conditionals.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.3.0.1 71 11/18/2026
3.3.0.1-beta.13.14 48 11/17/2026
3.1.1.1 609 7/30/2026
3.1.1.1-beta.10.12 71 10/30/2026
3.1.1.1-beta.9.11 65 10/30/2026
3.1.1.1-beta.6.10 84 8/3/2026
3.1.1.1-beta.6.9 86 8/3/2026
3.1.1.1-beta.5.7 93 7/30/2026
3.1.1.1-beta.5.6 83 7/30/2026
3.1.1.1-beta.4.8 85 7/30/2026
3.1.1.1-beta.4.5 93 7/30/2026
3.1.1.1-beta.2.4 79 7/30/2026
3.1.1.1-beta.1.3 84 7/30/2026
1.0.5.8 9,344 10/30/2024
1.0.5.6 250 10/7/2024
1.0.3.10 743 7/12/2024
1.0.3.4 197 7/12/2024
1.0.3.3 313 5/20/2024
1.0.3.2 218 5/17/2024
Loading failed

## What's changed

Moves the binding to the current Salesforce release. Nothing is removed and no existing
signature changes, so for an app that calls the SDK this is a version bump.

- Binds **sfmcsdk 3.3.0** (was 3.1.1) and ships **`common-internal` 1.1.0** (was 1.0.0)
 alongside it, both resolved from Salesforce's own Maven repository and SHA-256-pinned on every
 build. sfmcsdk 3.2.0 was never released as a package; its changes arrive with this one.
- Unchanged: the target frameworks (`net8.0-android34.0`, `net9.0-android35.0`,
 `net10.0-android36.0`), the Android 8.0 (API 26) floor, the permissions and components the
 `.aar` adds to your manifest, and every NuGet dependency version - the 3.3.0 `.pom` names the
 same Kotlin, AndroidX and Play services versions as 3.1.1.
- New API, all of it additive. Salesforce publishes no release notes for these versions, so the
 list comes from comparing the classes of the two `.aar` files:
 - the plug-in point for the new MobilePush inbox module -
   `SFMCSdkModuleConfig.InboxFeatureModuleConfig` and the matching `Builder` property, the
   abstract `Modules.Inboxfeature.InboxFeatureModuleConfig`, `ModuleIdentifier.InboxFeatureModule`,
   `Event.Producer.InboxFeatureModule`, `ModuleLogger.Inbox`, `SdkLogger.Inbox`, `InboxLogger`
   and `BuildConfig.InboxFeatureModuleApplicationId`;
 - `IImageCacheApi.Evict(ICollection<string>)`, from 3.2.0;
 - `IApplicationLifecycleStateProvider`, with `IsApplicationForegrounded`;
 - the constant `NetworkManager.Redacted`, from 3.2.0;
 - `SFMCSdk.SdkVersionName` and `BuildConfig.VersionName` now read `3.3.0`.
- The inbox itself is **not** in this package. It is the `inboxfeaturemodule` and
 `inboxmodelsmodule` artifacts, which belong to MobilePush and therefore to
 [MarketingCloudSDK.Net.Android](https://github.com/sbokatuk/MarketingCloudSDK.Net.Android);
 sfmcsdk only declares where they plug in.
- One source and binary break, and only for code that implements `IImageCacheApi` itself: the
 interface gained `Evict`, so such a class must add it and be recompiled. Code that calls the
 SDK is unaffected.
- `common-internal` 1.1.0 is a real requirement this time, not a formality: sfmcsdk 3.3.0 calls
 classes that 1.0.0 does not contain, and an app carrying the old one is killed at launch with
 `NoClassDefFoundError`. It still ships inside this package, so there is nothing to add - and,
 as before, no other package may ship it as well.
- Using MobilePush? The published MarketingCloudSDK.Net.Android 11.0.1.x packages were built
 and tested on sfmcsdk 3.1.1, and this release has not been tested beneath them. sfmcsdk 3.3.0
 is the core that the native marketingcloudsdk 12.0.0 requires; stay on 3.1.1.1 until you move
 to the MobilePush package for that line.
- Using the [SFMCSDK.Net](SFMCSDK.Net) umbrella? Its current
 release, 4.0.1.2, depends on SFMCSDK.Net.Android at exactly `[3.1.1.1]` on all three Android
 target frameworks, so an app that takes the core through the umbrella cannot move to this
 package until an umbrella release re-pins it.
- Verified on an Android 15 (API 35) emulator: the device checks on `net8.0-android34.0`,
 `net10.0-android36.0` and an R8-shrunk `net10.0-android36.0` build, and the MAUI sample
 through initialisation, setting a profile id and tracking a custom event. The device checks
 now also assert that the `.aar` inside the package is the version the binding was generated
 from, and that `common-internal` is new enough for it.