Displaying Large images same as twitter using twitter photo card - twitter

I am using twitter photo card(its's approved) for my application. When I am trying to post large size(for ex: 540X810 in px ) it displays 'View photo' link on Twitter without displaying image. How do I solve this?
In Twitter if we post the same image directly it shows at least half the image then displays 'View photo' link below.

Vamshichalla, you've identified a significant issue with implementing the Photo Card on twitter; the Photo Card will not show your image in an expanded view if you are hosting it on your own server. This issue came up in the Twitter forums where employees explained that photos will be hidden in the timeline unless they originate from twitter's servers (typically pbs.twimg.com).
There are two solutions to fix the hidden Photo Card photo in timeline.
Use the Twitter API
One option is using the Twitter API to upload an image. This seems like the route you took as of Sep 29 2014.
Upload Photo Twitter's Compose & Find the src tag
A second option is uploading your images using twitter's standard photo upload tool. That process is described here where you compose a tweet and upload images to your account. The final step is to make note of the source address of these images on the twitter server. You can then use this src in your card so the image will appear expanded in the timeline. Please see the Photo Card docs if there are questions about setting up the card meta-data itself.
Summary
Discovering the need to host your images on Twitter's servers is not well publicized as of the time of this writing. The solution is to upload the image to Twitter's servers. I hope this answer saves other people valuable time.
PS - Organizations that have an advertising relationship with Twitter may not have to follow these steps.
Other Troubleshooting (if your image doesn't show at all)
Please note that there are other issues that could be preventing your image from showing at all which are covered in Twitter's troubleshooting guide. These mainly involve if your hosted address has not yet requested approval. Use the Validator Tool on your card for that -- after preview if it fails the authentication requirement it gives you an option to request approval. The other common issue would be if you have a robots.txt (a file that is used to tell web crawlers where to look for meta-data) that is telling the Twitter crawler to stay away from your images.

Related

LinkedIn not recognising OG tags when shared via 3rd party application

To start with, it is worth me noting that this process was working perfectly for 2 years. It started failing intermittently about 2 weeks ago.
We enable our clients to share a URL with a custom OG image to Linkedin via our Linkedin application.
Currently, it is presenting with no 'preview' image like so https://www.linkedin.com/feed/update/urn:li:activity:6811038971855020032/ (screenshot https://i.imgur.com/I8OsZy1.png)
However, when checked using LinkedIn Post Inspector it works perfectly https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fjobadder.refari.co%2Fsocial%2F8e3284ec-d6b8-4d0b-b6a8-cb2a19a56432%2F (screenshot of the same thing https://i.imgur.com/dYItzDI.png)
If I take the URL and paste it manually into LinkedIn it also fetches the OG image with no issues. https://i.imgur.com/S0TTVE7.png
Worth noting that the image being fetched in this example is 438kb (so not large)
As far as we can tell this is an issue with Linkedin fetching the OG image but I am more than open to being told otherwise. Any help at all would be very much appreciated.

Facebook custom photo and video sharing action in iOS

I have video and photo sharing working fine in an iOS app using UIActivityViewController.
Now I want to upgrade it so that the app posts a custom OpenGraph story to the timeline. Something like "User posted Video from MySuperApp".
I've got the all the iOS side written, and I've got a Facebook app created and configured in the project, login, etc.
I'm a bit frustrated by the rest of the documentation, though:
The submission guidelines speak about a "user generated photos" permission that doesn't seem to be available anywhere in the app settings, or anywhere else in the documentation. Is that still required? Is there a similar permission for videos?
It says "Photos must be original and can only be those taken with a camera by the person who is publishing them". The app allows adding annotations/drawings on top of a photo. Does that still count as "original"? And I guess the normal image controls allow selecting images from an album, so I have no way to enforce this, do I? (Other than writing a completely custom camera control, I guess...)
The API allows to "stage" a photo for a story. Is it possible to stage a video, or do I need to upload it externally? Can I refer to a video in a user's album in a story?
Is it possible to use FBDialogs to post a story about a video, or do I need to write my own?
Update:
Current status: I wrote my own UIActivity to share on Facebook and my own activity view controller.
Making a custom story about a photo is straightforward, and covered by documentation and examples, but to summarize:
stage photo, returns url
create object, returns id
create action (returns id)
Make sure you set "explicitly_shared" to true, so the action appears in the timeline. It is a good idea to follow their recommendations for error handling as well, otherwise it is a pain to debug.
I am not further with videos, though. Uploading a video is easy ([FBRequest requestForUploadVideo]), but that returns an id. So far I have not been able to use this id in either an object or an action. Querying the graph API for that id doesn't return any information. The video appears on the timeline by itself as well.
I'm tempted to just ditch the custom story about the video.
Update:
Okay, based on the feedback here and on the Facebook group I have to assume that it is not possible to upload and share a video as part of a story. I'm going to strip the feature down to just upload the video to the album.

How to get images from email or desktop into iOS app?

I know this is a very basic question, but something I'm never quite sure of, is how do you get images from say your email, or from your desktop (say a Mac) into your iOS app?
Let's say I develop an app and I want people to be able to put their company's logo into it, how would they do that? I presume they don't have their company logo in their phone, so how would they get it from another source into the app? If they linked to it on the web, wouldn't that just open a UIWebView to show it? i.e it wouldn't load the actual .png from the web direct to be used by the app or would it?
So, to avoid long comments, I'm putting my answer here, although this is a very general question.
The common thing with all the apps that want an image input, is that they require the user either take a photo with their phone camera, or grant access to the photo library, so that the user can select an image and upload it to the app. If you have used any of the photo-involved apps these days, you should be familiar with this. Example is Instagram, Facebook, Flickr, etc.
However if you really really want to let the user download it off the internet through your app, then you should embed a web browser in your app, allowing the user type in a URL and save the file in that URL to the documents/downloads folder in your app, and then allow them access those folders to browse and upload stuff. A good example of this kind of app, is "NuageApp" which is actually a client for the Cloud App. It's really handy to deal with file sharing the way NuageApp (funky name, huh?!) does, however it's far more complicated to implement that, than the access to the photo library.

iOS app Upload Photo to Facebook and Server approach

When the user takes a pic on the iOS app, the following would have to be done (in no particular order):
The photo has to be uploaded to our server.
The photo has to be posted on to Facebook
What is the best approach to do this ?
Scenario 1:
iOS app uploads the photo to our server
iOS app uploads photo to the Facebook
Scenario 2:
iOS app uploads the photo to the server
Our server uploads the photo to Facebook
Questions:
Which approach is better (scenario 1 or scenario 2 or is there any other better approach) ?
Which approach is followed by other apps which do stuff like this. (apps like Instagram / Foodspotting ) ?
Based on what you are asking and the information you are providing (I don't know if there are other requirements), I would probably go for Scenario 2 for the following reasons:
The User Comes First: In this case, I am thinking about data leaving the user's device. Most people have a limited data plan, which means, you should try to use the least amount of resources possible (in this case, data & their attention span).
You have more flexibility: You can retry the upload to facebook in case of an error without disturbing the user. For example, if for any reason, you could not upload to Facebook on the first try, then you can retry without holding the user's attention hostage.
You have more control/measurements: Here I am assuming certain functionality about your app. But let's say you allow people to upload files to your server, but they can choose if they post to Facebook, then you can start seeing what percentage of your users actually post to Facebook, and start to see patterns about your users. This kind of information is always valuable.

Upload images to Salesforce through iOS App

I am trying to upload image to Salesforce just like updating Leads or Accounts through my Phonegap iOS app. I can get the image but by googling a bit, I got to know that i have to convert the image into a BLOB.
My query is about two things:
1. How to convert the image into a blob?
2. How to upload that blob to Salesforce?
Thanks in advance
A blob is just a Binary Large OBject, i.e. a lump of binary data. You just want to read the file into memory and use it's content directly. There may be a need to base64 encode it, but I wouldn't have thought so.
There's a Phonegap plugin for downloading binary data on iOS here, you can see how it uses the standard Apple SDK calls for file access, so opening them shouldn't be a problem for you.
The blog would be a field on an object, much like fields on your Accounts and Contacts, I'm not sure how you specify the size, but putting the binary data into the field shouldn't be a problem.
There's an example of using the REST API to upload binary data (to a document) here — I imagine your solution would be similar to this. What Salesforce API are you using for your app? Are you using their Mobile SDK?
You can attach images to Salesforce record on iPhone using Salesforce Mobile app. This requires a little customization - VF page and apex class. Once you have created the VF page for attachment, then you need add this VF page as 'Visualforce Tab' and enable it on Salesforce Mobile Configuration. Steps to add the newly created Visualforce Tab onto Salesforce Mobile Configuration : Setup->Mobile Administration->Salesforce Mobile->Configuration->'Select your Configuration'->Mobile Tab.
Now using this tab on Salesforce app, you can upload images as attachment.

Resources