Skip to content

5.0.0.1

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Nov 06:12
ac5f8c9

What's changed

Re-pins the façade onto the current generation of both native cores, and makes iOS
initialization wait for the SDK instead of a clock.

Native Binding package
iOS SFMCSDK 5.0.0 (was 4.0.1) SFMCSDK.Net.iOS 5.0.0.1 (was 4.0.1.2)
Android sfmcsdk 3.3.0 (was 3.1.1) SFMCSDK.Net.Android 3.3.0.1 (was 3.1.1.1)

Both stay pinned exactly. Target frameworks (net8.0, net9.0, net10.0, each with its
-android and -ios head) and the floors (iOS 12.2, Android API 26) are unchanged. The façade's
public API is unchanged: a reflection diff against 4.0.1.2 finds no member added or removed on any
target framework.

Breaking changes

  • This generation pairs with MobilePush 12. The iOS core enforces it: SFMCSdk.State on 5.0.0
    accepts the MobilePush module only in the 12.0.0 - 12.9.9 range, and native MobilePush 12.0.0
    in turn needs sfmcsdk 3.3.0 and SFMCSDK 5.0.0. An app that also references the MobilePush
    bindings directly stays on
    SFMCSDK.Net 4.0.1.2 until it
    moves to their 12.x packages. On iOS NuGet refuses the mix, because MarketingCloudSDK.Net.iOS
    11.0.2.x pins the core exactly; on Android it does not, because MarketingCloudSDK.Net.Android
    11.0.1.x only sets a minimum, so it would restore sfmcsdk 3.3.0 under MobilePush 11, a pairing
    nobody has run. Apps on the MarketingCloudSDK.Net
    umbrella are not affected: its current release, 11.0.2.3, pins this package at exactly 4.0.1.2.
  • On iOS, InitializeAsync now fails when the SDK does not initialize. It used to call
    initializeSdk without a completion, wait a fixed two seconds and report success whatever had
    happened. It now awaits the completion and throws TimeoutException after
    SfmcSdkOptions.InitializationTimeout (30 seconds by default) when none arrives. The case
    where none arrives is an app without keychain access, and in practice that is a simulator build
    with no entitlements; see the next section. Such an app used to see IsInitialized == true on
    an SDK that was not running.
  • Changes in the raw namespaces. The bindings underneath arrive with this package, so their own
    breaks reach code that uses SFMCSDK or Com.Salesforce.Marketingcloud.Sfmcsdk directly. On iOS:
    SFMCSdkEventCategory.FlushEvents is 7 (was 6), ISFMCSdkInAppMessageDetails has two more
    required members, four enums gained cases, and 26 parameterless constructors that could only abort
    the process are removed. On Android: IImageCacheApi gained Evict, which matters only to code
    that implements it. The platform release notes linked above have the details. Code that goes
    through the façade alone needs no change.

Fixed

  • iOS initialization waits for the SDK. InitializeAsync used to report success after two
    seconds without asking the SDK, on the belief that with no modules configured initializeSdk's
    completion never fires. That belief was wrong. The completion reports one status per configured
    module, so here it reports none, but it does fire: once, a few milliseconds after the call,
    measured on SFMCSDK 4.0.1 and 5.0.0. What had looked like an SDK quirk was the keychain. The SDK
    keeps its keys there and, refused it, neither initializes nor reports, and a simulator app
    without entitlements is refused (errSecMissingEntitlement, -34018). The .NET 8 and .NET 9 iOS
    workloads build simulator apps that way, while the .NET 10 workload embeds simulated entitlements,
    which is why the behaviour seemed to depend on the target framework. InitializeAsync on iOS now
    returns in milliseconds instead of two seconds, IsInitialized means the SDK reported, and the
    timeout message names the keychain. A device build is signed with a provisioning profile and has
    keychain access. For a simulator build, the
    README shows the one entitlement to add.
    The README, the XML documentation and the code comments no longer repeat the wrong explanation.
  • An InitializationTimeout longer than int.MaxValue milliseconds (about 24.8 days, so
    TimeSpan.MaxValue included) is refused with ArgumentOutOfRangeException before the one-shot
    initialization is claimed. The wait runs on a CancellationTokenSource timer, which cannot hold
    more. On Android such a value used to fail inside the platform call with the one initialization
    already spent; on iOS the timeout was ignored before, so such a value now throws there.
  • The sample app and the device tests carry that entitlement, for simulator runtime identifiers
    only. The iOS device tests check the keychain before anything else and record how long
    InitializeAsync took, and both heads now check IsInitialized before and after it. The sample
    also writes its log lines to stdout, so a run can be checked from logcat or the simulator console.

