Adobe-Marketing-Cloud / aep-sdks-documentation

Documentation repository for the Adobe Experience Platform Mobile SDKs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide additional examples for setup analytics with named configuration

Vacxe opened this issue · comments

Issue:
Documentation does't provide example how to use configuration with different file name. https://github.com/Adobe-Marketing-Cloud/aep-sdks-documentation/blob/master/using-mobile-extensions/adobe-analytics/README.md

With default name configuration ("ADBMobileConfig.json") placed in assets folder all works with expected behaviour. But, if we changing a name of one to "ADBMobileConfigV5.json" and still keeping it n assets it doesn't work

MobileCore.configureWithFileInPath("ADBMobileConfigV5.json")

Please provide an example into documentation file.

Core library version is 1.5.8

@Vacxe
https://aep-sdks.gitbook.io/docs/using-mobile-extensions/mobile-core/configuration#java-2
You need to get the absolute path of the config file and then pass it to MobileCore.configureWithFileInPath.

@shalehaha that's good but could u provide an example how I can use it? Also how to convert android assets files to absolute path?

Will be better to create a separate method such as MobileCore.configureWithFile(<Name in assets directory>)

This API is not ideal for reading files from the assets folder. One workaround is to read the file and save it to another place. But I think the easiest way is to use the default name ADBMobileConfig.json.
We will consider making an enhancement to allow loading the config file directly from the assets folder.

@shalehaha because I want smoothly migrate from deprecated V4 version to the new one. Both versions use the same default name for config file but structure of those files is different, so we can't implement migration with having both configs in assets folder.

Also I can help with implementation in case if the library in OSS.

@Vacxe
You couldn't have both SDKs in the app. Once you have enabled the new SDK, it migrates v4 data to the new format, so v4 SDK won't be working anymore. So technically, you should only have one ADBMobileConfig.json.
Sorry, the lib is not OSS yet.

@shalehaha I mean do migration by remote feature toggle from server. When u have 2 implementation of common interface for analytics and can switch between them on flight.

@Vacxe I see. How urgent is this for you? We can fix it and probably release the new build in about two weeks, does that work?

@shalehaha honestly that's very urgent, we already under regression testing for the release and require this functionality ASAP. But anyway, if thats will be happens in two week, that still ok. Cheers for quick reply.

@Vacxe
We added a new API in version 1.7.0 which was released yesterday. You should be able to call MobileCore.configureWithFileInAssets("exampleJSONfile.json"); to load the config file from the assets folder now.

Thanks a lot!

@Vacxe
I'm closing this ticket, please let us know if you have further questions.