Giter VIP home page Giter VIP logo

flickrkit's Introduction

FlickrKit

FlickrKit is an iOS Objective-C library for accessing the Flickr API written by David Casserly. It is used by galleryr pro iPad app.

Master build status:


Features


Who needs FlickrKit when we have ObjectiveFlickr? Why not? I used ObjectiveFlickr for a long time, and some of the methods in this library were born from ObjectiveFlickr. However, I sometimes had problems debugging ObjectiveFlickr as the networking code was custom and not familiar to me. Also I go a little further with FlickrKit and I provide a little bit more than ObjectiveFlickr does... read on....

  • You have a few ways to call methods - using string method name/dictionary params - or using the Model classes that have been generated for every Flickr API call available! It's up to you - or mix it up!
  • All methods return an NSOperation subclass, so you have the ability to cancel requests easily, requests are put onto an operation queue.
  • FlickrKit uses latest iOS libraries where possible, and is built with ARC and uses block callbacks. So it's internals should be familiar.
  • Errors are packaged properly into NSError objects, again more familiarity.
  • There is a default disk caching of Flickr responses - you are allowed to cache up to 24 hrs. You can specify the cache time per request.
  • The code is (hopefully) easy to read and debug, as it uses standard iOS networking components in the simplest way possible.
  • It is (partially) unit tested.
  • There is a demo project to see its usage.
  • There is a vastly simplified authentication mechanism, which is by far the most complicated part of using Flickr APi - even when using ObjectiveFlickr.
  • The model classes are auto generated and include all error codes, params, validation, and documentation. The code generation project is also included in the source if you need to regenerate.
  • Maybe there are more features that I’ve neglected to mentions… give it a go!
Limitations

I don't support Mac OS X (as I’ve never worked with that ..sorry! - ports welcome!). I don't support the old authentication method or migration - it only uses OAuth - which is almost a year old with Flickr now anyway. It only supports single user authentication - so doesn't support multiple Flickr accounts

Requirements


FlickrKit requires iOS 6.0 and above and uses ARC. It may be compatible with older OS's, but I haven't tested this.

If you are using FlickrKit in your non-arc project, you will need to set a -fobjc-arc compiler flag on all of the FlickrKit source files.

To set a compiler flag in Xcode, go to your active target and select the "Build Phases" tab. Now select all FlickrKit source files, press Enter, insert -fobjc-arc and then "Done" to enable ARC for FlickrKit.

Cocoapods Installation


Add this line to your target in your Podfile:

pod 'FlickrKit'

Run pod install and you're good to go!

Manual Installation


  1. Drag FlickrKit.xcodeproj into your project.
  2. In your project target, build phases, target dependencies... add FlickrKit as a depenendency
  3. In your project target, build phases, link binary with library... add libFlickrKit.a
  4. In build settings > header search paths... point to FlickrKit classes directory, recursively
  5. Include SystemConfiguration.framework

Usage


Included in the source is a demo project that shows you how to get started. It has a few example use cases. The UI isn't pretty! - but the important part is the usage of the API in the code.

API Notes
  • You need to start the library using initializeWithAPIKey:sharedSecret: which you will get from your flickr account
  • Completion callbacks are not called on the main thread, so you must ensure you do any UI related work on the main thread
  • Flickr allow you to cache responses for up to 24 hrs, you can pass the maxCacheAge for the number of minutes you want to cache this for.
  • You can provide your own cache implementation if you want and plug it into FlickrKit. See [FlickrKit.h]
  • You can use either the string/dictionary call methods - or you can use the model api, where you use a model class. The advantage of the model classes is the clarity and the validation/error messaging built into them. They also contain all the Flickr documentation. They are auto generated from the Flickr API and can be regenerated with FKAPIBuilder class if the API updates.
Authentication
  • You start auth using beginAuthWithCallbackURL with the url that Flickr will call back to your app - completion callback gives you a URL that you can present in a webview.
  • Once the user has logged in and Flickr will redirect back to your app on the callback URL you specified
  • Remember to include this URL scheme inside your Info.plist of registered URL Schemes.
  • In your app delegate handle URL method, you can pass the full callback URL to completeAuthWithURL.
  • We store the auth token in NSUserDefaults - so when you launch your app again, you can call checkAuthorizationOnSuccess to see if the user is already validated.
  • Calling logout will remove all stored tokens and the user will have to authenticate again.

