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.
Related
I'm currently working on an app that allows some feature to be displayed when a user clicks on another instagram user's pictures, ie, when the picture and the provision to comment on the comment section displays. This is a simple feature that in a way overlays over this page. M question is, does instagram or any other photo sharing app allow this?
Once the user downloads my app, he/she will be allowed to integrate my app with instagram and have this feature enabled.
Not sure I understand your question right or not. But there is no way to overlay your view to other application. There is a way to display part of your application in other application, which called extension but Instagram needs to design their application to add that feature which likely impossible.
Other way you can think of is checking if Instagram has API to see if a photo is liked/commented then you can response to that action.
I'm fairly new to posting to social media via Swift in an iOS app but need to be able to post an image to Twitter under a certain hashtag (i.e the user's image is always posted under this certain hashtag regardless).
So far, my app can take a picture and access the user's photo library, but I have run into some trouble implementing post to Twitter.
I have looked at the following questions: Post on twitter from ios app
How to make an ios app post to twitter
But most of the links referenced are either gone or outdated. I have also looked into Sharekit (http://getsharekit.com) as this would do the posting to Twitter automatically it seems, however Sharekit is deprecated.
Ideally, I would like the user to be able to take their photo (I have this) give it a caption, etc WITHIN THE APP then when they press a button it more or less "silently" posts to Twitter WITH the hashtag that I will have set in the app. I am unsure as to how to accomplish this.
What is the best way/approach to posting an image to Twitter via Swift? The hashtag bit seems to be the more difficult step - how can I "force" a hashtag on the user's post?
What you're probably looking for is the Social framework and SLComposeViewController.
Using the setInitialText(_:) method you can add text to the tweet, though this doesn't really force anything, as the user still has the possibility to edit the tweet before publishing, and it doesn't really work "silently" either.
Posting an image is done with the addImage(_:) method.
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.
The documentation for the Storage Provider extension only refers to documents and files. It's not clear if it works for images and photographs. For instance, could an app create an extension that gets invoked in iMessage when the user taps the camera icon to insert a picture from the Photo Gallery?
It depends on how Apple implements the iMessage photo picker. If they go through the document picker API, you will get a chance to provide images. If the use the photo picker view controllers, however (PhotoUI framework or otherwise), you will not be able to.
Apple is most likely to go through the second route, but if this is an important feature for you, make sure to file a an enhancement request with Apple and post the radar number here so people can duplicate.
As of beta 2, Apple does not use the document picker API, so you will not be able to add your own data source for images if the Messages app does not change.
I'm making a quest (for iPads) and would like to use QR codes that users have to scan and then do certain tasks: The user scans the QR code, which links to a text that asks them to take a picture of a certain object and a button that opens up the camera, once the picture is taken it is saved. I was thinking of a blog, where images can get uploaded once they are taken, but they could as well be stored on the iPad. I haven't found a solution using blogs, as taking an image can't be prompted, any idea how it could be done?
Thanks
Not really possible with a web app. You could have the link in your QR code point to your native app’s custom URL scheme, as in myapp://whatever, and then both get and upload the photo through that app, but what you’re trying to do isn’t possible through Safari.