Build

  • The Android CI jobs (emulator checks, sample, Release link check) set up Temurin JDK 17
    themselves. ubuntu-latest is now Ubuntu 26.04, whose default JDK 25 no .NET for Android band
    accepts. The .NET 8 band then falls back to JDK 11, which cannot read the sfmcsdk .aar (Java 17
    bytecode) and fails with JAVAC0000 … wrong version 61.0, should be 55.0, as the same leg did in
    SFMCSDK.Net.Android. An app on net8.0-android34.0 can hit the same error; the README's
    Troubleshooting says how to build it with JDK 17.

Tested

Locally, with Xcode 26.0.1 and .NET 8.0.427, 9.0.320 and 10.0.403, against the packed package and
the two binding packages from nuget.org:

  • the unit tests on the neutral build and the package tests on the packed .nupkg (target
    frameworks, exact pins, licence, symbols);
  • the device checks on an iPhone 17 Pro simulator (iOS 26.5) on net8.0-ios18.0,
    net9.0-ios18.0 and net10.0-ios26.0: the keychain is usable, InitializeAsync completes in
    about 20 ms, IsInitialized follows it, the SDK reports 5.0.0, identity and tracking reach
    native code, and the one-shot guard holds;
  • the same build without the entitlement, as a negative control: the keychain answers -34018 and
    InitializeAsync throws TimeoutException naming the keychain, where 4.0.1.2 would have
    reported success;
  • the device checks on an Android 15 (API 35) emulator on net8.0-android34.0,
    net9.0-android35.0 and net10.0-android36.0: InitializeAsync completes in 120 to 190 ms,
    the state is READY and the SDK logs version 3.3.0;
  • the MAUI sample on both heads (net10.0-android36.0 on the emulator, net10.0-ios26.0 on the
    simulator): initialization, a profile id and custom events, with the app kept in use on Android
    for over a minute;
  • the simulator entitlement's scope: a simulator build without -r gets it, while a device
    publish without -r and an ios-arm64 build do not.

Not tested here: a real device, a MobilePush module of either generation loaded against this core,
and a tenant, since the device checks and the sample use no credentials by design.

Full changelog: v4.0.1.2...v5.0.0.1

Packages

Built against SFMCSDK.Net.iOS 5.0.0.1 and SFMCSDK.Net.Android 3.3.0.1 — SFMCSDK 5.0.0 on iOS and sfmcsdk 3.3.0 on Android.

The version names the iOS line, because Salesforce releases the two native
SDKs on separate cadences and they never share a version number. The fourth
component is this repository's own revision.

Package Target frameworks NuGet
SFMCSDK.Net net8.0, net8.0-android34.0, net8.0-ios18.0, net9.0, net9.0-android35.0, net9.0-ios18.0, net10.0, net10.0-android36.0, net10.0-ios26.0 5.0.0.1
dotnet add package SFMCSDK.Net --version 5.0.0.1

Licensing

The code in this repository is MIT, and that is the whole package. It depends
on SFMCSDK.Net.Android and SFMCSDK.Net.iOS, whose packages ship native SFMC
SDK artifacts built by Salesforce; each of those declares
MIT AND BSD-3-Clause and ships both texts under licenses/.