Posts

Post not yet marked as solved
0 Replies
387 Views
When a user is in a Facetime call and accepted the SharePlay request, I want to push a specific ViewController. So I thought it would be same as to get notification when the user tap "accept". But this was not the case. Nothing were printed out in the logs. Is there another way to know when the app (in the background or terminated) is launched or openend by accepting a SharePlay request ? import UIKit import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. // to perform action when notification is tapped UNUserNotificationCenter.current().delegate = self registerForPushNotifications() return true } func registerForPushNotifications() { UNUserNotificationCenter.current() .requestAuthorization(options: [.alert, .sound, .badge]) { [weak self] granted, error in print("Permission granted: \(granted)") guard granted else { return } self?.getNotificationSettings() } } func getNotificationSettings() { UNUserNotificationCenter.current().getNotificationSettings { settings in print("Notification settings: \(settings)") guard settings.authorizationStatus == .authorized else { return } DispatchQueue.main.async { UIApplication.shared.registerForRemoteNotifications() } } } extension AppDelegate : UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { let application = UIApplication.shared if(application.applicationState == .active){ print("user tapped the notification bar when the app is in foreground") } if(application.applicationState == .inactive) { print("user tapped the notification bar when the app is in background") } guard let rootViewController = (UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate)?.window?.rootViewController else { return } // Do some work completionHandler() } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
501 Views
I am new using C++ libraries, so it would be nice if you could answer with a bit more details so that I can understand it too. My goal is to add an external C++ library, namely giac/xcas, into my iOS project. I looked for some information and I came up to his point: create a static/dynamic library add this library to the project write an Objective C++ - Wrapper So following the instructions on giac/xcas homepage I am able to build a .a-library for the x86_64 architecture. When adding to my project, Xcode gives obviously the message: Building for iOS but the linked library 'libgiac.a' was built for macOS. Now, I found out that I have to compile the c++ library for another architecture using flags. And now here is the problem. I do not know how to achieve this. I think I shall go to the specific folder and configure via ./configure something here It would be nice if you can help me. Thanks in advance!
Posted Last updated
.