iOS tweet image - Can I get the image url before upload? - ios

I want to be able to share images from my app on twitter/facebook/email etc..
There's probably hundreds of different ways to do this which is quite simple.
However what I need/want to do, is allow the images to be opened by other people straight into my app (If they have it installed).
So I have a url scheme so a url will open my app with an image like this:
myurlscheme://image?url=http://imageurl.com
The problem I have, is the process for uploading the image, but adding my url scheme to the beginning of the url.
If I could know the url twitter/facebook is going to use before I send the tweet, I could add my url scheme to the front of the image url and put it in the tweet. I'm guessing this might not be possible though.
Another thought is to upload the image to another service, get the url, then compose and send the tweet. Are there any suitable services for doing this? (Preferably free services) I dont really want to have to host the images myself.
Thanks

1) I don't see how you plan on conjuring an image URL before you upload the image - that is a chicken/egg situation. I would recommend taking a look at an actual image URL after you upload it to facebook, twitter, etc and try to figure out even one character of what it would be for the next image you upload. Regarding twitter specifically the image URL is also going to vary depending on what upload service is being used.
2) regarding uploading the image and getting the URL why not look into tapping into the flickr API?

Related

How are urls like this created? (googlevideo.com)

https://r9---sn-a5m7lnel.googlevideo.com/videoplayback?id=c815cbfeddf16cb0&itag=18&source=webdrive&begin=0&requiressl=yes&mm=30&mn=sn-a5m7lnel&ms=nxu&mv=m&nh=IgpwcjAyLmxheDE2KgkxMjcuMC4wLjE&pl=19&mime=video/mp4&lmt=1458651337361788&mt=1460326877&ip=0.0.0.0&ipbits=8&expire=1460355737&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,mn,ms,mv,nh,pl,mime,lm​t&signature=6BC2EA4F643071A5FACCFD9413B48FC1DCB53710.387DCD60FD8900AE04010A993​EDFF340D2A67406&key=ck2
This URL is a "direct" link to a video. I'm unsure how these URLs are handled and how they came to be. I assumed it was from Google Drive or Google Photos, but I can't seem to get the same URL format from a quick video I uploaded onto Google Drive/Photo.
Does anyone know how this URL is generated and maintained?
If you go to your normal video link–URL with the format https://drive.google.com/file/d/XXXXID/view/, you can right click twice in a row and click "Copy Video Address", and it will get you the link in that format.
Note that these links are temporary and IP-locked, so it won't work forever or on another device.

Launching an app with image data from an email

I know I can launch an iOS app using URL Schemes embedded in an email. How would I launch my app and pass it an image that is included in the email? Can the URL reference the image in the email? Or is it possible to automatically load the image to the clipboard? I'm trying to do this in one step and not have the user manually tap and hold to put an image on the clipboard. Thanks for your help.
Assuming the image is available from the web in some consistent format, perhaps it's best to:
Include the image's web address as part of the URL that opens your app
(myapp://getImage/uniqueImagePath/)
Get the image path via the referrer
Add the base url (myphotohost.com) and extension (.jpg) to the path
Download the image client-side
The consistent format would be myphotohost.com/uniqueImagePath.jpg
Here's a link that explains using an identifier (like uniqueImagePath in this context)

iOS 8 UIActivity: disable specific third-party sharers?

I'm fighting with UIActivityViewController in iOS 8. I'd built a custom Pinterest sharing mechanism which works beautifully in iOS 7 -- specifically, it uploads an image to my server, and then creates a Pin with that image and a URL which I specify. This is the desired functionality.
Now, in iOS 8, Pinterest has implemented its own sharer, which accepts either a URL or an image. If a URL is included in the list of Activity Items, the sharer pops up and asks the user which image s/he wants to share from the page at that URL, and totally ignores the image which is also in the list of Activity Items. If there's no URL, and just the image, then the uploaded pin doesn't include a URL.
In order to resolve this, I need to do one of these things:
Disallow Pinterest's sharer from appearing in the list, so my customized sharer can show up instead;
Somehow specify a Source URL within a pin of an image using Pinterest's sharer (I doubt this is possible);
Remove all the other images from the generated web page. I'd really rather not do this.
Or if all else fails, it would be useful to at least be able to detect if the user has Pinterest's sharer selected to show up in their list.
Does anyone know if there's a way to achieve any of these things?
Just an idea, you could set a custom UIActivitySource on your UIActivityViewController.
Then check the incoming activity type for Pinterest. Then disable that via the exclusions.

Share URL similar to Facebook.com/sharer/sharer.php?u= but for Houzz

I'm working with Adobe DPS buttons and currently have set up Facebook and Twitter sharing with them. The buttons take a URL and when clicked pull up the share dialogue.
The Facebook taking the following
http://www.facebook.com/sharer/sharer.php?u=(encoded url goes here)
The encoded url being whatever I want to share.
I want to be able to do this with Houzz.
I've found the page on Houzz.com but I don't think I would be able to use this type of URL share option based on what they provided.
http://www.houzz.com/buttonsAndBadges#houzzbutton
Has anyone seen an option for Houzz similar to Facebook's?
After digging through Houzz's bookmarklet, I've found their somewhat difficult-to-pin-down sharer URL.
http://www.houzz.com/imageClipperUpload?imageUrl=(IMAGE-URL-HERE)&title=(PAGE-TITLE-HERE)&link=(PAGE-URL-HERE)
Just as a quick reminder: an image URL is required (unlike Facebook or Twitter, but somewhat like Pinterest) as one of the main points of Houzz is image sharing/scrapbooking.
I hope this helped someone!

UIActivityViewControlloer don't show thumbnail for links

I am developing an iOS app that uses the UIActivityViewController to share some text and a Url. In the Facebook and Twitter services it shows a thumbnail of the site located at the URL.
Unfortunately, the site in question does not look very good at all in the thumbnail. So currently the thumbnail has a negative value in the share dialog. I would either like to prevent the thumbnail from displaying, or supply my own image for the thumbnail. What is the best method to do this?
I would like to avoid having to create my own service and/or dialog.
I have tried adding an image to the item list, however that adds a bunch of services I don't want and adds the Image to the email action and adds the image to a photo album on facebook. The first problem I can get around by blacklisting actions I don't want. And I can make my own UIActivityItemProvider to stop the email problem. However, I have no idea how to prevent the facebook problem. (See How do I customize a UIActivityViewController to show a URL link when posting to facebook and twitter?).
Here is a screenshot of the facebook sharing dialog:

Resources