Git Product home page Git Product logo

pmkalamofire's People

Contributors

allenlinli avatar broadwaylamb avatar haaakon avatar hboon avatar kenstir avatar larrynatalicio avatar mxcl avatar ozgur avatar paulmelnikow avatar romanpodymov avatar rpendleton avatar rursache avatar thomaspaulmann avatar timbms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pmkalamofire's Issues

Why

What's the point of this lib? We can just use completion handlers that are built into Swift, can't we?

`responseJSON` returns a Promise<Any>

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.

Catch issue: PMKFinalizer

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?

README example: withMethod -> method

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)

swift-4 support

I couldn't find any branches with swift 4 support. Is it in the works?
Thanks!

'fwd.h' file not found in PromiseKit-umbrella.h

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).

  • Swift version 4.1.2
  • Xcode version 9.4.1

Errors:
screen shot 2018-07-30 at 10 31 58 am

PromiseKit Pod Directory:
screen shot 2018-07-30 at 10 32 04 am

Podfile:
screen shot 2018-07-30 at 10 31 47 am

Linked Frameworks and Libraries:
screen shot 2018-07-30 at 10 34 11 am

Issue when dependency uses PromiseKit / AwaitKit

Hi, the extension are very useful, thanks!
I'm having an issue when integrating in the following scenario:

  • I develop a private spec "B" that depends on PromiseKit 4.0 and AwaitKit 2.0
  • I have an app target "A" that depended on pod "B" and PromiseKit 4.0
    Now I need PromiseKit/Alamofire 4.0 in the app
    After swapping PromisetKit with PromiseKit/Alamofire in the target I get the following build error in AwaitKit framework
    My target deployment is iOS 9.0, do you have any idea what this might be ? Anything me or AwaitKit need to do ?

screen shot 2017-02-23 at 07 50 01

PMKAlamofire 5.0.0 fails to build with Xcode 15

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.

Possible to reduce Deployment target to 8.0?

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

xcodebuild timeout

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 ๐Ÿ˜ญ

Please specify license.

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 !

Is it possible to retrieve the DataResponse object in `.responseJSON().then`?

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

Carthage: Wrong Alamofire version in doc

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?

Cannot build framework with Alamofire

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.

capture d ecran 2018-02-16 a 00 15 39

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.

capture d ecran 2018-02-16 a 00 14 27

Maybe the problem comes from the trailing - in github Alamofire projet name (Alamofire-).

Regards,
Quentin

Info.plist missing?

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.

Carthage build is failing

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-")?

None of your spec sources contain a spec satisfying the dependencies

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"
pod "PromiseKit/Alamofire", "
> 4.0"
pod 'Alamofire'
pod 'Zip'
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.