Hi Community,
I'm currently using Adobe Assurance to validate AEP events in a React Native application connected to the QA environment. While the Assurance tool successfully connects initially (and the device shows as connected), I encounter the following issue:
After a few minutes, Assurance disconnects automatically without any user interaction.
Once disconnected, AEP Edge requests stop appearing in the Edge view.
To reconnect, I must completely close and relaunch the app, which is disrupting QA workflows.
I've already confirmed the following:
Assurance is started via AEPAssurance.startSession().
All required AEP SDKs are installed and initialized correctly.
The app is sending Edge events (AEPEdge.sendEvent) successfully while connected.
Logging is enabled, but no specific errors are seen prior to disconnection.
I suspect this may be related to WebSocket timeouts, app backgrounding, or platform-specific lifecycle handling in React Native.
Questions:
Is there a recommended way to handle auto-reconnection of Assurance sessions in React Native (e.g., using AppState or lifecycle hooks)?
Are there known limitations or best practices for maintaining Assurance sessions in RN apps, especially when running on physical devices?
Could this be caused by SDK versioning, and are there minimum version requirements to avoid such disconnects?
Any insights or guidance from others who’ve faced similar issues would be greatly appreciated.
Thank you!
That's strange.. we use React Native, and I don't have that issue at all.
In fact, I can set my testing phone down, leave it for a few days, and open it back up and still be connected (this works for both closing the app and leaving the app open)
I have not heard of anyone else experiencing anything like you described... but as such, we've been using React Native and AEP Assurance for years, on both the ACP and AEP SDKs... so I don't think this would be a versioning issue...
I am not sure what is happening in your case, but I wonder if this is something that is specific to your apps and the way the code has been integrated, rather than an issue with the SDK itself?
Views
Replies
Total Likes
Hi @jaishal
Yeah, this kind of issue does come up from time to time — especially in React Native apps where the app lifecycle isn’t always in sync with Assurance.
From what you have mentioned above, it does sound like the connection is being dropped when the app goes idle or in the background, which can cause the WebSocket to time out silently.
You can try the following, one of them should help -
You could try restarting the Assurance session when the app comes back to the foreground. Something like -
import { AppState } from 'react-native';
useEffect(() => {
const sub = AppState.addEventListener('change', (state) => {
if (state === 'active') {
AEPAssurance.startSession('<your-link>');
}
});
return () => sub.remove();
}, []);
Let me know if any of the above options help to solve your problem.
Views
Replies
Total Likes
So this needs to implemented by the devs in their code base right?
import { AppState } from 'react-native';
useEffect(() => {
const sub = AppState.addEventListener('change', (state) => {
if (state === 'active') {
AEPAssurance.startSession('<your-link>');
}
});
return () => sub.remove();
}, []);
Views
Replies
Total Likes
Yes, that’s right, this would need to be added by the devs in the app codebase.
It’s a simple tweak, but it can really help keep the Assurance session alive when the app comes back into focus. You could also consider wrapping it in a check to avoid restarting the session unnecessarily if it’s already active.
If your dev team prefers to handle things differently, the main idea is just to reinitiate AEPAssurance.startSession() when the app becomes active again, using whatever lifecycle hook or state management fits their setup best.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies