Repository navigation
What's changed
Binds SFMCSDK 5.0.0 (was 4.0.1), a major release of the native core. It brings the Inbox
feature and pairs with MobilePush 12. Target frameworks (net8.0-ios18.0, net9.0-ios18.0,
net10.0-ios26.0) and the iOS floor (12.2) are unchanged. No .NET member was renamed, and the
only members removed are 26 parameterless constructors that could not be called without
aborting the process.
Salesforce published no release notes for 5.0.0, and its v4 and v5 tags share no git history, so
everything below comes from the shipped framework: the SFMCSDK-Swift.h diff, ported by hand
and checked selector by selector in both directions, the framework's Info.plist and linked
libraries, and what the SDK does on a simulator.
Breaking changes
-
Needs MobilePush 12. The core accepts only the module generation it shipped with:
SFMCSdk.Stateon 5.0.0 gives12.0.0 - 12.9.9as the range for the engagement (MobilePush)
module, where 4.0.1 gave11.0.0 - 11.9.9. Native MobilePush 12.0.0 in turn requires
SFMCSDK 5.0.0 or newer. Use this package with
MarketingCloudSDK.Net.iOS 12.x, and
stay on 4.0.1.2 while you
are on MobilePush 11. The other ranges moved too: push feature 3.x (was 2.x), in-app messaging
feature 2.x (was 1.x), mobile app messaging 3.x (was 2.x); the new inbox feature is 1.x. -
SFMCSdkEventCategory.FlushEventsis 7, not 6. The newInboxFeaturecase took 6. Code
compiled against 4.0.1.x has the old constant baked in, so recompile; and don't compare the
category against a number you stored earlier. -
ISFMCSdkInAppMessageDetailshas two more required members,MinTimeBetweenDisplayand
CustomKeys. Reading them from the messages the SDK hands you needs no change. A class of
your own that implements the interface, or derives fromSFMCSdkInAppMessageDetails, has to
add them. -
Four enums gained cases, so a
switchthat lists every case needs a new arm:
SFMCSdkModuleName.InboxFeature,SFMCSdkMessageProducer.InboxFeature,
SFMCSdkEventCategory.InboxFeatureandSFMCSdkBehaviorType.AppWillResignActive. -
26 parameterless constructors are removed. The native header marks
initandnew
unavailable onSFMCSdkBehaviorandSFMCSdkEngagementEvent, none of the classes below
declares aninitof its own, and the-initthey inherit ends in
swift_stdlib_reportUnimplementedInitializer, which aborts the process. That is true of 4.0.1
as well as 5.0.0. The binding generated a publicnew X ()for each anyway, and calling it
could only crash. Code that called one now fails to compile instead of at run time; code that
runs today is not affected.- The 17 cart, order and catalog object events keep their real constructor, the one the
native class declares, which was bound all along:
new SFMCSdkAddToCartEvent (lineItem)andnew SFMCSdkRemoveFromCartEvent (lineItem);
new SFMCSdkReplaceCartEvent (lineItems);
new SFMCSdkPurchaseOrderEvent (order)and likewiseSFMCSdkPreorderEvent,
SFMCSdkCancelOrderEvent,SFMCSdkShipOrderEvent,SFMCSdkDeliverOrderEvent,
SFMCSdkReturnOrderEventandSFMCSdkExchangeOrderEvent;
new SFMCSdkViewCatalogObjectEvent (catalogObject)and likewise
SFMCSdkViewCatalogObjectDetailEvent,SFMCSdkQuickViewCatalogObjectEvent,
SFMCSdkFavoriteCatalogObjectEvent,SFMCSdkShareCatalogObjectEvent,
SFMCSdkReviewCatalogObjectEventandSFMCSdkCommentCatalogObjectEvent. - Their three base classes,
SFMCSdkCartEvent,SFMCSdkOrderEventand
SFMCSdkCatalogObjectEvent, declare no initializer at all: build one of the events above. - Six behaviours,
SFMCSdkAppBackgrounded,SFMCSdkAppBecameActive,
SFMCSdkAppForegrounded,SFMCSdkAppTerminated,SFMCSdkAppVersionChangedand
SFMCSdkScreenEntry, are created by the SDK for its own behaviour observers. The native
Objective-C surface has no call that registers an observer, so .NET code neither constructs
nor receives them today. There is nothing to construct, and there never was.
A class of your own that derives from one of the events has to call the real base
constructor, for example: base (lineItem). - The 17 cart, order and catalog object events keep their real constructor, the one the
Apps that take the core through the SFMCSDK.Net
umbrella cannot move to this package until the umbrella re-pins, because the published
SFMCSDK.Net 4.0.1.2 depends on SFMCSDK.Net.iOS at exactly [4.0.1.2].
New API
- Inbox.
SFMCSdkConfigBuilder.SetInboxFeature; the message model as protocols
(ISFMCSdkInboxMessage,ISFMCSdkInboxText,ISFMCSdkInboxMedia,ISFMCSdkInboxButton,
ISFMCSdkInboxAction);SFMCSdkInboxMessageInteraction; the string constants in
SFMCSdkInboxActionType,SFMCSdkInboxAudienceTypeandSFMCSdkInboxMediaType; the event
classes underSFMCSdkInboxEventandSFMCSdkInboxPrivacyStatusChangeEvent; and
InboxFeatureProtocolfor module authors. The Inbox feature itself is a separate native
module (InboxFeatureSDK) with no .NET binding yet; this package carries the models and
events the core shares with it. SFMCSdk.GetStatus (SFMCSdkModuleName)returns one module's status at any time.SFMCSdkURLTypenames thetypestrings passed toISFMCSdkURLHandlingDelegate.HandleURL.SFMCSdkBadgeAggregator,SFMCSdkAppWillResignActive, andSFMCSdk.SetHostRuntime, which
upstream reserves for its own hybrid wrappers.SFMCSdkInAppMessageCloseActioncan now be constructed and read (DismissReason,Id);
SFMCSdkPrivacyStatusChangeEventexposesIsBlockedandShouldDeleteData;
SFMCSdkInAppPrivacyStatusChangeEventexposesSource.- New enums:
SFMCSdkAppState,SFMCSdkBadgeChannel,SFMCInboxAnalyticsType,
SFMCSdkInboxMessageType,SFMCSdkInboxInteractionType,SFMCSdkInboxDataFailedReason,
SFMCSdkInboxDataRequestTrigger,SFMCWrapperName.
Behaviour, measured
InitializeSdk's completion fires with zero modules. It is called once per call to
InitializeSdk, a few milliseconds after that call returns, on a background thread, with an
empty array. The same app, built against the published 4.0.1.2, shows that 4.0.1 does the
same. The README and the device tests used to say the block never fires in this case. That
was wrong, and so was putting it down to the SDK: see the next point.- Without keychain access the SDK does not initialize, and says nothing. No completion
block, no identity edits, whileSFMCSdk.Statestill answers. On a simulator, an app with no
entitlements is refused the keychain (errSecMissingEntitlement, -34018), and the .NET 8 and
.NET 9 iOS workloads build simulator apps that way; the .NET 10 workload embeds simulated
entitlements by itself. So the same code initialized onnet10.0-ios26.0and silently did not
onnet8.0-ios18.0andnet9.0-ios18.0. Give a simulator build anEntitlements.plistwith
akeychain-access-groupsentry; the
README has the details and the
sample
shows it. A device build is signed with a provisioning profile and is not affected. This is
not new in 5.0.0, only newly understood. - On an initialized SDK,
SFMCSdk.Identity.Editruns its updater before it returns.
Native framework
- Slices are unchanged (
ios-arm64,ios-arm64_x86_64-simulator), and so is the minimum iOS
version (12.0 in the framework; this package keeps its 12.2 floor). - Built by Salesforce against the iOS 26.5 SDK with Swift 6.3.3 (4.0.1: iOS 26.2 SDK, Swift
6.2.3). The binary now also weak-linkslibswiftSpatialandlibswiftsimd; both come from
the system and need nothing from an app. The frameworks it links are the same.
Tested
On an iPhone 17 Pro simulator (iOS 26.5), with Xcode 26.0.1:
- the package tests, on the packed
.nupkg; - the simulator smoke tests on
net8.0-ios18.0,net9.0-ios18.0andnet10.0-ios26.0: the SDK
reports 5.0.0, the keychain is usable, initialization completes with no module statuses, every
module reports inactive,Identity.Editruns its updater, a nativeFlushEventand a native
Inbox event report categories 7 and 6, the new Inbox, privacy and close-action objects are
built and read back, and each of the 17 cart, order and catalog object events is built through
its constructor and read back; - the sample app on
net10.0-ios26.0andnet9.0-ios18.0: initialization, a profile id, a
custom event.
Not tested here: a real device; MobilePush 11 or 12 loaded against this core (the pairing above
is read from SFMCSdk.State and from upstream's Package.swift, not from a run); and the Inbox
feature with its own module and a tenant.
Full changelog: v4.0.1.2...v5.0.0.1
Packages
Bound against sfmc-sdk-ios 5.0.0, targeting net8.0-ios18.0, net9.0-ios18.0 and net10.0-ios26.0.
The first three components of
5.0.0.1are the sfmc-sdk-ios version; the fourth is this
repository's binding revision, which advances when the bindings or packaging change while
the native binaries stay put.
| Package | Wraps | NuGet |
|---|---|---|
SFMCSDK.Net.iOS |
SFMCSDK |
5.0.0.1 |
dotnet add package SFMCSDK.Net.iOS --version 5.0.0.1
Licensing
The binding code is MIT; the bundled native binaries are BSD-3-Clause, as built and
published by Salesforce. Each package ships both texts under licenses/.