Post

Replies

Boosts

Views

Activity

Web Push Notifications Stopped Working
About 2,5 weeks ago our web site push notifications in Safari stopped working. Initially we received an error server side, but this is no longer showing. We can see the PushPackage.zip being downloaded after Safari prompts the user if they want to receive notifications. But after that nothing. In our client side code the request with default comes in to request the device using window.safari.pushNotification.requestPermission. However in 9/10 calls nothing happens after this. const checkRemotePermission = (permissionData) => { if (permissionData.permission === 'default') { // This is a new web service URL and its validity is unknown. window.safari.pushNotification.requestPermission( 'https://host/push', 'pushid', {user: ****}, checkRemotePermission ); } else if (permissionData.permission === 'denied') { // User does not want } else if (permissionData.permission === 'granted') { // register the device } }; On 1/10 the call comes back as expected with granted and push notifications work. But without this call coming in, push notifications simply don't work. To our knowledge nothing changed in our server and client code. We regenerated the web push certificated and we even requested a new AuthToken, recreated and PushPackages and used the latest G4 certificate. All leading to the same result. It feels like the call that Safari does with the PushPackage.zip file goes to the Void... Any help would be great. We are lost as something that worked for 2,5 years stopped working without any traceable changes. We have gone through Apple Support, but after talking to 3 departments and they all sending me back to the previous department I hope someone can help me, and more import, our clients here.
0
1
1.1k
Feb ’23
Crash on MTLDebugCommandBuffer lockPurgeableObjects in MacOS 12
We see strange crashes when running our app since macOS 12 Beta (but still on macOS 12.0.1). We have not been able to fully identify the issue but it seems to happen on continue video playback in an AVPlayer, sometimes due to background, sometimes due to continue playback directly. Xcode points to some code in the libsystem_kernel.dylib (seems different every time and never in our own code) The log will show: -[MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion 'MTLResource 0x600002293790 (label: (null)), referenced in cmd buffer 0x7f7b2200a000 (label: (null)) is in volatile or empty purgeable state at commit' -[MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion 'MTLResource 0x600002293790 (label: (null)), referenced in cmd buffer 0x7f7b2200a000 (label: (null)) is in volatile or empty purgeable state at commit' We tried finding the object 0x600002293790 and 0x7f7b2200a000 but this gave no additional information as to why the app crashes. We are using a custom VideoCompositor: AVVideoCompositing and initialise the CIContext for the work done here with these options: if let mtlDevice = MTLCreateSystemDefaultDevice() let options: [CIContextOption : Any] = [ CIContextOption.useSoftwareRenderer: false, CIContextOption.outputPremultiplied: false, ] let context = CIContext(mtlDevice: mtlDevice, options: options) } Not sure this is an Xcode 13 debug issue? a macOS 12.0.1 Monterey issue? or an actual issue as we have not seen it crash when not using Xcode to build our app giving this information. But we have seen strange crashes on Audio/Video threads that we could not trace back to our code as well. The crash has never occurred on Xcode 12 or on macOS Big Sur during previous testing. Any information as to locating the source of the issue or a solution would be awesome.
3
0
1.6k
Oct ’21
Custom CIFilter on CALayer does NOT work
We are trying to create a custom CIFilter to add on top of our CALayer's. How ever only the default CIFilters seem to work on a CALayer. We created a small new project on the ViewController.swift we added: import Cocoa import CoreImage class ViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() // Create some layers to work with! (square with gradient color) let mainLayer = CALayer() let shapeLayer = CAShapeLayer() let gradientLayer = CAGradientLayer() gradientLayer.colors = [NSColor.red.cgColor, NSColor.white.cgColor, NSColor.yellow.cgColor, NSColor.black.cgColor] shapeLayer.path = CGPath(rect: CGRect(x: 0, y: 0, width: 500, height: 500), transform: nil) shapeLayer.fillColor = CGColor.black gradientLayer.frame = CGRect(x: 0, y: 0, width: 500, height: 500) gradientLayer.mask = shapeLayer gradientLayer.setAffineTransform(CGAffineTransform(translationX: 50, y: 50)) mainLayer.addSublayer(gradientLayer) mainLayer.filters = [] self.view.layer?.addSublayer(mainLayer) // Register the custom filter CustomFilterRegister.register() // Test with a normal image file, WORKS! // if let image = NSImage(named: "test"), let cgImage = image.cgImage(forProposedRect: nil, context: nil, hints: nil) { // if let filter = CIFilter(name: "CustomFilter") { // filter.setValue(CIImage(cgImage: cgImage), forKey: kCIInputImageKey) // let output = filter.outputImage // // WORKS! Image filtered as expected! // } // } // Does NOT work. No change in color of the layer! if let filter = CIFilter(name: "CustomFilter") { filter.name = "custom" mainLayer.filters?.append(filter) } // This works: mainLayer and sublayers are blurred! // if let filter = CIFilter(name: "CIGaussianBlur") { // filter.name = "blur" // mainLayer.filters?.append(filter) // } } } } We created a simple custom CIFilter to give it a first try before we start building our custom CIFilter. class CustomFilter: CIFilter { // Error in xcode if you don't add this in! override class var supportsSecureCoding: Bool { return true } @objc dynamic var inputImage: CIImage? @objc dynamic var inputSaturation: CGFloat = 1 @objc dynamic var inputBrightness: CGFloat = 0 @objc dynamic var inputContrast: CGFloat = 1 override func setDefaults() { inputSaturation = 1 inputBrightness = 0 inputContrast = 2 } override public var outputImage: CIImage? { guard let image = inputImage else { return nil } return image.applyingFilter("CIPhotoEffectProcess") .applyingFilter("CIColorControls", parameters: [ kCIInputSaturationKey: inputSaturation, kCIInputBrightnessKey: inputBrightness, kCIInputContrastKey: inputContrast ]) } } class CustomFilterRegister: CIFilterConstructor { static func register() { CIFilter.registerName( "CustomFilter", constructor: CustomFilterRegister(), classAttributes: [ kCIAttributeFilterCategories: [kCICategoryBlur, kCICategoryVideo, kCICategoryStillImage] ]) } func filter(withName name: String) -> CIFilter? { switch name { case "CustomFilter": return CustomFilter() default: return nil } } } In the ViewController we added code to test with a normal image. This DOES work so the filter seems to be ok. We also tried a default CIGaussianBlur and that does work on the CALayer. We are lost as to what is needed to get a custom CIFilter working with CALayer, and can't seem to find any information on it. Please note that we are NOT looking for this type of CIFilter or a different way to get the filters result. We need a custom CIFilter to work on a CALayer.
3
0
2.9k
May ’21