SFMCSDK.Net
1.1.3.6
See the version list below for details.
dotnet add package SFMCSDK.Net --version 1.1.3.6
NuGet\Install-Package SFMCSDK.Net -Version 1.1.3.6
<PackageReference Include="SFMCSDK.Net" Version="1.1.3.6" />
<PackageVersion Include="SFMCSDK.Net" Version="1.1.3.6" />
<PackageReference Include="SFMCSDK.Net" />
paket add SFMCSDK.Net --version 1.1.3.6
#r "nuget: SFMCSDK.Net, 1.1.3.6"
#:package SFMCSDK.Net@1.1.3.6
#addin nuget:?package=SFMCSDK.Net&version=1.1.3.6
#tool nuget:?package=SFMCSDK.Net&version=1.1.3.6
MarketingCloudSDK.Net and SFMCSDK
.Net 7 and .Net 8 support, Android and iOS
WIKI and API:
- ** Android SDK Online Reference**: Salesforce Marketing Cloud SDK
- ** iOS SDK Online Reference**: Salesforce Marketing Cloud SDK
Android Issues
to able run and compile and avoid issue
Error JAVAC0000: error: cannot access * com.salesforce.marketingcloud.* bad class file: obj/Debug/net7.0-android/lp/179/jl/classes.jar(/com/salesforce/marketingcloud/*.class) class file has wrong version 61.0, should be 55.0 Please remove or make sure it appears in the correct subdirectory of the classpath. Directory 'obj/Debug/net7.0-android/lp/179' is from 'marketingcloudsdk.aar'. (JAVAC0000) (*) javac
install JDK 17 and select it path in xamarin studio settings
fix r8 issues:
Compilation failed java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
download latest R8 jar file
and add <AndroidR8JarPath>Platforms/Android/r8-8.2.42.jar</AndroidR8JarPath> to your csproj file inside <PropertyGroup></PropertyGroup>
Initialize iOS
AppDelegate.cs: `[Register("AppDelegate")] public class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() ⇒ MauiProgram.CreateMauiApp();
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
SfmcManager.ConfigurePlatformSdk();
return base.FinishedLaunching(application, launchOptions);
}
}
public static void ConfigurePlatformSdk() { // Silence Keychain Crash: // If a device is setup with FaceId or Passcode based authentication, // and if an application (with MarketingCloudSDK integrated) // accesses the Keychain when the device is in a locked state, a fatal // exception is thrown. The SDK cannot access these files due to the iOS Data // Protection mode. // https://salesforce-marketingcloud.github.io/MarketingCloudSDK-iOS/trouble/trouble-Keychain-crash.html
SFMCSdk.SetKeychainAccessErrorsAreFatalWithErrorsAreFatal(errorsAreFatal: false);
var appId = "";
var accessToken = "";
var serverUrl = "";
var mid = "";
var pushConfig = new PushConfigBuilder(appId)
.SetAccessToken(accessToken)
.SetMarketingCloudServerUrl(new NSUrl(serverUrl))
.SetMid(mid)
.SetInboxEnabled(false)
.SetLocationEnabled(false)
.SetAnalyticsEnabled(true)
.SetDelayRegistrationUntilContactKeyIsSet(true)
.Build();
SFMCSdk.SetLoggerWithLogLevel(SFMCSdkLogLevel.Debug, new SFMCSdkLogOutputter());
SFMCSdk.Mp.SetDebugLoggingEnabled(true);
var configuration = new SFMCSdkConfigBuilder()
.SetPushWithConfig(pushConfig, r => OnSdkInitialized(r))
.Build();
SFMCSdk.InitializeSdk(configuration);
}
static void OnSdkInitialized(SFMCSdkOperationResult result)
{
//TODO: YAYA
}
public class Logger : SFMCSdkLogOutputter
{
public override void OutWithLevel(SFMCSdkLogLevel level, string subsystem, SFMCSdkLoggerCategory category, string message)
{
Debug.WriteLine($"SFMC - Logger - OutWithLevel: {level} | {subsystem} | {category} | {message}");
//base.OutWithLevel(level, subsystem, category, message);
}
}`
Initialize Android
MainApplication.cs: `[Application] public class MainApplication : MauiApplication { public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership) { }
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
public override void OnCreate()
{
ConfigurePlatformSdk(this as Android.Content.Context);
base.OnCreate();
}
}
public static void ConfigurePlatformSdk(Android.Content.Context context) { var appId = ""; var accessToken = ""; var serverUrl = ""; var mid = "";
// Initialize logging _before_ initializing the SDK to avoid losing valuable debugging information.
SFMCSdk.SetLogging(LogLevel.Debug, new ILogListener.AndroidLogger());
MarketingCloudSdk.LogLevel = MCLogListener.Verbose;
MarketingCloudSdk.SetLogListener(new IMCLogListener.AndroidLogListener());
var mbuilder = MarketingCloudConfig.InvokeBuilder();
mbuilder = mbuilder.SetApplicationId(appId);
mbuilder = mbuilder.SetAccessToken(accessToken);
mbuilder = mbuilder.SetMarketingCloudServerUrl(serverUrl);
//TODO: get this one, it is from documentation https://salesforce-marketingcloud.github.io/MarketingCloudSDK-Android/sdk-implementation/implement-sdk-google.html
// but I have no Idea about the value of it
//mbuilder = mbuilder.SetSenderId("<firebase sender id>");
mbuilder = mbuilder.SetMid(mid);
//required!!! will crash if no options
mbuilder = mbuilder.SetNotificationCustomizationOptions(NotificationCustomizationOptions.Create(Android.Resource.Drawable.GalleryThumb));
var sfBuilder = new SFMCSdkModuleConfig.Builder();
sfBuilder.PushModuleConfig = mbuilder.Build(context);
SFMCSdk.Configure(context, sfBuilder.Build(), new Function1Impl<SFMCSdkInitializationStatus>((result) => { var stat = result.Status == SFMCSdkInitializationStatus.InterfaceConsts.Success ? "Success" : "Failure"; Debug.WriteLine($"SFMC - OnSdkInitialized: {stat}"); }));
}
public class Function1Impl<T> : Java.Lang.Object, IFunction1 where T : Java.Lang.Object
{
private readonly Action<T> OnInvoked;
public Function1Impl(Action<T> onInvoked)
{
this.OnInvoked = onInvoked;
}
public Java.Lang.Object Invoke(Java.Lang.Object objParameter)
{
try
{
T parameter = (T)objParameter;
OnInvoked?.Invoke(parameter);
return null;
}
catch (System.Exception ex)
{
// Exception handling, if needed
}
return null;
}
}`
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-android34.0 is compatible. net8.0-ios17.2 is compatible. net9.0-android was computed. net9.0-ios was computed. net10.0-android was computed. net10.0-ios was computed. |
-
net8.0-android34.0
- Xamarin.AndroidX.Annotation (>= 1.8.2.1)
- Xamarin.AndroidX.Core.Core.Ktx (>= 1.13.1.5)
- Xamarin.AndroidX.Fragment.Ktx (>= 1.8.3.1)
- Xamarin.AndroidX.LocalBroadcastManager (>= 1.1.0.17)
- Xamarin.Kotlin.StdLib.Jdk7 (>= 2.0.0)
-
net8.0-ios17.2
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SFMCSDK.Net:
| Package | Downloads |
|---|---|
|
MarketingCloudSDK.Net
One cross-platform API for Salesforce Marketing Cloud MobilePush: awaitable initialization with real credentials, identity (contact key and attributes) via the SFMC SDK core, registration reads and tag/attribute edits on Android and iOS from shared code, over the MarketingCloudSDK.Net.Android and MarketingCloudSDK.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 |
|---|---|---|
| 4.0.1.2 | 166 | 7/30/2026 |
| 4.0.1.2-beta.4.12 | 49 | 7/30/2026 |
| 4.0.1.1 | 220 | 7/30/2026 |
| 4.0.1.1-beta.3.10 | 49 | 7/30/2026 |
| 4.0.1.1-beta.2.7 | 59 | 7/30/2026 |
| 4.0.1.1-beta.2.5 | 58 | 7/30/2026 |
| 1.1.3.8 | 275 | 10/30/2024 |
| 1.1.3.6 | 206 | 10/7/2024 |
| 1.1.2.10 | 205 | 7/12/2024 |
| 1.1.2.4 | 200 | 7/12/2024 |
| 1.1.2.3 | 185 | 5/20/2024 |
| 1.1.2.2 | 194 | 5/17/2024 |
| 1.1.1.80 | 219 | 2/28/2024 |
| 1.1.1.79 | 239 | 2/22/2024 |
| 1.1.1.1 | 226 | 2/12/2024 |
| 1.0.3.73 | 255 | 2/7/2024 |