Posts

Post not yet marked as solved
1 Replies
358 Views
Since iOS 17 is out I am getting crashes in my Driving Task CarPlay app. It is as if the System tried to push a CPNowPlayingTemplate to my app, and that template, according to the documentation, is not allowed for a Driving Task CarPlay app. I get the following error: Fatal Exception: NSInvalidArgumentException Unsupported object <CPNowPlayingTemplate: 0x283944c60> <identifier: 3195B357-D184-41BF-91CA-399C5810A8EA, userInfo: (null), tabTitle: (null), tabImage: (null), showsTabBadge: 0> passed to pushTemplate:animated:completion:. Allowed classes: {( CPInformationTemplate, CPListTemplate, CPAlertTemplate, CPActionSheetTemplate, CPTabBarTemplate, CPGridTemplate, CPPointOfInterestTemplate )} My app, from time to time, plays some sounds to warn the driver about issues in the road. Maybe that can trigger (in which cases?) the now playing template to be pushed to my app. Is this an iOS 17 bug? Is there a way to work around it? Thank you.
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.5k Views
I have an app with the "Driving Task" CarPlay entitlement. When I ask for permission for notifications in CarPlay (UNAuthorizationOptionCarPlay), and I check "carPlaySetting" in the UNNotificationSettings after granting permission, it get a value "UNNotificationSettingNotSupported" (the setting is not available to your app). Is this a bug? It feels like one. The app shows distances to some locations, and provides warnings to the user when approaching those locations. It is common for my users to use it at the same time they use a navigation app and switch between the two apps. But when they have the navigation app in foreground, they ask why my app is not showing notifications when giving an audio warning. The notifications are not even shown on the screen of the iPhone, the screen is turned off in iPhone 14 Pro when connecting to CarPlay, and the screen does not turn on when the app is in background in CarPlay and tries to show a notification.
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.4k Views
In my app, which gives voice prompts and sound warnings while driving, I test if the audio session is connected to CarPlay in order to use CarPlay settings for AVAudioSession by doing: BOOL found = NO; for (AVAudioSessionPortDescription * portDescr in [AVAudioSession sharedInstance].currentRoute.outputs) { if ([portDescr.portType isEqualToString:AVAudioSessionPortCarAudio]) found = YES; } This has worked for several years. But now, in iOS 16, when the app is in background, it won't detect that the iPhone is connected to CarPlay most of the times by using this method. Therefore, I will set up the audio session in a way which won't play any sound to the user. I have seen this happening in other apps such as Google Maps. So my guess is that something is not working in iOS 16 an AVAudioSession in background. Has anyone experienced this? Any workaround? I tried notifications to detect a change in a route, but sometimes I wouldn't get the notification if the app was in background when connecting to CarPlay. So this workaround didn't work either. Any ideas? Thank you.
Posted Last updated
.
Post not yet marked as solved
0 Replies
523 Views
I am thinking about adding turn by turn navigation to some of my apps by using a combination of all the functionality MapKit offers. I know it wouldn't be as good as Apple Maps, but navigation with the functionality the apps already offer would be really good. The questions are: Can MapKit be used to implement turn by turn navigation? I haven't found anything in the documentation against it. Can MapKit be used to provide turn by turn navigation in CarPlay? I haven't found anything in the docs either, but I think I remember an old WWDC video where the presentar said you had to bring your own maps, they couldn't be from MapKit. This video I think it was from the first year CarPlay was released. Thank you.
Posted Last updated
.
Post marked as solved
1 Replies
1.7k Views
In AVAudioSession, I am using the option "AVAudioSessionCategoryOptionDefaultToSpeaker" with the category "AVAudioSessionCategoryPlayAndRecord", as the documentation says. In iOS 15 and before, it worked when the app in foreground and in background In iOS 16, it works in foreground, but when the app is in background, the sound is sent to the receiver, not to de speaker, and I get this in the log: AVAudioSession_iOS.mm:2374  Failed to set category, error: '!int' Is this a bug or is it the intended behaviour? Is there any workaround or way to force the iPhone to send the sound to the speaker when the app is in background in iOS 16?
Posted Last updated
.
Post marked as solved
2 Replies
1.2k Views
I have a watch app which is receiving location updates every second, so it is being executed in the background even if the wrist is down. I thought this would qualify the app to update the user interface every second, but it is not working. I set a breakpoint where the user interface is updated, and the code is being executed but I get no update in the user interface. I have tested this both in the simulator and in the device. Should this work with an app which gets locations updates? I thought it would make sense for an app like this. The app is written in objective-C if that makes it any different. Thank you.
Posted Last updated
.
Post marked as solved
3 Replies
1.4k Views
I have been using the following shortcut since iOS 12 with no issue. But in iOS 14.3 it has stopped showing up in the Shortcuts app. In iOS 14.2 it does show up. This can be tested with the simulator: NSString * title = NSLocalizedStringFromTableInBundle(@"Traffic status", nil, [LanguageModel sharedInstance].languageBundle, nil); NSString * activityType = [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"] stringByAppendingString:kUserActivityTrafficMap]; NSUserActivity * userActivity = [[NSUserActivity alloc] initWithActivityType:activityType]; userActivity.eligibleForSearch = YES; userActivity.title = title; userActivity.eligibleForPrediction = YES; userActivity.suggestedInvocationPhrase = title; CSSearchableItemAttributeSet * attributeSet; if (@available(iOS 14, *)) attributeSet = [[CSSearchableItemAttributeSet alloc] initWithContentType:UTTypeItem]; else attributeSet = [[CSSearchableItemAttributeSet alloc] initWithItemContentType:(NSString *)kUTTypeItem]; attributeSet.thumbnailData = UIImagePNGRepresentation([UIImage imageNamed:@"UserActivityMapa"]); attributeSet.contentDescription = NSLocalizedStringFromTableInBundle(@"Shows the traffic around you", nil, [LanguageModel sharedInstance].languageBundle, nil); userActivity.contentAttributeSet = attributeSet; self.mapViewController.userActivity = userActivity; Is this a bug in iOS 14.3? Am I missing something? Thank you.
Posted Last updated
.