forcedotcom / forcedotcom/SalesforceMobileSDK-Android

Unable to restore user session or receive push notifications when the app is completely closed.

Open
#2,795 2 comments 0 reactions 0 assignees View on GitHub
need more info
Dominant language
Kotlin
Stars
361
Forks
393
Avg merge
17h 17m
Merged PRs (30d)
36

Description

### **Description:**
We are experiencing a critical issue with Salesforce Mobile SDK version compatibility that affects push notification functionality.

### **Current Setup:**
Marketing Cloud SDK: 9.0.+ (Push notifications)
Salesforce Mobile SDK: MobileSync:13.0.0 (IAM/Authentication)
Firebase Messaging: 23.3.0 (FCM integration)
SFMC Flutter Plugin: ^9.0.0 (Marketing Cloud Flutter wrapper)

### **Problem:**
We seem have a version conflict between Salesforce Mobile SDK versions:
**MobileSync 13.0.0:**
✅ Push notifications work when app is closed
❌ Some Android devices fail to decrypt local saved sessions
❌ IAM authentication issues on certain devices
**MobileSync 13.1.0:**
✅ Fixes local session decryption issues
✅ IAM authentication works properly
❌ Push notifications stop working when app is fully closed
❌ SFMCSdk.requestSdk does not respond in background
**Code Affected:**

override fun onMessageReceived(message: RemoteMessage) {
val customKeys = message.data
val navigationPath = customKeys["navigation_path"] ?:
customKeys["path"] ?:
customKeys["deeplink"] ?:
customKeys["route"]

if (navigationPath != null) {
// Create intent to launch MainActivity with navigation path
val intent = Intent(this, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TOP or
Intent.FLAG_ACTIVITY_SINGLE_TOP
putExtra("navigation_path", navigationPath)
}
startActivity(intent)
}

if (PushMessageManager.isMarketingCloudPush(message)) {
SFMCSdk.requestSdk { sdk -> // ← This fails with 13.1.0 when app is closed
sdk.mp {
it.pushMessageManager.handleMessage(message)
}
}
}
}

**Expected Behavior:**
Push notifications should work when app is closed with MobileSync 13.1.0
SFMCSdk.requestSdk should respond properly in background
Local session decryption should work on all Android devices

**Actual Behavior:**
With MobileSync 13.1.0: Push notifications work when app is open/backgrounded, but fail when app is completely closed
With MobileSync 13.0.0: Push notifications work when app is closed, but local session decryption fails on some devices

**Environment:**
Android SDK: 34
Min SDK: 28
Target SDK: 34
Kotlin: 1.9.10
Gradle: 8.4
Marketing Cloud SDK: 9.0.+
Firebase Messaging: 23.3.0

Could you please help us find a solution?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.