How to show the Now Playing Tab in CarPlay? - ios

I'm working on an app that will support CarPlay.It's an audio app.
I'm able to show 2 tabs (favourite and recommended) though I just don't know how to show the Now Playing Tab. I just cannot find any info regarding this.
Do I have to manually show it, and the, how do I push? Do I have to do it manually? If so, what's the viewcontroller?
Thanks.

For the Transition to the Now Playing tab to work on both the simulator and an actual car, you need to make sure to
call beginReceivingRemoteControlEvents on the current UIApplication, and
set a nowPlayingIdentifier on the MPPlayableContentManager
before calling the completion handler in playableContentManager:initiatePlaybackOfContentItemAtIndexPath:completionHandler:.

I know this post is a couple months old, but for me, I had to test in an actual device with CarPlay. Apple says always test it on an actual device with CarPlay. At first, I didn't see a Now Playing tab in the simulator, but as soon as it was tested in a device it was there automatically. I didn't do anything special. I think CarPlay knows when you're playing audio via MPNowPlayingInfoCenter and does this automatically in the actual CarPlay device.

Related

iOS 15 focus mode development

We can set up a focus status with customized turning on time and turning off time. I'd like to be notified when I am in my own app. Unfortunately INShareFocusStatusIntentHandling was not called when a system notification "Focus on" came out. Anybody know some solutions or ideas about it. Thanks ahead!
According to https://developer.apple.com/forums/thread/682143 you need to implement an Intents Extension from your app and have that extension share the results to the main app via UserDefaults or some other method. You cannot observe the focus state changes directly in your app.

iOS Request permission dialog not showing on screen recording or quicktime video

Does anyone know when the App Store started requiring the app previews to be on a physical device and show this pop-up?
Even when I mirror my iPhone Xs to my Mac, the pop-up does not show. If no pop-up on video, app store rejects app preview.
Anyone know of a better way to get around this issue?
Another image that shows issue:
This pop-up NEVER shows on screen recording or mirroring....
We have same problem. You have two options:
You can record the screen from another mobile or camera
You can use a previous iOS. We have checked that permission dialog can be screen recorded with iOS12
What was your solution?
Yes,  has been steadily, over the past 3'ish years or so, working on removing certain system sensitive controls from being displayed in that feed. My guess it's for $SEKURITY reasons, though it doesn't completely make sense, to me, what would be the attack vector that it attempts to prevent.
The location dialog is not the only case I know that it hides. It originally started with them hiding even *** in the password text fields, and hiding the keyboard in such input, as well. Apparently it now expanded to location, and likely other system dialogs. 🤷‍♂️
Surprisingly few people seem to be discussing this.
I published an app last year (2021 / June) on 14.? which required the popup and it was accepted. Did this again with another app just after 15.? and I cannot get it past the apple store. Once they allowed me to post a video recording and I got it through, but since then ... no chance.
How are people getting their app through - I assume apple use the screen capture system to do their testing.
I had the same problem but my app was accepted.
Surely screen recording does not work, but screen capture does. I have embedded a screenshot of the permission dialog into a video and submitted it for app review.

Show several Local Notifications without creating new one

My scenario that I need to show the first Local Notification using Swift and then using the same identifier add another Local Notification, but without showing it as a popup in iOS device. So basically the flow would be like this:
Starting upload... <-- Show on the screen and adds to the Tray bar
Uploading photos... <-- Does not shows on the screen, but clears all the notifications and add another one in Tray bar silently (or changes previous one)
Uploading data... <-- Same as Uploading photos...
Finished uploading... <-- Same as Uploading photos...
Tried different ways, on Android it is not hard to do that, but iOS makes everything hard to do, is it even possible? :)
Thanks!
The reason it works on Android is because the "state showing" notifications are very Android thing. iOS is not designed for this kind of stuff because you almost never do something in the background of an app that also needs to be reflected to the user while user is outside of an app. So the real answer to your question is no. In iOS environment it is not possible to simulate Android way of showing status changes in a notification.

How is MPChangePlaybackRateCommand triggered?

I'm playing around with the audio features in iOS, and I'm looking at MPRemoteCommandCenter's changePlaybackRateCommand. I have enabled it, given it a target, and set its supportedPlaybackRates, but I don't see any related UI showing up in control center or the lock screen. And other commands I've set up, like skip forward, skip back, like, dislike, and bookmark, show up properly.
How does a user trigger a MPChangePlaybackRateCommand on iOS?
I face this problem and when I search I get other people face the same problem here
but I found something strange when I play podcast app in apple watch I found rate icon and I change the playrate from it
I think it's not work in iPhone (iPhone 6 iOS 11 ) but appear and work in another Apple devices in my case Apple watch
in iOS example here Apple not add MPChangePlaybackRateCommand like other commands that make me sure about it's bug in iOS

Can we add widget for app in iOS and if not ,is there any alternative?

I came to know that iOS does't support widgets this is what i have read.But i am making application on Security in iOS, i want the user to perform some action when he is in need of help without opening the application.
I know iOS supports few background modes like play audio,receive location updates,voip etc.
Can anyone suggest me any alternative to fire some methods without opening the application like pressing some button when in dangerous situation to call those methods.
I don't know whether we can do it or not.
But have a look.
You said we can implement background modes like audio, location, voip updates etc.
Let take the example of Audio mode. It has previous, play/pause, and next button in the lockscreen.
What you can do is play an audio when the application is in background mode.
Check whether the any of the music buttons are pressed more than 3 times. If this is the case trigger alert messages for security and send them to appropriate persons or do your own action.
I don't know whether we can do this or not. Even if it is possible, I can't say Apple will allow such false actions for buttons which are meant for some purpose.
Also see whether we can get detect volume button presses when in background mode. If that is possible you can do that. Because even my LG mobile has an SOS mode which is enabled when I press volume buton in lockscreen 4 times. Apple may allow this action if it possible

Resources