Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to get BLOB and LocationHint with the AEP SDK?

Avatar

Level 2

With ADBMobile, we were reading the BLOB and the location-hint values from the UserDefaults.

How could I get the same data when using the AEP SDK?

7 Replies

Avatar

Employee

Hi @emilio-ojeda

Short answer is yes. But I want to highlight that with the AEP SDKs we have a newer event based architecture and we publish all the events and the related data into eventhub. You can get the BLOB and LocationHint values by dispatching Identity request and extracting the blob and locationHint from the response. Make sure you have Identity extension registered.

Here is the sample for that:

let sampleEvent = Event(name: "fetchBlobAndLocationHint", type: EventType.identity, source: EventSource.requestIdentity, data: nil)
      MobileCore.dispatch(event: sampleEvent) { identityResponseEvent in
      guard let state = identityResponseEvent?.data  else {
           return
        }
        let blob = state["blob"] as? String ?? ""
        let locHint = state["locationhint"] as? String ?? ""
        print("#blob:\(blob) | locHint:\(locHint)")
}


Let me know if this works, or you want to proceed on the UserDefaults route.

Thanks,
Arjun

Avatar

Level 2

Thanks for the replay ...

Well, the function call MobileCore.dispatch works, but it isn't returning either the blob or locationhint info. I presume something has to be enabled 🤔 right?

Avatar

Level 2

I have it. I am registering the extensions in the app launch (AEPIdentity.Identity.self) and the extension is installed - I see the message "No configuration necessary.".

 

But still, it isn't returning values for blob and locationhint.

Avatar

Employee

Hi @emilio-ojeda

I think you are referring to the launch extension. You need to also install the extension on the SDK side. Are you also registering the extension? Also verify if you have configured the SDK. After verifying both if you still see the issue, please open a ticket with our customer support team . Also please attach the verbose console logs for the same. 

Avatar

Employee

Where do you see this message  "No configuration necessary."?

It would be really helpful if you open a ticekt with customer support. It will help us to understand the usecase and how can we improve our SDK to handle that. The userdefaults route is not recommended and uses internal classes (helpers/constants). It will be great if you can provide more information so we can help you better. 

Thanks,
Arjun