dalodd / alamofire-synchronous Goto Github PK
View Code? Open in Web Editor NEWSynchronous requests for Alamofire
License: MIT License
Synchronous requests for Alamofire
License: MIT License
Hi,
At WWDC23 Apple announced that apps and SDKs that make use of "required reason" APIs and "Data Collection", "Tracking" will need to provide a privacy manifest.
Does Alamofire-Synchronous need to include this manifest?
https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests
https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api
I have insert in my podfile both "Alamofire" and "Alamofire-Synchronous":
pod 'Alamofire', '> 4.0'> 4.0'
pod 'Alamofire-Synchronous', '
When i try to install the podfile, I'll give this error:
"[!] Unable to satisfy the following requirements:
Alamofire-Synchronous (~> 4.0)
required by Podfile
None of your spec sources contain a spec satisfying the dependency: Alamofire-Synchronous (~> 4.0)
.
You have either:
pod repo update
.Note: as of CocoaPods 1.0, pod repo update
does not happen on pod install
by default."
I've also update CocoaPods to last version.
Has anyone encountered the same problem?
I try to use 4.0 version under Xcode 10.1, Swift 4.2 and to crashed when accessing responseString().
Alamofire 4.1 is support to ios 8+
but use pods have to ios 9+
作者你好,
我在使用的时候,不管是放在主线程中还是回调中,都会导致主线程以及界面卡死,而且一直返回不了数据,请问你在使用的过程中遇到这样的问题吗?
我用的是Swift2.1 Xcode7.1.1 iOS9.1
谢谢!
it would be fun to have a way to not always use the extension in a given solution.
also we didn't find a way to use the pods without copying the code in the solution...
Maybe I'm missing something, but is there an option to perform the operations with Alamofire-Synchronous while getting the request variable to store it?
I'm looking to cancel the request (or all of the current requests) but I can't store the request as I always need to get the response to perform it synchronously.
How would you just grab and store the request, or if not is there a way to cancel the request?
Hi,
I would like to ask you if is possible to add upload request synchronous please?
Alamofire.upload(data, to: url)
Thank you,
Michal
I switched to Xcode8 / Swift3 / Alamofire4 and get this compilation error when call responseJSON()
Expression type 'DataResponse' is ambiguous without more context
let parameters:Parameters = [
"userName": user,
"passwordHash": passHash,
"appVersion": "MobilePrototype1"
]
let response = Alamofire
.request(loginServiceAddress, method: .post, parameters: parameters, encoding: .JSONEncoding.default)
.validate()
.responseJSON()
Hi,
I found this problem now: Alamofire+Synchronous.swift:68:24: Cannot call value of non-function type 'HTTPURLResponse?'
public func responseData() -> DataResponse<Data> {
return response(responseSerializer: DataRequest.dataResponseSerializer())
}
public func responseJSON(_ options: JSONSerialization.ReadingOptions = .allowFragments) -> DataResponse<Any> {
return response(responseSerializer: DataRequest.jsonResponseSerializer(options: options))
}
public func responseString(_ encoding: String.Encoding? = nil) -> DataResponse<String> {
return response(responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding))
}
public func responsePropertyList(_ options: PropertyListSerialization.ReadOptions = PropertyListSerialization.ReadOptions()) -> DataResponse<Any> {
return response(responseSerializer: DataRequest.propertyListResponseSerializer(options: options))
}
public func responseData() -> DownloadResponse<Data> {
return response(responseSerializer: DownloadRequest.dataResponseSerializer())
}
public func responseJSON(_ options: JSONSerialization.ReadingOptions = .allowFragments) -> DownloadResponse<Any> {
return response(responseSerializer: DownloadRequest.jsonResponseSerializer(options: options))
}
public func responseString(_ encoding: String.Encoding? = nil) -> DownloadResponse<String> {
return response(responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding))
}
public func responsePropertyList(_ options: PropertyListSerialization.ReadOptions = PropertyListSerialization.ReadOptions()) -> DownloadResponse<Any> {
return response(responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options))
}
It just sleeps when calling any request. And never gets back. It just calls "dispatch_semaphore_wait" and then never comes to the success block.
Hello,
I have a little problem with Alamofire-Synchronous..
1/ To use this library in my project, i drag and drop "Alamofire+Synchronous.swift" to the project tree
2/ When i want to use, I have a error "Extra argument in call"
My code :
let Paramètres = [ "Login": textfieldLogin.text!, "Password" : textfieldMotDePasse.text! ] let recupJsonSync = Alamofire.request(method: .POST, "http://www.myurl.com/api/login", parameters: Paramètres).responseJSON()
Have you an idea for solve my problem ?
Thank you for your help :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.