Same Facebook app for multiple (possibly infinite) iOS apps? - ios

I want to integrate my Facebook app in multiple iOS apps. I know there's a way to include all the bundle IDs in my app settings on Facebook. But the problem is, I am providing this feature in an API.
Any person using my API, should be able make his iOS app connect to my Facebook app. And since the API is public, there is no way I'd know all the possible app ids.
I am using Facebook SDK 3.1 and logging in using
[FBSession openActiveSessionWithReadPermissions:permissions
allowLoginUI:YES
completionHandler:]

There is currently no way to programmatically add Bundle IDs to the Facebook App Dashboard. So unless you know the Bundle IDs ahead of time, you would not be able to set this up.
By the way, you want to be careful about tying one Facebook App ID to apps that are not similar to one another or extensions of one another, ex: a paid vs. free version.

Related

Do I need an approved Facebook app for Facebook share functionality in an iOS app?

I'd like my iOS app to have an option to share a photo on Facebook. I implemented it by following the instructions in these 2 links:
https://developers.facebook.com/docs/ios/getting-started/
https://developers.facebook.com/docs/sharing/ios
I tested it and it works fine if I use the same Facebook account that I used for creating the Facebook app.
The problem is if I try sharing a photo with a different Facebook account, it fails. Which makes sense as the following is written on the Facebook app dashboard:
This app is in development mode and can only be used by app admins,
developers and testers.
In this case, it looks like I need to switch my app to production from development. So, do I just need to enter URLs for privacy policy and terms of service? Or do I also need to start a submission for any kind of permission? Also, having a production app seems a bit vague as none of the instruction guides which are provided by Facebook itself mentions switching to production from development, they only show code pieces to use to have the share functionality.
Just to clarify, I don't use Login with Facebook, I only show FBSDKShareDialog for sharing photos, that's all. I don't even want to collect any information from Facebook.
You will get an option App Review . Then allow Make app Public YES .Then any one can use it

Wildcard to add multiple iOS bundle ID on Facebook Developers App?

I have many iOS apps that use the same facebook app ID to login. What we have it's basically a White Label platform.
Is there any way for me to add one single bundle formatted as a wildcard? Something like com.domain.apps.* instead of having to add com.domain.apps.app1, com.domain.apps.app2 for every single app that I create?
Thanks,
There is no way to do this. You would have to add each bundle to your Facebook app. You can also do this via the Graph API. Please see https://developers.facebook.com/docs/graph-api/reference/application/#Updating
If you add multiple applications in FB, you will face the following unsolved problem:
multiple FB Application IDs within single client using FB SDK 4
Previously, the problem could be solved with the use of a class 'FBSession'. But in the new sdk it is impossible to make.
I think there need clarification from facebook sdk developers.

Initiate Facebook Group Chat from iOS App

I want my app to create a new Facebook group chat with certain people that opens either on Facebook's site in Safari or in the native Facebook app when the user presses a button. I want Facebook to handle the whole chat and my app only to initiate it somehow in the cleanest and least involved way possible. My app already uses the Facebook SDK to open an active FBSession, so I've already got login credentials.
Looking around online and in Facebook's docs, I can't find anything that suits my needs. The closest thing I found was in this answer containing a list of Facebook app URLs you can connect to that open the Facebook app to certain pages. There's "fb://chat/(initWithUID:)" and "fb://messaging/compose/(initWithUID:)". However, not only is there no explanation on how to use these, but people say that Facebook has changed these URLs (and does not have any documentation on them), so they don't work anymore unless I reverse-engineer new URLs (which could change again). Ugh, so close!
I also found examples on starting chats with the Facebook Chat API, but that involves logging into Facebook using some networking framework then writing my own GUI and model for sending messages, which I am only prepared to do as a last resort. There should be some way to let the Facebook app or website do all that. Does anyone know how I can do this?
I've found something very close, but I still don't see a way to make my app initialize it with the desired group of friends:
The Facebook SDK has a message dialog that can appear for sending messages to friends. This isn't exactly what I wanted but is good enough because it means that all the programming is already done for me by Facebook, and users should be able to see these messages on https://facebook.com and the Facebook apps. https://developers.facebook.com/docs/ios/share#message-dialog

Registering and posting Facebook achievements from an iOS app

I have an existing iOS app on the App Store that includes Game Center achievements. Since it also has a working Facebook Connect implementation, I'd like to leverage the social channels available through the new Achievements Graph APIs with my apps.
I have created the corresponding achievement pages ready to be registered with Facebook as achievements for my app. From what I have read, since the app auth token has to be used to submit achievements and scores, I'm doing all of this on my server using some PHP scripts so I don't have to ship my secret key with my app binaries. I'm planning to have my iOS app call a script on my server when submitting achievements or scores.
I am using the same FB app that I use for the native iOS app. Obviously I want it to start generating stories and timeline events when the user unlocks achievements or reaches a new high score.
However I am running into a big stumbling block when trying to register the achievements for the FB app. I get the following error with the script that does the registration :
OAuthException: (#15) This method is not supported for native apps
I seem to be doing everything right, sending a POST to the /<appid>/achievements API with the URL for the achievements, etc.
In an effort to work around limitations on these API by Facebook, I have also enabled the existing mobile app to also be a "Website" and "App on Facebook" in the developer settings. To no avail.
So my question is... am I missing something to enable achievements that could be submitted from an iOS app through an intermediary server? I don't mind setting up canvas pages and so on if necessary, but I'd rather not have the users re-authenticate as a wholly separate app just so they can post achievements and scores to their Facebook stream.
What I'm trying to achieve is at most ask the user for additional permissions on the existing app on their devices, if necessary. It should be possible to invoke a script on my server that will push the achievements to Facebook when needed - but how ?
Is the only way to do this to use a separate FB app that is not set as a native mobile app at all, or can it be a combination native/Web app?
It means you've probably configured your application on Facebook's side as 'Native/Desktop' instead of 'web'.
In this configuration your app secret is untrusted because it's assumed you've shipped it with the client code - there's no reason your IOS app won't work in 'web' mode, so use that instead
(I'm assuming you haven't actually shipped your app secret in client code - if you have, it's a huge security problem unless your app is set to 'Native/Desktop')

Any way to unfriend with the Facebook iOS SDK

I want to be able to authenticate then list out all my friends and have the ability to unfriend someone without going through the process on the website.
Is there any way to do that using their SDK in-app with a dialog or to jump to their app only to approve.. any workaround??
No, there is no API for removing friends or deleting content (other than content uploaded by the same app)

Resources