promisekit / pmkalamofire Goto Github PK
View Code? Open in Web Editor NEWPromises for Swift & ObjC
Home Page: http://mxcl.dev/PromiseKit
License: MIT License
Promises for Swift & ObjC
Home Page: http://mxcl.dev/PromiseKit
License: MIT License
Hmm. I just did a carthage update --platform ios
and I can't build PMKAlamofire because Info.plist
is missing, yet still referenced in the project file. My Cartfile specifies ~> 3.2
.
Build fails with Xcode 15 with
Carthage/Checkouts/PMKAlamofire/Sources/Alamofire+Promise.swift:4:8: error: compiling for iOS 10.0, but module 'PromiseKit' has a minimum deployment target of iOS 11.0: /var/folders/dy/5d6q6ql14vsdykk55lm213yc0000gn/T/carthage-xcframework-Rzow/PromiseKit.framework/Modules/PromiseKit.swiftmodule/arm64-apple-ios.swiftmodule
import PromiseKit
^
To repro:
cat >Cartfile <<EOF
github "PromiseKit/PMKAlamofire" ~> 5.0
EOF
carthage update --platform ios --use-xcframeworks --log-path ~/Downloads/update.log
I'm not sure of the Right Way, but I will try to fix it and submit a PR.
I'm unable to get the readme example code to compile with Xcode 8.3.2.
The current code is this. Not compiling
Alamofire.request("https://httpbin.org/get", withMethod: .GET)
Proposed solution: Compiles.
Alamofire.request("https://httpbin.org/get", method: .get)
On doc page Carthage section shows
github "PromiseKit/Alamofire" ~> 1.0
But when I'm trying to run Carthage I'm getting errors:
carthage update --platform ios
*** Fetching Alamofire
*** Fetching Alamofire
*** Fetching PromiseKit
*** Checking out Alamofire at "4.2.0"
*** Checking out Alamofire at "1.0.5"
A shell task (/usr/bin/env git checkout --quiet --force 1.0.5) failed with exit code 1:
error: pathspec '1.0.5' did not match any file(s) known to git.
My Cartfile
is:
github "mxcl/PromiseKit" ~> 4.0
github "Alamofire/Alamofire" ~> 4.0
github "PromiseKit/Alamofire" ~> 1.0
It looks like it tries to fetch Alamofire at "1.0.5" and fails, any ideas?
Hello,
It looks like the extension doesn't cover the method for uploading multipart form data: http://cocoadocs.org/docsets/Alamofire/4.4.0/Functions.html#/MultipartFormData
Am I missing something?
Thanks.
The main link is obviously expired:
http://promisekit.org goes to a blog for academic writers and has nothing to do with promisekit.
Thanks for such great addon for Alamofire.
I tried to rewrite my old Alamofire code to your new framework, but I get an error:
Cannot convert return expression of type 'PMKFinalizer' to return type Promise<DataRequest>
My code is :
return firstly {
Alamofire.request(route).validate().responseJSON()
}.compactMap({ (responseJson, response) in
guard let json = try? JSONDecoder().decode(T.self, from: response.data!) else {
throw AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: APIHandlerError.errorInDeserialization)
)}
guard let reply = json as? BaseResponse else{
throw AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: APIHandlerError.errorInDeserialization)
)}
return nil
}).catch{ error in
let t = 1 ---> Here I get compiler error
return nil
}
From your documentation looks like my code is good, maybe there is an update for documentation or I miss something?
I'm trying to use PromiseKit & Alamofire with Xcode 10.2/Swift 5. My Cartfile:
github "Alamofire/Alamofire" ~> 4.0
github "mxcl/PromiseKit" ~> 6.0
github "PromiseKit/Alamofire-" ~> 3.0
When I run carthage update --platforme ios
, I get:
*** Fetching Alamofire-
*** Fetching analytics-ios
*** Fetching PromiseKit
*** Checking out PromiseKit at "6.8.4"
*** Checking out Alamofire at "4.8.2"
*** Checking out Alamofire- at "3.2.2"
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
*** Building scheme "PromiseKit" in PromiseKit.xcodeproj
*** Building scheme "PMKAlamofire" in PMKAlamofire.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/me/Projects/Clients/MyClient/repo/Carthage/Checkouts/Alamofire-/PMKAlamofire.xcodeproj -scheme PMKAlamofire -configuration Release -derivedDataPath /Users/me/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Alamofire-/3.2.2 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/16/jfb809_s2fz01ql7k494f6pc0000gn/T/Alamofire- SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/me/Projects/Clients/MyClient/repo/Carthage/Checkouts/Alamofire-)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/16/jfb809_s2fz01ql7k494f6pc0000gn/T/carthage-xcodebuild.E91PEu.log
The error in the build log:
/Users/me/Projects/Clients/MyClient/repo/Carthage/Checkouts/PromiseKit/Sources/AnyPromise.m:4:13: fatal error: 'PromiseKit/PromiseKit-Swift.h' file not found
#import <PromiseKit/PromiseKit-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
By the way, what's the trailing dash in the Cartfile entry for ("Alamofire-")?
Hi, the extension are very useful, thanks!
I'm having an issue when integrating in the following scenario:
Looks like #8 isn't reflected in the latest pod, the source file is still from 1.0.4.
My Podfile entries:
pod 'PromiseKit', '~> 4.0'
pod 'PromiseKit/Alamofire', '~> 4.0'
Hi, we using this library for some project.
But, you're not specify the license, so we wondering if we can't use it for production.
Is this project licensed under MIT License same as Alamofire?
Thank you !
What version uses swift 2.3?
Currently cannot build Project after including Pod PromiseKit/Alamofire. The error I am getting is 'fwd.h' file not found (which is clearly in the PromiseKit pod directory, as shown below).
Right now the responseJSON promise extension only returns response.result.value
. Would it not make more sense to still somehow include the entire DataResponse object?
I'm trying to access response.response.statusCode
, and it currently seems there's no way to handle that using the PromiseKit Alamofire extension
Box:wxs Nobel$ pod install
[!] Invalid `Podfile` file: syntax error, unexpected '~', expecting keyword_end
pod "PromiseKit/Alamofire" ~> 4.0
^.
# from /Users/Nobel/Develop/wxshell_ios/wxs/Podfile:7
# -------------------------------------------
# pod "PromiseKit", "~> 3.4"
> pod "PromiseKit/Alamofire" ~> 4.0
# pod 'Alamofire'
# -------------------------------------------
Box:wxs Nobel$ pod install
Analyzing dependencies
[!] Unable to satisfy the following requirements:
- `PromiseKit/Alamofire (~> 4.0)` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `PromiseKit/Alamofire (~> 4.0)`.
You have either:
* out-of-date source repos which you can update with `pod repo update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
My podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target "wxs" do
pod "PromiseKit", "> 3.4"> 4.0"
pod "PromiseKit/Alamofire", "
pod 'Alamofire'
pod 'Zip'
end
Hi,
I'm a Cocoapods Rome user and I cannot build my dependencies with the Alamofire subspec.
I've made some investigations.
With the following Podfile:
plugin 'cocoapods-rome'
platform :ios, '9.0'
target :Dependencies do
pod 'PromiseKit/Alamofire', '~> 6.0.1'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
I ran the pod install
command which has generated a PromiseKit.framework
without Alamofire subspec headers.
In order to compare, I have tested same Podfile but with another subspec
plugin 'cocoapods-rome'
platform :ios, '9.0'
target :Dependencies do
pod 'PromiseKit/OMGHTTPURLRQ', '~> 6.0.1'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
I this case, generated framework has OMGHTTPURLRQ headers.
Maybe the problem comes from the trailing -
in github Alamofire projet name (Alamofire-
).
Regards,
Quentin
In core Alamofire, the fact that responseJSON()
returns Any
makes sense, because it can return both the proper JSON response, and any kind of a non-JSON value for error.
In PromiseKit/Alamofire, the non-JSON values can be returned as part of a rejected promise. Fulfilled promises can get a [String: Any]
instead of Any
.
Good evening,
I would like to add this repo through pod "PromiseKit/Alamofire" onto a project with a deployment target of 8.0, however the project's minimum deployment target is 9.0 (https://github.com/mxcl/PromiseKit/blob/master/PromiseKit.podspec#L39). I had to copy the files to my project. Is there any reasoning for not having the deployment target same as the PromiseKit? If not, would it be possible to reduce the deployment target 8.0 (https://github.com/mxcl/PromiseKit/blob/master/PromiseKit.podspec#L24)?
Thank you,
Bruno
I couldn't find any branches with swift 4 support. Is it in the works?
Thanks!
What's the point of this lib? We can just use completion handlers that are built into Swift, can't we?
Carthage build is not working for me.
Xcode Version 8.0 beta 6 (8S201h)
carthage version 0.17.2
Cartfile:
github "PromiseKit/Alamofire" ~> 1.0
carthage update
carthage update
*** Fetching Alamofire
*** Fetching Alamofire
*** Fetching PromiseKit
*** Checking out Alamofire at "3cc5b4e8453bec9fd6b973d60e6b0605a38e4cf4"
*** Checking out Alamofire at "1.0.0"
*** Checking out PromiseKit at "4.0.0"
*** xcodebuild output can be found in /var/folders/k2/s653z37j24v2n0rrwg5_yhkm0000gn/T/carthage-xcodebuild.Sod3l7.log
xcodebuild timed out while trying to read iOS Example.xcodeproj ๐ญ
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.