Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
- fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
- redirectToScreen(notificaiton: userInfo)
- completionHandler(UIBackgroundFetchResult.newData)
- }
- //Notify through Notification center
- func redirectToScreen(notificaiton: [AnyHashable: Any]) {
- NotificationCenter.default.post(name: NSNotification.Name.init(rawValue: "handlePush"), object: dict)
- }
- //Observer goes here and call API
- let spinner = showLoader(view: self.view) // App goes stuck here and loaded process continuously, response is not getting
- Alamofire.request(kURl, method: .post, parameters: param, encoding: URLEncoding.httpBody, headers: nil).authenticate(user: R.string.keys.basicAuthUsername(), password: R.string.keys.basicAuthPassword()).responseSwiftyJSON(completionHandler: {
- spinner.dismissLoader()
- })
Add Comment
Please, Sign In to add comment