Non-OAuth Photo Upload with iOS???
DrMillerKC
Registered Users Posts: 24 Big grins
I *had* planned a business where my mobile iOS app, used by scores of customers (none of whom would have a SmugMug account), would upload photos to a single, MY SmugMug account under individual Categories/SubCategories, and I would distribute revenue based on their sales. The mobile app is developed but the hurdle is figuring out with the API how they all can upload photos to MY account.
The latest API, 1.3, seems to be completely dependent, especially for uploads, on OAuth which is based on the model where individual users access THEIR SmugMug accounts without the app using their username/password. I don't see how I could use the latest API at all for my business model. The older API would seem to work better with my model (my username/password would be encrypted and safe on the device).
So, 1) is there anyway possible to use 1.3 and have end-users, who do not have a SmugMug account, upload photos to my account, 2) why can't I use an earlier API, and 3) does anyone know of *new* example code, especially for iOS/Objective-C for uploading to one SmugMug account?
Thanks for any tips and thoughts.
The latest API, 1.3, seems to be completely dependent, especially for uploads, on OAuth which is based on the model where individual users access THEIR SmugMug accounts without the app using their username/password. I don't see how I could use the latest API at all for my business model. The older API would seem to work better with my model (my username/password would be encrypted and safe on the device).
So, 1) is there anyway possible to use 1.3 and have end-users, who do not have a SmugMug account, upload photos to my account, 2) why can't I use an earlier API, and 3) does anyone know of *new* example code, especially for iOS/Objective-C for uploading to one SmugMug account?
Thanks for any tips and thoughts.
0
Comments
Firstly, uploading isn't necessarily tied to a given API version, you can upload using OAuth or SessionID.
Secondly, instead of distributing the app with your username and password, you can instead distribute with an OAuth token/secret encrypted with the correct permissions/access in the same fashion. From a security perspective, that way your account is comprised if someone happens to decrypt your password stored on the device and if something ever happens, you can just revoke the OAuth token and issue a new one for your app to use.
Hope this helps.
Cheers,
David
SmugMug API Developer
My Photos
And secondly, thanks for the reply. I've basically programmed the app, and this is the last piece but I am flailing bad. I did figure out how to log on and actually got a SessionID and later got AlbumIDs! I did find accidentally this page after spending hours trying to figure out smugmug.images.uploadFromURL. Just couldn't figure out the URL on my device. I have spent the last several hours trying to use the information on that link, but I guess I'm missing many pieces.
I don't have a clue how to do that (and if I did, do I stick to 1.2.2 or move to 1.3?). I thought that I would use my userID and persist the PasswordHash always using https. That I understand and seemed pretty secure to me (as long as the PasswordHash never changes).
I basically want to copy the way Awesome Camera handles uploads, that is, show thumbnails, tap a couple, and then tap an Upload button. I would then want a progress spinner on each thumbnail to display progress and then to mark the thumbnail as they upload is complete. That's yet another challenge (maybe v2.0) although I'm also try to learn AFNetworking for Obj-C to shelter me from bare metal
Thanks again for any help you can provide!
Firstly, smugmug.images.uploadFromURL is method aimed at uploading images directly from other webservers or service on the web, rather than a device.
Here's some sample code that I have cobbled together from a internet searches on the library you are using, I haven't written Obj-C in a little while and I don't really know this library, so it's probably more a guide than executable code...
I've made the assumption that's you are using JSON, if not you will need to modify as required.
Hope this helps,
David
SmugMug API Developer
My Photos
And when I check the Upload log in SmugMug it says, "upload problem, invalid album". Well, it is the very same albumID that I can repeatedly use in your code (not multipart form-data).
So, I'm at a lost whether the multipart AFNetworking stuff is the problem, or something on the SmugMug API end of things.
Any thoughts?
Thanks.