MPMusicPlayerController setCurrentPlaybackRate - ios

The call to setCurrentPlaybackRate to the MPMusicPlayerController stopped working after the latest iOS update, and now gives this error:
2018-04-15 16:24:06.904562-0600 SampleProject[5659:1836398] [SDKPlayback] -
[MPMusicPlayerController setCurrentPlaybackRate:0.670213] completed error:
Error Domain=MPCPlayerRequestErrorDomain Code=1 "No commands provided."
UserInfo={NSDebugDescription=No commands provided.}
I'm passing in a valid double value greater than 0 and less than 2.
This is the call:
[appMusicPlayer setCurrentPlaybackRate:0.7];
Thanks for any input or help!
P.S. I'm getting a lot of other weird errors too. Here are some:
2018-04-15 17:30:01.976932-0600 SampleProject[5733:1868672] [SDKPlayback]
Failed validators: {(
setRepeatMode
)}
2018-04-15 17:30:03.976879-0600 SampleProject[5733:1868672] [SDKPlayback]
Failed to get a valid response. Resetting expectations.
2018-04-15 17:30:01.976932-0600 SampleProject[5733:1868672] [SDKPlayback]
Failed validators: {(
setRepeatMode
)}
2018-04-15 17:30:03.976879-0600 SampleProject[5733:1868672] [SDKPlayback]
Failed to get a valid response. Resetting expectations.

I just encountered the same issue when trying to use player.append(MPMusicPlayerQueueDescriptor). I found that it would return the same error when the queue for my MPMusicPlayerController was quite large. When I cut it down to around 10, it works with no issues. I haven't experimented to see the maximum I can add to the queue.
I hope this helps, perhaps a smaller queue will also work for you.

Related

iOS 16 FairPlay Changes

Are there any changes in FairPlay logic? My app has FairPlay protected Videos and Audio, they work perfectly until iOS 15.7, but in iOS 16
makeStreamingContentKeyRequestData is throwing me following error :
Error Domain=CoreMediaErrorDomain Code=-19152 "(null)"
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed"
UserInfo={NSLocalizedFailureReason=An unknown error occurred (-19156), NSLocalizedDescription=The operation could not be completed,
NSUnderlyingError=0x280deac10 {Error Domain=NSOSStatusErrorDomain Code=-19156 "(null)"}}
What could be the possible reason for this and solution?
Thanks in Advance
Function streamingContentKeyRequestDataForApp is deprecated on iOS 15 according to documentation. Use function makeStreamingContentKeyRequestData that is specified in new function documentation. Here is an example usage:
func makeStreamingContentKeyRequestData(
forApp appIdentifier: Data,
contentIdentifier: Data?,
options: [String : Any]? = nil,
completionHandler handler: #escaping (Data?, Error?) -> Void
)
We are using AVContentKeySession for downloading, met with the same error, and fixed it. For our case, the issue was as following.
Issue observed:
On iOS16.0.3, 12s later after "license request" was triggered firstly by app during downloading, "license request" would be triggered again by AVFoundation framework
("contentKeySession(_ session: AVContentKeySession, didProvide keyRequest: AVContentKeyRequest)" was called again), and then error “-19152“ wad reported quickly by framework.
Error log:
contentKeySession(_:contentKeyRequest:didFailWithError:), line: XXX,
message: XXX, url: XXX, error is Domain=CoreMediaErrorDomain
Code=-19152 "(null)"
On iOS15.6.1, after "license request" was triggered
by app during downloading, framework would not trigger any "license request" again.
Root cause:
iOS Framework API(AVContentKeySession & AVPersistableContentKeyRequest) behaviors changed on iOS16.
Solution:
Add “keyRequest.processContentKeyResponse(keyResponse)” after CKC has been downloaded on iOS16+.
On iOS11 - iOS15, we didn't call it after downloading, instead we only save persistentKeyData locally, and called processContentKeyResponse when playing. That always worked fine on these iOS versions.
But on iOS16 and above(until iOS16.1 Beta4 by now), the old process would trigger framework error. So we added this fix.
The issue I had was that the keyRequest.options was not getting set as it showed up nil (in iOS 16 for whatever weird reason).
I'm passing the correct options to
processContentKeyRequest(withIdentifer identifier: Any?, initializationData: Data?, options: [String : Any]? = nil).
But in the ContentKeyDelegate functions they are showing otherwise. So, my workaround is just using a global options dictionary for storing the license URL and asset data. You can use any storage method you prefer.
I have solved the issue, the issue was with duplicate EXT tags in m3u8 files which somehow worked for iOS 15 since it picked information from the first tag whereas in iOS 16 it was using all the tags and causing a Error

FBSOpenApplicationServiceErrorDomain

