TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Mar 2016 |
Maintained by Fryderyk Dyc.
This Pod makes it easier for you to:
This Pod is currently configured to build in OSX however there shouldn't be bigger problems to extend it to support iOS. I simply don't know how to configure the pod project to handle that and currently don't have time to learn that. Pull requests highly appreciated. The project uses objectiveflickr and SimpleStateMachine.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Then go AppDelegate.m file and replace:
[WDFlickrFactory setApiKey:@"--YOUR--KEY--"];
[WDFlickrFactory setApiSecret:@"--YOUR--SECRET--"];
dummy strings with flickr credentials of your app. That's necessry to use the Pod since everything except getting buddu image requires to be authenticated and authorized. You can create your flickr app here: link. Now you are ready to build an example app and play with it. Sign in (the browser will pop up with flickr's oAuth authentication page), choose some media files to upload, and hit the upload button. Example app prints a lot of debug information which is not needed during regular real-life application usage. Entire Example app is contained inside the AppDelegate class.
Basic steps to use the pod in your code:
- (WDFlickrUploadTask *)nextTask
method. Once you return nil - the Uploader will go to the Finished state.- (void)WD_flickrControllerNotificationHandler:(NSNotification *)aNote
method for what you can get from there.- (void)WD_initFlickr
method show how to use WDFlickrFactory to configure and create the Controller and the Uploader.There are two main classes: WDFlickrController and WDFlickrUploader. WDFlickrController implements primitive communication with Flickr, such as sign in, upload one picture, create photoset etc. WDFlickrUploader on the other hand implements the logic of a batch photo upload with assignment of the files to specified photosets. If specified photosets don't exist - they will be created. Both classes are implemented as state machines. Controller is more primitive, switch-case based, whilst Uploader uses more structured approach and utilizes a SimpleStateMachine cocoa pod. WDFlickrUploader has a buch of unit tests. Some methods are synchronous, some asynchronous, depending on what if thought to be a better approach in a given context. Below attached are state diagrams for both automata. The second one is way more precise and can be a huge help if you need to get some more understanding on the code. The uploader features simple error handling and it will repeat a couple of times before failing.
Primitive and simplified state diagram for WDFlickrController:
Pretty nice state diagram for WDFlickrUploader:
WDFlickrPhotoUploader is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "WDFlickrPhotoUploader"
Don't forget to configure your app's api key and api secret! (obtained from flickr)
Fred, major [dot] freddy [at] yahoo [dot] com
WDFlickrPhotoUploader is available under the MIT license. See the LICENSE file for more info.