Apple rejected my app with title
Unsupported operation - Apps are not allowed to listen to device lock notifications
I am using Darwin Notifications in the app.
Is there any valid alternative of Darwin notifications for checking Lock State?
Apple rejected my app with title
Unsupported operation - Apps are not allowed to listen to device lock notifications
I am using Darwin Notifications in the app.
Is there any valid alternative of Darwin notifications for checking Lock State?
You could try applicationProtectedDataWillBecomeUnavailable(_:)
method of UIApplicationDelegate
. From docs
When the user locks the device, the system calls the app delegate’s applicationProtectedDataWillBecomeUnavailable(:) method. Data protection prevents unauthorized access to files while the device is locked. If your app references a protected file, you must remove that file reference and release any objects associated with the file when this method is called. When the user subsequently unlocks the device, you can reestablish your references to the data in the app delegate’s applicationProtectedDataDidBecomeAvailable(:) method.
Good Luck!
Remove darwin notifications observer for get device lock state and use simple default method [UIApplication sharedApplication].applicationState.Search if you are using or any third party using this "com.apple.springboard.lockstate" inside project then remove it.
Now clean the project and upload with new binary .