Startup

You can get an API Key and Secret from your Flickr account. You need these to use the API.

swift
FlickrKit.sharedFlickrKit().initializeWithAPIKey(apiKey, sharedSecret: secret)
objective-c
[[FlickrKit sharedFlickrKit] initializeWithAPIKey:@"YOUR_KEY" sharedSecret:@"YOUR_SECRET"];

Load Interesting Photos - Flickr Explore

This example demonstrates using the generated Flickr API Model classes.

swift
let flickrInteresting = FKFlickrInterestingnessGetList()
flickrInteresting.per_page = "15"
FlickrKit.sharedFlickrKit().call(flickrInteresting) { (response, error) -> Void in
        dispatch_async(dispatch_get_main_queue(), { () -> Void in
        	if (response != nil) {
                    // Pull out the photo urls from the results
                    let topPhotos = response["photos"] as! [NSObject: AnyObject]
                    let photoArray = topPhotos["photo"] as! [[NSObject: AnyObject]]
                    for photoDictionary in photoArray {
                        let photoURL = FlickrKit.sharedFlickrKit().photoURLForSize(FKPhotoSizeSmall240, fromPhotoDictionary: photoDictionary)
                        self.photoURLs.append(photoURL)
                    }
                } 
       })
}
objective-c
FlickrKit *fk = [FlickrKit sharedFlickrKit];
FKFlickrInterestingnessGetList *interesting = [[FKFlickrInterestingnessGetList alloc] init];
[fk call:interesting completion:^(NSDictionary *response, NSError *error) {
	// Note this is not the main thread!
	if (response) {				
		NSMutableArray *photoURLs = [NSMutableArray array];
		for (NSDictionary *photoData in [response valueForKeyPath:@"photos.photo"]) {
			NSURL *url = [fk photoURLForSize:FKPhotoSizeSmall240 fromPhotoDictionary:photoData];
			[photoURLs addObject:url];
		}
		dispatch_async(dispatch_get_main_queue(), ^{
			// Any GUI related operations here
		});
	}	
}];

Your Photostream Photos

This example uses the string/dictionary method of calling FlickrKit, and alternative to using the Model classes. It also demonstrates passing a cache time of one hour, meaning if you call this again within the hour - it will hit the cache and not the network. Fast!

[[FlickrKit sharedFlickrKit] call:@"flickr.photos.search" args:@{@"user_id": self.userID, @"per_page": @"15"} maxCacheAge:FKDUMaxAgeOneHour completion:^(NSDictionary *response, NSError *error) {
	dispatch_async(dispatch_get_main_queue(), ^{
		if (response) {
			// extract images from the response dictionary	
		} else {
			// show the error
		}
	});			
}];

Uploading a Photo

Uploading a photo and observing its progress. imagePicked comes from the UIImagePickerControllerDelegate, but could be any UIImage.

self.uploadOp = [[FlickrKit sharedFlickrKit] uploadImage:imagePicked args:uploadArgs completion:^(NSString *imageID, NSError *error) {
	dispatch_async(dispatch_get_main_queue(), ^{
		if (error) {
			// oops!
		} else {
			// Image is now in flickr!
		}            
       });
}];    
[self.uploadOp addObserver:self forKeyPath:@"uploadProgress" options:NSKeyValueObservingOptionNew context:NULL];

Unit Tests


There are a few unit tests, but currently you should run the demo projects which cover a few areas of the API in both Swift and Objective-C. Sorry about the lack of tests!

License and Warranty


The license for the code is included with the project; it's basically a BSD license with attribution.

You're welcome to use it in commercial, closed-source, open source, free or any other kind of software, as long as you credit me appropriately.

The FlickrKit code comes with no warranty of any kind. I hope it'll be useful to you (it certainly is to me), but I make no guarantees regarding its functionality or otherwise.

Contact


