Post

Replies

Boosts

Views

Activity

Reply to Unable to use ARGeoTrackingConfiguration when launching a new AR Session in the app - 15.4 (and 15.41.)
#import <objc/runtime.h> @interface SwizzledDecoder : NSObject - (void)__validateAllowedClass:(Class)arg1 forKey:(id)arg2 allowingInvocations:(bool)arg3; @end @implementation SwizzledDecoder - (void)__validateAllowedClass:(Class)arg1 forKey:(id)arg2 allowingInvocations:(bool)arg3 { if ([arg2 isEqualToString: @"collaborationData"]) { return; } return [self __validateAllowedClass: arg1 forKey: arg2 allowingInvocations: arg3]; } @end void NSXPCDecoderSwizzle(void) { // https://nshipster.com/method-swizzling/ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ Class originalClass = NSClassFromString(@"NSXPCDecoder"); Class swizzledClass = NSClassFromString(@"SwizzledDecoder"); SEL originalSelector = @selector(_validateAllowedClass:forKey:allowingInvocations:); SEL swizzledSelector = @selector(__validateAllowedClass:forKey:allowingInvocations:); Method originalMethod = class_getInstanceMethod(originalClass, originalSelector); Method swizzledMethod = class_getInstanceMethod(swizzledClass, swizzledSelector); IMP originalImp = method_getImplementation(originalMethod); IMP swizzledImp = method_getImplementation(swizzledMethod); class_replaceMethod(originalClass, swizzledSelector, originalImp, method_getTypeEncoding(originalMethod)); class_replaceMethod(originalClass, originalSelector, swizzledImp, method_getTypeEncoding(swizzledMethod)); }); } @glow this is some really awful code to at least get the ARGeoTrackingConfiguration back on screen displaying live camera capture on a device running 15.4.1.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’22
Reply to Unable to use ARGeoTrackingConfiguration when launching a new AR Session in the app - 15.4 (and 15.41.)
@glow it sounds like a bad bug. The sample code from 14.0 is breaking in 15.4. Apple DTS told us there is no workaround. That's… not a good sign. It's possible the next version of Xcode builds and compiles to retcon a fix on 15.4.x. It's either an official fix from a new SDK, an unofficial fix in the form of discovering some kind of hacky private API to fix 15.4.x, or engineers just have to permanently gate their users from ARGeoTrackingConfiguration on 15.4.x.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’22
Reply to Unable to use ARGeoTrackingConfiguration when launching a new AR Session in the app - 15.4 (and 15.41.)
@glow you were able to build from Xcode 13.3.1 to 15.5b2 and the issue is fixed? Do we know when the issue first started happening? Is this a 15.4.x bug? Does anyone have the diff to get that Apple sample code project working correctly on 15.4.x? Is there any workaround in code other than just gating users on 15.4.x from ever using ARGeoTrackingConfiguration?
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’22