Got this strange error when running a unit test. It only appears when attaching to the process when testing the target by Xcode. Testing the target without attaching debugger works. Running the test by command line tool also works. Any idea about the reason? Thanks!
DetailsThe request to open "org.cocoapods.UnitTestHost" failed.
Domain: FBSOpenApplicationServiceErrorDomain
Code: 1
Failure Reason: The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified ("null").
User Info: {
BSErrorCodeDescription = RequestDenied;
FBSOpenApplicationRequestID = 0x2594;
}
--
The operation couldn't be completed. (null)
Domain: FBSOpenApplicationErrorDomain
Code: 1
Failure Reason: (null)
User Info: {
BSErrorCodeDescription = Unspecified;
}
--
Some related error messages from the console:
SpringBoard (SpotlightUI) Reply Error on 0x600000857000:Connection interrupted
runningboardd (RunningBoard) failed to get pid for label UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy] : No such process (3)
runningboardd (RunningBoard) Failed to start job for application<org.cocoapods.UnitTestHost>: <NSError: 0x7fa02351ca80; domain: NSPOSIXErrorDomain; code: 3; reason: "No such process"> {
userInfo = {
RBLaunchdOperation = launch_get_running_pid_4SB;
RBLaunchdJobLabel = UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy];
}
}
runningboardd (RunningBoard) Launchd says label UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy] has never exited
runningboardd (RunningBoard) Removing job: <RBLaunchdJob: 0x7fa02491a110; UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy]>
Check your scheme settings and make sure all empty settings are unchecked. After doing this restart Xcode and simulator. Product menu > Scheme > Edit Scheme > Run > Arguments > Environment Variables
If there is a checkmark there with an empty field next to it, then uncheck it.
Try resetting your simulator
sudo rm -rf /private/tmp/com.apple.CoreSimulator.SimDevice.*
If it doesn't work try to restart the system.
Check Mach-O Type of your app.
Usually this error appears when you try to run Mach-Object with inappropriate type like Dynamic Library/Bundle/Static Library/Relocatable Object File. To solve the issue select Project -> Build Settings. Search Mach-O Type, change type to Executable.

CHHapticEngine not running

After a day of playing with the CHHapticEngine and custom haptic patterns, using AHAP files in particular (including adding sound samples), I have lost the sound and haptics in the deivce / iPhone. After a factory reset of the iPhone, there are still no haptics / sound in the device (no ringer, no vibrations etc.). When trying to start the haptics engine and play any pattern I can see the following output in the Xcode debugger:
2020-04-29 19:44:31.034051+0200 ProjectName[18431:5043001] [hapi] CHHapticEngine.mm:2354:-[CHHapticEngine doStartWithCompletionHandler:]_block_invoke: ERROR: Player start failed: The operation couldn’t be completed. (com.apple.CoreHaptics error 1852797029.)
2020-04-29 19:44:31.034398+0200 ProjectName[18431:5042880] [Feedback] failed to start core haptics engine for <_UIFeedbackCoreHapticsEngine: 0x28268f170>: Error Domain=com.apple.CoreHaptics Code=1852797029 "(null)"
2020-04-29 19:44:34.076491+0200 ProjectName[18431:5043124] [hapi] CHHapticEngine.mm:2354:-[CHHapticEngine doStartWithCompletionHandler:]_block_invoke: ERROR: Player start failed: The operation couldn’t be completed. (com.apple.CoreHaptics error 1852797029.)
2020-04-29 19:44:34.076703+0200 ProjectName[18431:5043124] [hapi] HapticUtils.h:56:_Haptic_Check: -[CHHapticEngine checkEngineState:]: self.running error -4805
2020-04-29 19:44:34.077641+0200 ProjectName[18431:5043124] error = Error Domain=com.apple.CoreHaptics Code=-4805 "(null)" UserInfo={Error =self.running}
The question is, is it probable to damage the hardware from code?

UIDocument save error: Could not get attribute values

I see this error in Xcode debug console when I call save(...) on my UIDocument, but it seems to have no effect on my app. Anyone know what causes it and how to stop it? I'm saving documents as a package with FileWrapper.
2018-08-12 10:24:12.818324-0400 MyApp[2694:1486251] [default] [ERROR]
Could not get attribute values for item /private/var/[...]/Documents/NewDoc.myextension (s).
Error: Error Domain=LocalStorageFileProvider.LocalFileProviderError Code=0 "(null)"

strict.lua - How do find out where the error occurred?

I am using strict.lua in a cocos2d-x project under Xcode. When I get an error it doesn't tell me where the error occurred. I just get an error message like:
cocos2d: LUA ERROR: attempt to call a number value
PANIC: unprotected error in call to Lua API (...<folder>/strict.lua:30: attempt to index a nil value)
How can I get strict.lua to tell me where the error occurred or give me a call stack?
(Note putting print(debug.traceback()) in strict.lua doesn't work)

Resources