Post

Replies

Boosts

Views

Activity

CarPlay plays but appears paused
I have my CarPlay app working rather well. The content items appear; when the user taps an item, it plays; and the Now Playing screen shows the item being played.BUT – the first time this is done after connecting to CarPlay, the Now Playing screen thinks that playback is paused. The big button in the middle is adrawn as a Play button, and although the duration of the item is shown, its position remains at zero. Meanwhile the sound is playing perfectly.If I then tap on the Play button, a Play MPRemoteCommand is sent to the app, which ignores it (because already playing), so the sound continues. But the Play button in the Now Playing screen now turns into a Pause button, and the progress bar now starts to move forward, one second per second, from the correct position (that is, if I wait 10 seconds before tapping Play, the bar will start at 10 seconds not at 0).From now on, everything is in step. Pausing and playing work as expected, both in function and in their effect on the Now Playing screen.Here is the complete Now Playing info which is set when playback begins [logged directly by NSLog]. It is set immediately after playback has begun. MPNowPlayingInfoPropertyElapsedPlaybackTime = 0; MPNowPlayingInfoPropertyPlaybackRate = 1; albumTitle = Instructions; albumTrackCount = 1; albumTrackNumber = 1; artwork = "<UnivAlbumArtwork: 0x600003856de0>"; playbackDuration = "44.93757936507937"; title = "Download Instructions";I am hoping that someone else has come across this and can tell me what I should be doing that I'm not! All this is being tested in the simulators on both Xcode 9 and Xcode 10, and this is the only anomaly.
2
0
3.0k
Aug ’18
Defining custom file types
On iOS:When one receives a file of type .pages by email, Mail displays a large Pages icon and tapping on it opens Pages. (A long-press brings up the more complicated Actions screen).When one receives a file of type .vcf by email, Mail displays a large Contacts icon and tapping on it opens Contacts. (A long-press brings up the more complicated Actions screen).I have my own custom file type, .ripf, and I want to have the same behaviour because that is what my users will expect. Accordingly, in my app's Info.plist I have a CFBundleDocumentTypes dictionary providing a one-element LSItemContentTypes array referring to the name 'com.universalis.ripcard', and a UTExportedTypeDeclarations dictionary associating the UTTypeIdentifier 'com.universalis.ripcard' with a public.filename-extension 'ripf' and a public.mime-type 'text/vnd.universalis.ripcard'. All the other entries in those two dictionaries are present and correct as far as I can tell. Both CFBundleDocumentTypes[0].CFBundleTypeIconFiles and UTExportedTypeDeclarations[0].UTTypeIconFiles contain a list of icon files for the file type.(That rather long paragraph is to avoid boring people by including the entire Info.plist!)Some things do work..ripf files received via AirDrop bring up a suitable "Open with..." message which mentions my app, and tapping the message opens the app..ripf files received as an email attachment display as an icon. But it is the app's icon and not the icon of the file type.BUTTapping on a received file's icon does not open the app, but only opens the generic Actions screen, offering Message, Mail, WhatsApp, Notes, and only then (after the user has scrolled sideways) "Copy to..." my app.Now, the whole apparatus of CFBundleDocumentTypes and UTExportedTypeDeclarations is obscure and under-documented, and indeed the main documenation for the latter has a big warning at the top saying that it is obsolete and not being updated. That doesn't matter so much. What I need to know is:(Less important): How do I get the right file icon?(More important): How do I get my app to open when the icon is tapped, as Pages and Contacts do? There must be a way – unless special cases for those two apps are wired into iOS itself.
9
0
5.6k
Nov ’18
Universal Links to multiple apps
I have successfully implemented Universal Links so that a visitor to specific URLs on our site is redirected to one of our apps. It all works well. Alarmingly well, in that it all worked perfectly first time. (I blame the documentation). A question I can't find specifically addressed in the documentation is: what if we have two apps that can both handle a given link? This is in fact our situation. In most cases users will have one or other of the apps installed. The correct behaviour would then be to direct the user to the installed app. In some cases the user will have both apps installed. In that case the ideal behaviour would be to direct the user to what we have defined to be the "main" app. It looks to me as if it is possible to two apps in an apple-app-site-association file, but not having found this in the documentation, I wonder: has anyone on here actually tried this? Did it work as expected?
3
0
11k
Jun ’20
Dates without years?
Our app allows users to set anniversaries: think of a birthday as an example. This means that the user needs to be able to enter a day-month-year date or a day-month date. At present we have to synthesise a clone of UIDatePicker which allows "----" as an additional year after "2020". Does the new UIDatePicker have any ability to make the year optional?
1
0
739
Jun ’20
Now Playing info error with CarPlay on iOS 18
Our app, Universalis (Apple ID 284942719) plays audio successfully on all versions of iOS up to and including iOS 17. It uses the old MediaPlayer interface because it is targeted at versions all the way down to iOS 12. On iOS 18, it plays audio but CarPlay fails to show the Now Playing screen. Instead, a message box pops up in CarPlay saying "There was a problem loading this content", with an OK button. Nevertheless the audio plays correctly. This has been reported in the wild by a user of iOS 18 with CarPlay. I am also able to reproduce it locally, running the app in Xcode with the CarPlay Simulator, with an iPhone using iOS 18.0 or iOS 18.1. Earlier versions work correctly. Looking at the console log in CarPlay, the following error message appears about 10 seconds before the error message pops up: MSVEntitlementUtilities - Process Universalis PID[1173] - Group: (null) - Entitlement: com.apple.mediaremote.external-artwork-validation - Entitled: NO - Error: (null) The message has an orange background which appears to mean that it does not come directly from NSLog in the app. The message appears immediately after the request handler of MPMediaItemArtwork has been called requesting a 128 x 128 image and has successfully returned a 128x128 UIImage object. This has been reported through Feedback Assistant: Bug report ID is FB15343941 How can we work round this error?
3
0
391
Oct ’24