tweaselORG / appstraction

An abstraction layer for common instrumentation functions (e.g. installing and starting apps, setting preferences, etc.) on Android and iOS.
MIT License
4 stars 1 forks source link

Move `getAppId()` and `getAppVersion()` somewhere else #18

Closed baltpeter closed 1 year ago

baltpeter commented 1 year ago

Currently, they are on the platform API object:

https://github.com/tweaselORG/appstraction/blob/d07379a4a8c71e0d70d8b043fb23d600054d1ba6/src/index.ts#L142-L157

But that doesn't make much sense—they are completely independent of the configuration of those. They are essentially static utility functions.

Maybe we should thus move them somewhere else and just export them in index.ts?

zner0L commented 1 year ago

I agree. It didn't make much sense for me to put them there in the first place and it confused me for a while.

baltpeter commented 1 year ago

I'll make this into a parseAppMeta() function that returns { id: string; version: string }.

I can definitely see us parsing additional attributes in the future. And it doesn't make sense to have to parse the app multiple times to get both the version and app ID.