AirPlay Meta Data on Apple TV from Mac App - macos

I am using the class MPNowPlayingInfoCenter to set a song's meta data in an iOS app. How do I set it in an OS X app?

Before Mountain Lion (OS X 10.8), there was no official 3rd party support for AirPlay, although iTunes has integrated it for a long time.
Mountain Lion added a control to allow the user to choose the audio output. However, this happens outside of your app and there are still no public APIs to control AirPlay.
There are several 3rd party implementations of AirPlay. The most famous being AirFoil. They have a public API to display metadata. However, it relies on AppleScript, which doesn't work with the new App Store sandbox.
This is the big picture. Feel free to ask more if you need clarifications.

Related

Mac app rejected as not open in new mac OS 10.14

I have submitted app twice in mac app store and they have rejected with below reason.
Guideline 2.3 - Performance
Your app does not achieve the core functionality described in your marketing materials or release notes.
Specifically, App does not launch from Finder. App icon momentarily appears on Dock but quit itself before being launched.
Best regards,
App Store Review
While I further followed up with apple then they have informed that app is not open in mac 10.14 OS.
Have any one face similar kind of issue and what is resolution steps for such kind of issue?

Crash reports for OS X apps

How does one obtain crash reports uploaded to Apple for OS X apps? A user reported a crash with one of my OS X apps, and said he shared the report with Apple. Using XCode 8, I do not see any crash reports for that version or any version of my macOS app. I do see crash reports for an iOS app in XCode.
In iTunes connect, if I navigate to the current version of the OS X app, under the "App Store" tab there is a link for "Crash Reports" at the bottom of the page, but clicking this navigates to a generic FAQ for crash reports, and this has a link which explains how to view crash report in XCode for iOS apps.
I have searched the web for an answer, without success. Is it not possible to get macOS app crash reports?
I may have found my answer in Apple Technical Note TN2123: https://developer.apple.com/library/content/technotes/tn2004/tn2123.html
CrashReporter currently has a number of limitations.
There is currently no way for third party developers to access the reports submitted via CrashReporter. Apple is aware that there is strong demand for such a facility (r. 3356232). In fact, various third party developers have implemented their own crash reporting mechanisms: these range from the simple (have the application look at its own crash log file at launch time; if it has changed, offer to submit it to the developer) to the exceeding complex (completely reimplement CrashReporter).
This was last updated in 2008.

drag & drop photos from app "Photos" to third party app under OS X El Capitan

I got a lot of support requests from my Mac App Store apps describing drag & drop photo from Apple's app "Photos"(what a xxxx name they are using as an app!) to my app appears impossible under OS X El Capitan. That was ok in iPhoto ages.
The sandbox settings of my apps are all YES to these entitlements:
com.apple.security.assets.movies.read-write
com.apple.security.assets.pictures.read-write
com.apple.security.files.user-selected.read-write
What I have to do is asking user drag & drop photos to their desktop first then drag & drop again to my app.
Anyone got this kind of problem for your third party apps and how can we fix it in OUR upgrade?
Currently the Photos app uses File Promises when dragging files. (There is talk that this maybe will be changed because very few app handle file promises.)
You find more information about this in Drag and Drop Programming.
For dropping promised files on to application icon in Dock see my answer here.
I created a sample project to demonstrate how you can do it here:
https://github.com/x43x61x69/Promised-files-Example

AVKit in OSX 10.8

We're developing an OSX app that have to be supported by OSX 10.7 to 10.9. We're currently using QTKit and QTMovieView to show videos, but when trying to upload a new version recently we got this error message:
Deprecated API usage. Apple no longer accepts submissions of apps that use QuickTime APIs.
We have also tested to set the Base SDK to 10.8, but same result there.
And changing to AVKit and AVPlayerView does not work for version prior to 10.9.
So is there a way to use AVKit for versions prior to 10.9 or some way to publish an app with QTKit?
You can't use AVKit on OS X versions prior to Mavericks.
But AVKit is a very small framework that only consists of a player view that has some advanced features out of the box (e.g. chapter navigation, selection & trimming, ... - similar to QTMovieView).
If your app doesn't require those features, you can easily implement a view with simple playback functionality with AVFoundation-only classes (AVFoundation was introduced with OS X 10.7).
Instead of AVPlayerView, you can use a combination of AVPlayer & AVPlayerLayer.
There is some Apple sample code that shows how to build a DIY player view here:
https://developer.apple.com/library/mac/samplecode/AVSimplePlayerOSX/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011060
This custom player view supports:
Play/Pause
Rewind
Playback progress
Fast forward
Volume control

Timeline for mac sandbox entitlements and related features

I understand that sandbox was introduced in Mac OS X Lion (10.7) but temporary exception entitlements, specifically com.apple.security.temporary-exception.files.home-relative-path.read-write, were introduced in a later 10.7.x update (which one?)
Similarly security scoped bookmarks were introduced in 10.7.3.
My Mac app (not currently sandboxed) is a document based app that creates documents that have references to pictures on users' mac. Once a user uses some pictures in his document we simply save the path (for eg. /Users/myname/Desktop/pic.jpg) of used picture in that document. When a user quits the app and reopens the saved document, our app can simply get access to the picture using the path from the document. Since our app is not sandboxed this works on all versions 10.6.x, 10.7.x, and 10.8.x
We would now like to sandbox our app and ensure that it continues to work on all versions (10.6.x, 10.7.x, and 10.8.x) of Mac OS X. To achieve this, we will
Ask for a temporary exception entitlement, specifically com.apple.security.temporary-exception.files.absolute-path.read-write and this will enable random file access for 10.7.3 onwards. But what do we do for 10.7, 10.7.1, and 10.7.2?
Beyond 10.7.3 we will start using security scoped bookmarks.

Resources