Alamofire request gets stuck when entering background?

Alamofire request gets stuck when entering background?

By : Brandon Hughart
Date : November 20 2020, 11:01 PM
I think the issue was by ths following , You can use background fetching to solve this problem. It can be done in the following way in Swift 3:
code :
    var backgroundTask: UIBackgroundTaskIdentifier? // global variable        

    backgroundTask = UIApplication.shared.beginBackgroundTask(withName: "backgroundTask") {
        // Cleanup code should be written here so that you won't see the loader

        self.backgroundTask = UIBackgroundTaskInvalid
    self.backgroundTask = UIBackgroundTaskInvalid

Share : facebook icon twitter icon
Entering username and password for Alamofire request

Entering username and password for Alamofire request

By : Dhanesh Gautam
Date : March 29 2020, 07:55 AM
around this issue I'm trying to use Alamofire to do a GET request for my iOS app, but I don't really know how to enter my username and password. , Apparently there is a thing for this in Alamofire. I need to do...
code :
Alamofire.request(.GET, self.baseURL + method, parameters: nil)
    .authenticate(user: self.username.text, password: self.password.text)
    .responseJSON { (_, _, JSON, _) in
Alamofire request when app in background

Alamofire request when app in background

By : Nilesh Yendhe
Date : October 31 2020, 01:49 PM
hop of those help? I think @Paulw11 answer your question in his comment, you can't use NSTimer in background, Apple has a known list of the task that can be produced in background, you can read more here.
But let think for a moment what you're trying to achieve, let suppose you can do it using NSTimer, then you have your app in background consuming memory and battery in your device constantly to try to get the updates from your server, this is not recommended at all.
How to execute alamofire background upload request?

How to execute alamofire background upload request?

By : Ajay Babu
Date : March 29 2020, 07:55 AM
hop of those help? from Background Transfer Considerations :
code :
appDeligate.log.debug("request was sended")

let tempZipFilePath = UtilDirectory.tempZipPath.tweak()

                        to: deligate.url,
                        method: .post,
                        headers: headers)
Alamofire request stuck on return to foreground?

Alamofire request stuck on return to foreground?

By : suedadam
Date : March 29 2020, 07:55 AM
wish helps you It turns out I misdiagnosed the issue. The Alamofire request was still running and resuming when brought to foreground. The issue was really our UIRefreshControl got stuck due to a bug in the UIRefreshControl UIKit library. Implemented a workaround for that issue and we were good.
Does Alamofire request actually run in the background thread?

Does Alamofire request actually run in the background thread?

By : Aureus
Date : March 29 2020, 07:55 AM
hop of those help? I'm using Alamofire for the first time and I have a question. I searched and found a similar post on stackoverflow but the answers are very confusing, even the documentation is confusing. Alamofire is pretty convenient because I don't have to create session and tasks. However, I have used DispatchQueue before and I know for it runs the tasks in background thread and update UI on main thread but I don't know if Alamofire does the same. Please reply if you know. Thank you. ,
Does Alamofire request actually run in the background thread
Related Posts Related Posts :
  • Get IndexPath Value in UICollectionViewCell Class
  • 2d NSArray with enumerated types in objective-c
  • Return the bool statement directly VS using if to return bool
  • Touch ID: Biometry is locked out. Code=-8
  • Values are not updating in my text label from api calling
  • how to manage Height of UITableHeaderView in based on webview content using auto layout
  • viewDidLoad vs ViewWillAppear in IOS
  • Presenting a detail view controller from a map annotation in swift 3?
  • What is industry standard for when to push/pull between core data and remote database
  • Error when moving objects between NSMutableArray
  • Assigning values to class instance from json output
  • Does Facebook SDK support Swift 2.3/3.0?
  • google maps iOS SDK: custom icons to be used as markers
  • Difficulty reading UserDefaults with Fastlane Snapshot
  • Find individual load time of Dynamic Libraries to identify which library consumes more time to load in IOS
  • Can I add local and remote notifications in my iMessage extension?
  • UIImage goes where i tap (But i need it so you can ONLY drag it)
  • How to handle launch options in Swift 3 when a notification is tapped? Getting syntax problems
  • Mismatched colors on UINavigationBar and UISearchBar
  • iOS app that collects data from "Accu-Chek Aviva Connect" BG meter. (Bluetooth Low Energy)
  • How to make a Sprite node spin when a user taps the screen? Swift 3
  • React Native (iOS) app loads nicely on wifi; crashes on LTE/cell
  • How to use GADRewardBasedVideoAd
  • Get game request ID / Access Facebook game request notification content
  • Error opening shared document via CloudKit
  • SKPhysicsJointLimit has a elastic behaviour, but i need a strong rope simulation
  • Handing a response in a controller after segueing to another controller
  • iOS swift: App Transport Security has blocked a cleartext HTTP (http://) resource
  • Full Screen layout for in Xcode 8
  • Provisioning Profile issue after switching to new iPhone in XCode 8
  • how can I center my map on the annotation view only when it is close to the edge of the screen?
  • How can I choose phone number in INSendPaymentIntent
  • Unrecognized selector error trying to use a tap gesture recognizer
  • How to create an image pixel by pixel
  • How can I detect scrolling for update before end dragging event in iOS?
  • GLSL transparency issue only on iOS
  • Tableview simple display value
  • How to display tableview section headers with long text in multiple rows?
  • IOS 10,What's the current syntax for JSQMessagesAvatarImageFactory.avatarImage(Unknow parameters)
  • Passing data with protocols without going back to original controller
  • how do I set a variable to get value from Firebase database structure in Swift
  • Scroll to Table View Header top
  • Custom shape UIButton
  • ImageView of a custom CollectionViewCell is nil when it should be configured
  • Where to set UIRectCorner inside UITableViewCell
  • UINavigationBar frame height returns 44.0 but is actually 64.0
  • Run Xcode 6.x on macOS Sierra 10.12
  • meteor cordova build error for ios platform
  • detailTextLabel doesn't show
  • Navigate to specific TabBar item
  • How to alphabetize an array of objects within Swift 3?
  • swift realm::IncorrectThreadException: Realm accessed from incorrect thread
  • Xcode 8, unable to run the app on device, suddenly there is an error "An invalid key was encountered"
  • inline bool objc_object::isTaggedPointer(); How does the function work?
  • Invalid session toked after deleting a user Parse Server Swift
  • Sharing a file with data in it by UIActivityViewController
  • Firebase Push Notifications
  • Creating a webpage and asyncronously loading app data off of it
  • Use of unresolved identifier 'enumerate' after Swift Migration
  • Max value for each object in an Array of Dictionaries
  • shadow
    Privacy Policy - Terms - Contact Us © soohba.com