I can't answer any questions about how to use the code, but I always welcome emails telling me that you're using it, or just saying thanks.

If you create an app, which uses the code, I'd also love to hear about it. You can find my contact details on my web site, listed below.

Likewise, if you want to submit a feature request or bug report, feel free to get in touch. Better yet, fork the code and implement the feature/fix yourself, then submit a pull request.

Enjoy!

Thanks,

David Casserly

Me: http://www.davidjc.com
My Work: http://www.devedup.com
Twitter: http://twitter.com/devedup
Hire Me: http://linkedin.davidjc.com

flickrkit's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flickrkit's Issues

err code="95" msg="SSL is required" when uploading pictures

screen shot 2014-07-02 at 10 55 20
I am developing a photo sharing application on iOS that shares pictures on various social networks including Flickr. In order to authorise the app and to upload photos on a Flickr photo-stream I use FlickrKit.

After successfully authorising the app I try to post the selected picture but the problem is that the following error occurs:
err code="95" msg="SSL is required"

Does anyone have an idea where do I set an SSL connection for FlickrKit?

Thank you very much,
Granit

Mac OS X support

FlickrKit was born out of an iOS application, fair enough. However it'd be interesting to see whether the code actually can work on Mac OS X as well.

I am using swift 2.1. trying to post image to Flickr

