microsoft / cpp_client_telemetry

1DS C++ SDK
Apache License 2.0
83 stars 45 forks source link

[Vision Pro Support] visionOS related changes in OneDS SDK #1228

Open nishchith-cp opened 4 months ago

nishchith-cp commented 4 months ago

Describe your environment. Apple Vision Pro simulator in Xcode Version 15.2 beta (15C5500c)

Steps to reproduce. Run the code in the Apple Vision Pro simulator in Xcode Version 15.2 beta (15C5500c) Apple Vision Pro related informations are not populated properly

DeviceInfo_OsName DeviceInfo_Model DeviceInfo_Make DeviceInfo_OsBuild
iOS RealityDevice14,1 Apple  

DeviceInfo_OsName - Should be visionOS DeviceInfo_OsBuild - Not populated Not sure if any other details are missing.

What is the expected behavior? All the VisionOS errors/warning if present should be fixed. Vision OS related details should be populated properly.

nishchith-cp commented 2 months ago

@lalitb When can we have this fix?

lalitb commented 2 months ago

@nishchith-cp Sorry for the late reply. Our Observability team doesn't have the necessary bandwidth to support VisionOS for now. We will discuss with @eduardo-camacho during the next community meeting if their team can help on this. But changes are in general straightforward, and if you would like to contribute, we can help you with guidance and review.

nishchith-cp commented 2 months ago

@lalitb Could you please check with @eduardo-camacho for the same for help on this. It would be great if we can just the DeviceInfo_OsName details correctly for now.

nishchith-cp commented 2 months ago

@lalitb Any updates on this?

lalitb commented 2 months ago

@nishchith-cp - Yes this was discussed yesterday. @eduardo-camacho suggested using the DeviceInfo.OsVersion to identify visionOS. The OS name would remain the same, however the version would be the actual version of visionOS on the device.

lalitb commented 2 months ago

Also, the core C++ SDK provides the SemanticContext method to override the OsName -

virtual void ISemanticContext::SetOsName(const std::string &x)
{
    SetCommonField(COMMONFIELDS_OS_NAME, x);
};

This method is implemented for Java, but not for obj-c. The obj-c binding can be created for this in ODWSemanticContext.mm as below:

-(void)setOsName:(nonnull NSString*)osName
{
    std::string strOsName = std::string([osName UTF8String]);
    _wrappedSemanticContext->SetAppExperimentIds(strOsName);
}

And then in the application code:

#include "TargetConditionals.h"
#if defined(TARGET_OS_XR) && TARGET_OS_XR
    [self setOsName:@"visionOS"];
#elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
    [self setOsName:@"iOS"];
#elif defined(TARGET_OS_MAC) && TARGET_OS_MAC
    [self setOsName:@"MacOSX"];
#else
    [self setOsName:@"UnknownApple"];
#endif

cc @absaroj and @eduardo-camacho just in case there is a better way.

nishchith-cp commented 2 months ago

@lalitb Device_OsVersion just gives the os versions and not much information. It would be hard to track as the new OS versions as for the dashboards.

For the suggested changes, when can we expect the SDK release?

lalitb commented 2 months ago

For the suggested changes, when can we expect the SDK release?

As I mentioned earlier, we can help with guidance and reviews if someone would like to contribute to the changes. Or else, please raise a dependency ask with us to prioritize.

lalitb commented 1 week ago

@nishchith-cp Just wondering if you plan to add this support?

nishchith-cp commented 1 week ago

@lalitb Caught up with some priority items. Will take up once I am done with them. Was facing some issue with the setup as well. Thanks