Facebook iOS sdk 3.10 share local image or movie - ios

I used Facebook sdk in the past, but the new version is making me crazy. I'm trying to create a UIActivity subclass that calls the official facebook share dialog. Since for someone having the "via iOS" instead of the app name in the post is a first world problem (just kidding), I can't use the iOS native integration with the SLComposeViewController.
In the documentation it seems that for post a picture using the share dialogs you need to use open graph actions, but is not totally clear to me if you can do inside your app, or you need to rely on external php application.
I've seen that there are some common actions that wouldn't require a declaration of a new one, but posting a photo or a movie it doesn't seems to be there.
I'd like to use something "native" as a share dialog instead of an FBSession if possible.

Related

Is it necessary to call FB.Init()?

We're trying to integrate the Facebook SDK just so we can track installs and the effect of Facebook ads on our mobile game on iOS.
From what I've been reading it sounds like the purpose of calling FB.Init() is to give back a page to display to the user to log them into Facebook. That's not really what we're interested in so we just ignore it. Our game doesn't need or want to log anyone into Facebook -- merely to track the install of the app by App Id. Do we even need to call this?
Is it enough merely to include the SDK and set up the settings file in our app for iOS builds?
Yes, you have to call it.
This method is used to initialize and setup the SDK. All other SDK methods must be called after FB.Init(), because they
won't exist until you do.

Facebook Messenger App Link [iOS]

I'm creating an iOS application where I'd like to integrate Facebook Messenger for users to message each other. I've tried deeplinking via fb-messenger://user-thread/{user-id}, which works as intended. When I open the URL via my app, it switches over to Facebook Messenger. However, as this type of link seems undocumented by Facebook, I'd rather not risk using it as they might change it at any given time.
I've then looked into Facebook App Links, but as they're very few examples of how to actually use it, I'm not completely sure how to use it for a simple case of switching from my own app to messenger with a user-id as a parameter.
Any comments on this matter will be much appreciated.

Post to Pinterest from an iOS app without leaving the app?

I successfully integrated the Pinterest iOS SDK and can pin items, but it takes the user out of the app. Is there a way to do this but stay within the app?
I followed this guide already (How to integrate Pinterest in ios application)
The SDK provided by Pinterest only has the Pin it functionality, as described on their developer website. You cannot login with that SDK, but you can Pin images with it.you can login but can't get the response.
Pinterest has no official API for logging in, but they do use OAuth2 protocol. So you might have to write your own UIWebView handler that will allow the logging in. This will require research of OAuth2 protocol and storing cookies.
Check this GitHub project.
There is some more information in the following questions:
Log in with Pinterest
pinterest api documentation
may be this help you.
Yes you can pin items without leaving your app. It is mentioned in other answers, Pinterest has no official API. However their original web site using HTTP POST methods and you can do same thing programatically with using NSURLRequest and NSURLConnection or any other wrappers as like AFNetworking.
It is kinda hacky way but since they have no API this is the only way to do it. Only the downside, if they change something on their site code you should update your code regarding. I have released a OS X application couple months back, it is working fine since then.
I would like to write everything down here however it is almost complete application, this why I have prepared a sample app for you. If you decide to use this you have to tidy up the code little bit. You can download sample project from GitHub
How it works: Basically you have to login to Pinterest with using UIWebView, once you logged in UIWebView write cookies, we are going to use those cookies in HTTP headers to authenticate. (If you want to support social media logins you have to implement those separately)
Once we have the cookie, first thing first getting board list. -(void)getBoardList, then next step is choosing the board which you want to pin (you have to implement this, for now it show up 1st board in the list).
Pinning is two step operation here, At the first step you need to upload image to storage of Pinterest which -(IBAction)uploadImage:(id)sender method handles it. If image upload success it automatically call -(void)pinImage:(NSString *)imageURL to register your image to the selected board.
When you review the code you will see all variables hardcoded, you have to implement all of them as well. As I said this is at least gives you the idea how you can pin image to Pinterest. There is not error control in the code as well. while trying if you don't have any board, probably it will throw and error.
No, you cannot currently pin an item without leaving your app. The Pinterest API is pretty limited in my opinion. The only pinning functionality that they support for iOS is detailed in the iOS Pin It SDK, which is what you are already using.

How to share a link from the app using other applications

I want to share a link from my app using other applications installed on my iPhone such as Gmail, Facebook, DropBox, WhatsApp etc. In android there is a straight way to do so, just fire an intent and it automatically shows the installed apps through which we can share whatever we want. Is there any such way in iPhone ?
Thanks!
On iOS , app is more separated from each other. The only way to pass data from one app to other is using the URL mechanism. As one example, an app register url scheme "open-me://",you invoked openURL with "open-me://my-link" then that app will launched. That app will define the detail of the URL so it could understand the content.Continue with the example we are using, the text you passed could be either "open-me://A?data=my-link" or "open-me://A?message=my-link". So there are no general solution for all apps.Typically third party app will provide a SDK to make these things easy.
If you don't mind using a kind of large third party library, ShareKit is a good choice. It supports quite some apps.
If you want to know more about this topic,for example sharing files between app. You could start from reading the class reference of UIDocumentInteractionController.This UI component will show a list of app installed on your device which support the URL scheme.

SLComposeViewController Facebook posts as iOS instead of Facebook Application Identifier

I'm currently working on a prototype for adding Facebook social features for future iOS games. One of the features I've been working on involves using the new native Facebook Composer to post to a link to the game, and then tracking the post and giving the player coins for every person who likes the post. After the post, I get their feed and look for a post with a matching application ID. I've already got that part working correctly if I don't use the new native Facebook Composer (either old style dialogs, or just a direct post with no dialog).
The problem I'm encountering is when using the new SLComposeViewController, the post will appear to come from the application "iOS" id "213546525407071" rather than the id for my application.
Is there a way to change the attributed application so that it uses my application ID instead of iOS?
That's how SLComposeViewController works. If you want your own app designated, you have to design your own UI and use FBRequestConnection from the Facebook SDK as discussed here.

Resources