Expand my Community achievements bar.

Efficient way to extract `sessionId`, `tntId`, `ECID` from the mobile AEP SDK.

Avatar

Employee Advisor

10/6/21

Issue: Extracting from the mobile AEP SDK "Target.getTntId" is very slow & "Target.getSessionId" does not exist.

 

Details: Albertsons team is looking for ways to extract `sessionId`, `tntId`, `ECID` from the mobile AEP SDK as quickly as possible (to forward to another API call to load Recs).


Observations:
1. Testing `Target.getTntId` with callback, noticed that this promise-function always resolves after Target response is back. (Just like documented.) This took about 0.4 seconds on Vadym's simulator device with high-speed Internet connection. This is really slow.

2. Since `tntId` is cached in the app, in reality we could always read it from cache to eliminate waiting for `tntId` via callback. This surely would improve the performance, however, it is an unsupported method.

3. There is no `Target.getSessionId` available in AEP SDK. (Vadym understands it was not designed to be available, but in current case, it must be retrieved from cache, which is an unsupported method.) `Target.getSessionId` could potentially sync visitors between an app and web if the same session ID are passed. Today, only ECID sync is available between the app and mobile web or browser web.


Feature Request: Offer a more efficient way to extract `sessionId`, `tntId`, `ECID` from the mobile AEP SDK by doing the following:
1. Adjust `Target.getTntId` to pull `tntId` from cache when available and if not available then fallback to Target response.
2. Add `Target.getSessionId` that behaves similarly to #1 pulling `sessionId` from cache when available or fallback to Target response.