Skip to content

CI for cross platform compilation and apple device metadata refactor #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

justindoody
Copy link

This isn't quite ready to merge but I wanted to discuss at this current state.

First off the existing package only works on iOS at the moment due to issues with dependencies on the conditional blocks. I'm working on a cross platform app targeting macOS, iOS, and tvOS and implementing OpenPanel. (By the way the OpenPanel docs don't mention this SDK existing -- luckily i checked github issues before trying to build one myself)

This branch accomplishes two things primarily:

  • Added github CI to run xcodebuild targeting the three OS's i mentioned above (could potentially expand to watchOS and visionOS -- i just didn't need em). I needed to add the workspace/project to get xcodebuild to actually run. Supposedly it worked with just plain packages in the past but I couldn't get it to and docs are sparse.
  • Refactors approach to device metadata. This is the area I wanted to discuss. I think we could just get rid of the user agent approach entirely for Apple apps. Trying to figure out how to force/format various data into a format ua-parser-js would properly parse is a real pain and i don't think for some things it will work at all (like specific model numbers of devices). The approach i took here is just injecting various params into the _global at init. Because of the isServer checks on the OpenPanel side at least a minimal user agent is need like "Mozilla/5.0 (iPhone; U)" to avoid that (though that side of things could be refactored too I suppose).

I think it would be good to get rid of the whole WKWebView dependency for iOS. Is there any value in getting this UserAgent when using OpenPanel for apps?

Here is an example of tracking the apple model identifier instead of the more generic Macintosh or iPhone for all devices.
Screenshot 2025-05-02 at 6 43 59 PM

…tional code block compilation errors. Refactored approach to providing device metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant