UILocalNotification in background Swift -
hello guys have question, how can receive notification when app closed? right when i'm near position i'll receive notification inside app , when i'll left position i'll receive notification, don't know how can receive same notifications when app closed. have used 3 functions:
// 1. user enter region func locationmanager(_ manager: cllocationmanager, didenterregion region: clregion) { showalert(title: "enter \(region.identifier)") } // 2. user exit region func locationmanager(_ manager: cllocationmanager, didexitregion region: clregion) { showalert(title:"exit \(region.identifier)") } func showalert(title: string) { let alert = uialertcontroller(title: title, message: nil, preferredstyle: .alert) alert.addaction(uialertaction(title: "cancel", style: .default, handler: { (action) in alert.dismiss(animated: true, completion: nil) })) self.present(alert, animated: true, completion: nil) }
thanks lot.
Comments
Post a Comment