Post

Replies

Boosts

Views

Activity

CoreData CloudKit Sync not working between iPad and iPhone
I have an application that uses CoreData as a persistent storage and recently implemented the support for iCloud-Sync. All works fine with my test devices (iPhones) and for most my users the synchronisation works as intended. However I have been getting a few emails lately, notifying me that the iCloud synchronisation does not seem to work for some users. All of those users are using iPhone devices and are trying to sync the data of the app to an iPad (or the other way around). It also only seems to be working one-sided. Data which is created on the users iPad syncs to their iPhones fine, however the iPhones data does not sync to their iPad. I think this is a weird issue and I haven't been able to resolve it yet. My app is designed for iPhone (iOS) only so far, so the iPad users are using the iPhone version on their iPad. What could cause this issue and how can it be resolved? Would be really grateful for some guidance!
7
0
1.7k
Nov ’21
LocalNotifications not working properly
Hello, I have an issue with LocalNotifications on my App. On my App the user can schedule a Notification to get a reminder when a contract expires. He can choose the date and time himself. However I have repeatedly been getting E-Mails from users, saying that their Notifications do not work. When testing on my own personal device however, I have no issue and they work fine. I was wondering if I was missing some comprehension about LocalNotifications. Do they expire at some point? Does the UNUserNotificationCenter delete queued notifications when a device is turned off? Are there any possible reasons for this behaviour? Any help would be greatly appreciated as I couldn't find any info online. I included my code for creating a LocalNotification below: /**      Schedules a local notification.      - parameter company: String! of the contracts company name.      - parameter name: String! of the contracts name.      - parameter datum: Date! of the reminder.      - returns: String of NotificationID.      */     static func scheduleNotification(company: String!, name: String!, datum: Date!) -> String! {         let notificationID = arc4random()         let content = UNMutableNotificationContent()         content.title = NSLocalizedString("Kündigungserinnerung ", comment: "") + company         content.body = NSLocalizedString("Falls Sie Ihren ", comment: "") + name + NSLocalizedString(" Vertrag kündigen möchten, wäre jetzt der richtige Zeitpunkt dafür! 📄", comment: "")         content.categoryIdentifier = Notification.Category.Local.identifier         content.userInfo = ["NotificationID": notificationID]         content.sound = UNNotificationSound.default()         let calendar = Calendar.current         let components = calendar.dateComponents([.year, .month, .day, .hour, .minute], from: datum)         let finalComponents = NSDateComponents()         finalComponents.year = components.year!         finalComponents.month = components.month!         finalComponents.day = components.day!         finalComponents.hour = components.hour!         finalComponents.minute = components.minute!         let trigger = UNCalendarNotificationTrigger(dateMatching: finalComponents as DateComponents, repeats: false)         let requestIdentifier = "request"         let request = UNNotificationRequest(identifier: requestIdentifier, content: content, trigger: trigger)         UNUserNotificationCenter.current().add(request, withCompletionHandler: { error in             if error != nil {                 log.error(error!)             }         })         return String(notificationID)     }
1
0
576
Aug ’20