Post

Replies

Boosts

Views

Activity

Change push notification sound file, only works after iOS reboot
I have problem with an iOS app access a file in the Library/Sounds directory.My iOS app delivers different sound files in the main app bundle. I have written some code which copies a selected file into the Library/Sounds directory. It always has the same name (foo.caf) in that directory.This way I am able to switch to different push notification sounds. If I do this the first time everything works fine. But if I switch to an other app and I receive a push notification there is no sound anymore. Also the default sound isn't played. But the strange thing is, that if I reboot the iPhone and I receive a new push notification I get the newly selected sound..Does iOS have some cache or something else, which I have to reset first? Or is this an iOS bug?EDIT:I have written a small demo project to reproduce the problem. It can be found at:Source code: https://github.com/patricks/PushNotificationSoundSwitch/releasesGit Repo: https://github.com/patricks/PushNotificationSoundSwitchReadme file: https://github.com/patricks/PushNotificationSoundSwitch/blob/master/README.md
2
0
3.4k
Jan ’16
Custom Intents an localization problem
[EDIT]: I can see the Screenshot only in the edit view 😟The version with Screenshots is available here: https://stackoverflow.com/questions/61270644/sirikit-custom-intents-an-localization-problemHi,I have the problem, that Siri always responses with the english version of my intents. I have create a demo project to seperate out the relevant code:I have 3 targets in my project:The .intentsdefinition file is located in the framework (Base) and the classes are generated also there as it was suggested in the WWDC talk (2018 - 211)This file is also translated into the german language:But the problem is, that if I create a shortcut/intent via the app (INUIAddVoiceShortcutViewController viewcontroller) the action name is already in english (should be Hallo not Hello), but as you can see, the whole viewcontroller is localized in german:The strange thing is, if I select the action to see more info, the string inside this view controller is in german.If I add this shortcut to Siri, the info texts are all in german, if I use the Shortcuts.app. If I ask Siri about the state, the response is in german, but the custom response of my shortcut is in english.So does anyone know how I can fix this problem?
0
0
1.5k
Apr ’20
SwiftUI TabView with page style doesn't present dots on watchOS
Hi, I have created a TabView with TabViewStyle.page. Is there a way to present the dots on watchOS? I have written some demo watchOS project: import SwiftUI @main struct PageControllerWatchTestApp: App {     var body: some Scene         WindowGroup {             TabView {                 Color(.red)                 Color(.blue)                 Color(.orange)             }.tabViewStyle(.page)         }     } } If I try the same code on iOS the dots are presented. Is there a way to enable the dots on watchOS? I am using watchOS 9 Beta 4 with Xcode 14 Beta 4.
4
0
3.4k
Aug ’22
SwiftUI + Core Data CRUD example
Hello, is there any example how to use Core Data in a modern way with SwiftUI which also includes updating an NSManagedObjectModel? In the most examples which I found only the create and update steps are described. I am interested in the update step. Where I present an edit screen. Is it better to create a @State variable for the properties of the NSManagedObjectModel or should I load the NSManagedObjectModel from an child context and edit the properties directly? Does anyone have some up to date examples or advice for me? Cheers Patrick
0
0
707
Feb ’23
URL(string: "127.0.0.1:8000/test") doesn't create a valid URL anymore with Xcode 15 Beta 5
With Xcode 15.0 Beta 5 (swift-driver version: 1.87 Apple Swift version 5.9 (swiftlang-5.9.0.124.4 clang-1500.0.38.1)) I can't create a valid URL with the following String: URL(string: "127.0.0.1:8000/test") With Xcode 14.3.1 (Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)) this worked without any problems. Does anyone know if this is a bug or intentional?
1
0
750
Aug ’23
TipKit: Present popover tip after sheet gets dismissed
I have created a tip with a parameter (Bool) I have tried to set it to true in a sheet which is presented modally over the view which should present the popover tip. After the sheet gets dismissed the popover tip is never presented. If I restart the app, the popover tip appears. Is there any way to trigger the presentation of a popover tip manually? I have created a little demo app to demonstrate my problem: Setup TipKit on app start: import SwiftUI import TipKit @main struct TipKitDemoApp: App { var body: some Scene { WindowGroup { ContentView() .task { try? Tips.configure() } } } } Simple tip: import Foundation import TipKit struct DemoTip: Tip { @Parameter static var enabled: Bool = false var title: Text { Text("Demo Tip") } var rules: [Rule] { [ #Rule(Self.$enabled) { $0 == true } ] } } Content view which includes the popover tip and displays the sheet where the tip can be enabled: import SwiftUI struct ContentView: View { @State private var presentDetail = false let demoTip = DemoTip() var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") .popoverTip(demoTip) Button("Present Details") { presentDetail.toggle() } } .padding() .sheet(isPresented: $presentDetail) { DetailView() } } } In the detail view the tip gets enabled, but if I dismiss this view, the tip only appears after I restart the app: import SwiftUI struct DetailView: View { @Environment(\.dismiss) private var dismiss var body: some View { Button("Enable demo tip") { DemoTip.enabled = true } Button("Dismiss") { dismiss() } } }
2
0
895
Jan ’24
Warning in Xcode console: Couldn't read values in CFPrefsPlistSource
I have enabled an App Group in my App and the Widget Extension. I use it to share my UserDefaults. Every time the app starts I now get the following error message in the Xcode console: Couldn't read values in CFPrefsPlistSource<0x303034510> (Domain: group.XX.XXXX.XXXX, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd The shared UserDefaults itself works without problems. Any ideas how I could get rid of this warning?
1
0
489
Oct ’24