问题
I have an iOS app that can create shares on Facebook. The sharing itself works fine but we don't see a text for the "shared via" line as you can see in the attached image. It just says "shared a link via .". I expect the text to be "shared a link via APPNAME." instead.
I already tried to add some settings for the Facebook App but that did not help.
This is how I trigger the share in my iOS app:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
name], @"name",
caption, @"caption",
description, @"description",
url, @"link",
picture, @"picture",
nil];
[FBRequestConnection startWithGraphPath:@"/me/feed"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
// ...
} else {
// ...
}
}];
Where can I make this setting? Is it a setting for the Facebook App or do I have to add that to the sharing call in my iOS app?
回答1:
I know this is a multi-tiered setup, and to be honest I'm not sure exactly which or all of these things contribute to the "shared via..." to be set, but I've currently got it working with my application so I'll give you details about what I've done and perhaps you're missing one of the below steps: (I've whited out my app-specific details)
1) In the "Settings" screen of my Facebook Developer Account I have the following:
Note that I have the App ID, Display Name, Bundle ID, and the "iPhone Store ID", which links to the app. If I had to guess I'd say that setting that store ID is what triggers it. It seems this leads to one of three outcomes when users click the link:
- If a user is using an iPhone and they have the app installed, the app is launched.
- If a user is using an iPhone and they DO NOT have it installed, they are directed to the App Store for the provided store ID.
- Otherwise if they are on some other browser, I'm pretty sure they'll be directed to your App's Facebook Page.
2) At the bottom of the "App Details" page, there is a selection for an App Page. I did all of this stuff after creating a new facebook account for my dev team and had to be added as an admin to our App/Company's facebook business page - I was then able to link our page to the app.
3) I then made sure to add three things to the Plist for my application, the FacebookAppID, FacebookDisplayName, and added the fb123..... (123 being the Facebook App ID) to the URL types as shown below:
来源:https://stackoverflow.com/questions/22836080/where-to-set-the-shared-via-text-for-a-facebook-app