0

I have a video calling application now issue is that if the user declines the permission and once the user grants the camera access permission then the iOS application restarts then how I can know the application restart due to permission change?

Is there any method called from appdelegate before restart or after restart?

func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

}
    
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
        return orientationLock
}
    
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
}
    
func applicationDidEnterBackground(_ application: UIApplication) {
}
    
func applicationDidBecomeActive(_ application: UIApplication) {
}

func applicationWillTerminate(_ application: UIApplication) {
}

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {

}
Chirag Shah
  • 3,034
  • 1
  • 30
  • 61
  • No, There isn't any function for that. – Hammer Class Apr 21 '22 at 09:29
  • @HammerClass how zoom will manage such things. if you connect in the call and do not give video permission and go to setting and grant permission then the application will be restarted and a call will auto connected. if there will be no method then how do they manage? – Chirag Shah Apr 21 '22 at 09:31
  • You can add your own checks. For example when you ask user camera permission and user denies it save it in Userdefaults. Now suppose User has open setting and given the permission to camera now on application start didbecomeActive function you can check your previous saved value of permission and your current permission status if it is changed you can do whatever you want with it. – Hammer Class Apr 21 '22 at 09:34
  • @HammerClass thanks for the quick replay. your solution is good but I need some more precise answer. I am sure zoom did not do that. – Chirag Shah Apr 21 '22 at 09:38
  • 1
    The rest I can assure you that there isn't any function that will identify if the application was restarted by permission change. Happy Coding. – Hammer Class Apr 21 '22 at 09:44

0 Answers0