FlickrKit.sharedFlickrKit().uploadImage(UIImage(named: "tumbler_normal.png")!, args: ["photo":data64], completion: { response in
print("Successs...Post image Flickr. ....")
print(response) //

Getting Error --
99: User not logged in / Insufficient permissions-->> Write permission Needed

Please Help To solve

iOS9 deprecation warnings

When compiling with iOS9 there are a bunch of warnings:

/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/Utilities/FKUtilities.m:25:20: 'stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/Utilities/FKUtilities.m:29:24: 'CFURLCreateStringByAddingPercentEscapes' is deprecated: first deprecated in iOS 9.0 - Use [NSString stringByAddingPercentEncodingWithAllowedCharacters:] instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent (since each URL component or subcomponent has different rules for what characters are valid).
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/DevedUpKit/FKDUNetworkOperation.m:104:49: 'initWithRequest:delegate:startImmediately:' is deprecated: first deprecated in iOS 9.0 - Use NSURLSession (see NSURLSession.h)
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/DevedUpKit/FKDUStreamUtil.m:73:50: 'ALAssetsLibrary' is deprecated: first deprecated in iOS 9.0 - Use PHPhotoLibrary from the Photos framework instead
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/DevedUpKit/FKDUStreamUtil.m:76:53: 'ALAsset' is deprecated: first deprecated in iOS 9.0 - Use PHAsset from the Photos framework instead
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/DevedUpKit/FKDUStreamUtil.m:77:13: 'ALAssetRepresentation' is deprecated: first deprecated in iOS 9.0 - Use PHImageRequestOptions with the PHImageManager from the Photos framework instead
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/DevedUpKit/FKDUStreamUtil.m:77:60: 'defaultRepresentation' is deprecated: first deprecated in iOS 9.0 - Use PHImageRequestOptions with the PHImageManager from the Photos framework instead
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/DevedUpKit/FKDUStreamUtil.m:87:40: 'getBytes:fromOffset:length:error:' is deprecated: first deprecated in iOS 9.0 - Use requestImageDataForAsset:options:resultHandler: on PHImageManager to request image data for a PHAsset from the Photos framework instead
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/DevedUpKit/FKDUStreamUtil.m:76:18: 'assetForURL:resultBlock:failureBlock:' is deprecated: first deprecated in iOS 9.0 - Use fetchAssetsWithLocalIdentifiers:options: on PHAsset to fetch assets by local identifier (or to lookup PHAssets by a previously known ALAssetPropertyAssetURL use fetchAssetsWithALAssetURLs:options:) from the Photos framework instead
/Users/colineberhardt/Projects/BondTest/Pods/FlickrKit/Classes/FlickrKit/FlickrKit.m:269:25: 'stringByReplacingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - Use -stringByRemovingPercentEncoding instead, which always uses the recommended UTF-8 encoding.

I'm currently writing a tutorial for the raywenderlich.com website and would really like to use this library as part of my example. However, readers get very confused by these warnings!

Do you have any plans to update for iOS9? Or, are you happy to accept a PR that resolves these issues?

License warning

[!] Unable to read the license file `.../Pods/FlickrKit/Source Code License.md` for the spec `FlickrKit (1.0.5)`

FKPhotoSizeUnknown no longer valid?

I've found that FKPhotoSizeUnknown is no longer supported. The following was removed from FlickKit.m. Just wondering why?

if (size == FKPhotoSizeUnknown) [URLString appendFormat:@".jpg"];
else {

Response is very slow

Hi @devedup and thanks for your great FlickrKit!

There is one question after testing FlickrKit: Is just the Flickr API so slow or is it the Library? Re-Auth, takes approx. 4 - 5 seconds. Loading PhotoSets takes 10 seconds or something. Is this "normal"? Is just the FlickrAPI so heavy slow? If so there is no way to produce an App with nice usability AND Flickr integration.

Thanks for your feedback!

How to replicate in Swift

I am trying to replicate this in swift

FlickrKit *fk = [FlickrKit sharedFlickrKit];
FKFlickrInterestingnessGetList *interesting = [[FKFlickrInterestingnessGetList alloc] init];
[fk call:interesting completion:^(NSDictionary *response, NSError *error) {
    // Note this is not the main thread!
    if (response) {             
        NSMutableArray *photoURLs = [NSMutableArray array];
        for (NSDictionary *photoData in [response valueForKeyPath:@"photos.photo"]) {
            NSURL *url = [fk photoURLForSize:FKPhotoSizeSmall240 fromPhotoDictionary:photoData];
            [photoURLs addObject:url];
        }
        dispatch_async(dispatch_get_main_queue(), ^{
            // Any GUI related operations here
        });
    }   
}];

oauth_problem=signature_invalid

I’m brand new to using the Flickr API, so I thought the FlickrKit would save me a lot of work. In general, it has, but I’m stuck on a problem and I don’t know what the cause (Flickr or FlickrKit) is.

When I try to authorize for the first time, I get to the authorization link, enter the user ID and password, and submit. The web view goes to a page that asks the user if they want to authorize my app to use their account (I’m requesting “write” privileges). After clicking the “OK, I’ll Authorize It” button, my app gets the callback URL, but it’s always a failure: oauth_problem=signature_invalid.

I tried setting up my app’s ID and secret in the FlickrKitDemo project and trying it there, and I get the exact same results.

So is there something I’m missing or is FlickrKit broken?

Error uploading photo without a title

I'm getting an "Error 2: No Photo Specified" when the title is left blank. The Flickr API says that the title and description are optional. When I have a title, the photo uploads fine.

Uploading fails with "POST size too large"

I implemented a UIActivity subclass using Flickrkit, but when uploading I get a "POST size too large" at the end. Any hints?

...
2015-11-23 16:14:43.048 foo[8220:2746780] file size is 781673
2015-11-23 16:14:43.049 foo[8220:2746780] Sent 4096, total Sent 778240, expected total 781673
2015-11-23 16:14:43.050 foo[8220:2746780] Upload progress is 0.995608
2015-11-23 16:14:43.050 foo[8220:2746780] file size is 781673
2015-11-23 16:14:43.050 foo[8220:2746780] Sent 3433, total Sent 781673, expected total 781673
2015-11-23 16:14:43.050 foo[8220:2746780] Upload progress is 1.000000
2015-11-23 16:14:43.981 foo[8220:2746851] <?xml version="1.0" encoding="utf-8" ?>
<rsp stat="fail">
    <err code="93" msg="POST size too large! Try something smaller, mmkay?" />
</rsp>

Expose NSOperationQueue on FKDUNetworkController

I'd like to see the NSOperationQueue on FKDUNetworkController exposed publicly. I have a use case where I need to kick off several FKFlickrNetworkOperations and I want to be able to have the queue tell me when they are all complete. Currently, there is no way to access the queue as it is private on FKDUNetworkController.

Logout does nothing

For some reason, after a [[FlickrKit sharedFlickrKit] logout] doesn't log all the way out. On the next access, I get to the Flickr authorize screen, but not all the way back to the screen where you enter an email and password.

1.0.9 not available in cocoapods

I imagine 1.0.9 is not available on cocoapods because the tests are failing according to the badge on the README of this repo. However, the sample code is for the 1.0.9 API, since it uses the photoArray property, which is not available in 1.0.8.

So two things:

  1. Could we upgrade cocoapods to 1.0.9 so we can put pod 'FlickrKit', '~> 1.0.9' into our podfile ?
  2. If the new photoArray property is the preferred way to fetch the results, should it be bumped up to 1.1 since the sample code is not backward compatible with 1.0.8?

Also, if I can help get a test passing to get 1.0.9 ready for cocoapods, let me know.

Thanks!

non-public API Warning with XCode5

If Distribute to AppStore with XCode 5. there is a warning message. Because, of this method name :

  • (BOOL) isValid:(NSError **)error;

So, I Changed method name to

  • (BOOL) isValidArgs:(NSError **)error;
    in my project.

Thank you.

"This Photo Is No Longer Available" Returned everytime

Hey there, first off I want to thank you for creating this fantastic API. Easy methods and great documentation. Thank you sir.

Here is the call I am making

let searchList = FKFlickrPhotosSearch()
searchList.per_page = "5"
searchList.text = cityNme -> (This can be San Francisco, etc.)
FlickrKit.sharedFlickrKit().call(searchList) { (response, err) in
dispatch_async(dispatch_get_main_queue(), { () -> Void in
if (response != nil) {
// Pull out the photo urls from the results
let topPhotos = response["photos"] as! [NSObject: AnyObject]
let photoArray = topPhotos["photo"] as! [[NSObject: AnyObject]]
let topPhoto = photoArray.first
let photoURL = FlickrKit.sharedFlickrKit().photoURLForSize(FKPhotoSizeOriginal, fromPhotoDictionary: topPhoto)
}
})
}

This call for a basic PhotosSearch has consistently given me photos that are no longer available (or so it says after they are loaded).

Some clarification would help on this one. From what I've read, you do not need to have an auth to query for regular photos.

Update: Even on an FKFlickrInterestingnessGetList() call, all photos returned are no longer available.

Any help would be wonderful. Thanks!

Using swift 2.0 on ios 9.2 facing Error as bellow

Undefined symbols for architecture x86_64:
"OBJC_CLASS$_FlickrKit", referenced from:
type metadata accessor for __ObjC.FlickrKit in HomeViewController.o
ld: symbol(s) not found for architecture x86_64

Default Account

Hello, I am wondering if there is a way to login automatically so that the username and password would be hardcoded into the app and it would be used as a way for the user to upload photos without them having to have a Flickr account?

[FlickrKit beginAuthURL]: unrecognized selector sent to instance

I am using FlickrKit with Coocapods. And the build has no error. But when I call [[FlickrKit sharedFlickrKit] beginAuthWithCallbackURL, the simulator crashes and says:

-[FlickrKit beginAuthURL]: unrecognized selector sent to instance 0x9060cf0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FlickrKit beginAuthURL]: unrecognized selector sent to instance 0x9060cf0'

Flickr Auth issue

Hello,
I use your FlickrKit SDK, it works perfect. But recently I found I cannot auth the flickr account. The error message is like following:

     An extern app want to connect your Flickr account, but not provide all information. As following:
     "no message"
In the meantime, if you'd like to find other third-party tools and services that work with Flickr, or learn more about Flickr API, visit the Flickr Services page.

I have filled all info in the app pages. Does anyone have the same issue?

Video Upload

Does you API provides video upload functionality too ?

Sorry I haven't read your code yet, Kindly tell me is it even possible to upload video via iOS App ?

"copy" attribute warning after update to Xcode 6 beta 4

Hello, after my update to xcode 6 beta 4, i had almost 25 warning. There are mainly two type of warning:

  1. 'copy' attribute on property 'description' does not match the property inherited from 'NSObject'. this warning it's generated by this line @Property (nonatomic, strong) NSString description; / (Required) */
  2. Auto property synthesis will not synthesize property 'description' because it is 'readwrite' but it will be synthesized 'readonly' via another property.

Also the second warning it's generated by the same line before.

For remove the second warning you need to remove the nonatomic property, but i think this it's not a good idea, and i don't have any idea how to remove the first warning.

Any idea how to fix the problems?

Thanks

OS X support

Hey, finally found a new framework except Objective-Flickr.

I read issues and there were 2 issues #2 and #11 regarding to this.

But the pull request was not finished yet. Is there any problem out there.

I would like to help creating an OS X framework(with module support) and OS X demo app.

Link error: duplicate symbol _OBJC_IVAR_$_AppDelegate._window

I was install FlickrKit (v1.0.6) using cocoapods.
After that, I got link error. ⬇️

duplicate symbol _OBJC_IVAR_$_AppDelegate._window in:
    /Users/miro/Library/Developer/Xcode/DerivedData/feather-baxuldxkouoqtreylprgzubzrwmc/Build/Intermediates/feather.build/Debug-iphonesimulator/feather.build/Objects-normal/i386/AppDelegate.o
    /Users/miro/Library/Developer/Xcode/DerivedData/feather-baxuldxkouoqtreylprgzubzrwmc/Build/Products/Debug-iphonesimulator/libFlickrKit.a(AppDelegate.o)
duplicate symbol _OBJC_CLASS_$_AppDelegate in:
    /Users/miro/Library/Developer/Xcode/DerivedData/feather-baxuldxkouoqtreylprgzubzrwmc/Build/Intermediates/feather.build/Debug-iphonesimulator/feather.build/Objects-normal/i386/AppDelegate.o
    /Users/miro/Library/Developer/Xcode/DerivedData/feather-baxuldxkouoqtreylprgzubzrwmc/Build/Products/Debug-iphonesimulator/libFlickrKit.a(AppDelegate.o)
duplicate symbol _OBJC_METACLASS_$_AppDelegate in:
    /Users/miro/Library/Developer/Xcode/DerivedData/feather-baxuldxkouoqtreylprgzubzrwmc/Build/Intermediates/feather.build/Debug-iphonesimulator/feather.build/Objects-normal/i386/AppDelegate.o
    /Users/miro/Library/Developer/Xcode/DerivedData/feather-baxuldxkouoqtreylprgzubzrwmc/Build/Products/Debug-iphonesimulator/libFlickrKit.a(AppDelegate.o)
ld: 3 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Probably.. I think because the library contains AppDelegate.h, AppDelegate.m and main.m files.

image

Flickr doesn't recognise the "oauth_token" this application is trying to use

Hello,
I am trying to implement Flickr authorization, it seems that it succeeds to enter into project page, but after clicking at button which gives app permission - webview shows this message:

Flickr doesn't recognise the "oauth_token" this application is trying to use

I am using this code to authenticate:
let url = URL(string: "flickrapp://auth")
FlickrKit.shared().beginAuth(withCallbackURL: url!, permission: FKPermission.delete) { (url, error) in
Tools.runAsync {
if let error = error {
self.showError(error.localizedDescription)
} else {
print(url?.absoluteString)
let urlRequest = NSMutableURLRequest.init(url: url!, cachePolicy: NSURLRequest.CachePolicy.useProtocolCachePolicy, timeoutInterval: 30)
self.flickrWebView.isHidden = false
self.flickrWebView.loadRequest(urlRequest as URLRequest)
}
}
}

I print url in webview and it prints generated oauth_token, so token is generated. However it fails at flickr.

No such module 'FlickerKit'

Hello
I am using Swift 3.0 and Xcode 8.3.2
I have tried to install flicke, via cocoa pods, installation was successful.
I am not able to access any files of Flicker framework.

I have tried with following lines.
FlickrKit.sharedFlickrKit().initializeWithAPIKey("", sharedSecret: "")
and it gives me error No such module 'FlickerKit'
Please help me to solve this issue.
I also tried with to set FrameworkSearch Path and UserHeaderSearchPath, but It couldn't solve the error.
Please give me your answer ASAP.
Thanks In Advance

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.