We are using branch.io to pass custom data to App. For that we are following this steps in branch dashboard.
1) Ads -> Partner Management -> Facebook -> Create Facebook Link
2) Set data in Key/Value under "Deep Linking" Section (data which we need in our app)
3) We set Play/App Store URL in Android/iOs respectively Or set Default Redirects under "Redirects" section
That's it!!!
Now Go to Facebook Ads Manager and select App Install Campaign.
1) Select Play/App Store under App Section.
2) Set above generated URL under "deffered deep link"
You can read more here : https://docs.branch.io/pages/deep-linked-ads/facebook-app-install-ads/
Now Our Problem is :
When user clicked on any branch link with deep link params it able to receive data in both case when user fresh install the application and if user has already app installed.
When we clicked on Facebook ads with same url we are unable to get branch data if user has not installed application (Mostly in case when user redirect from App Store/play store) . But user has installed the app we can able to receive all branch data from same url.
So Question is:
1) Do we need any permission from Facebook or missing any configuration on Branch or Facebook?
2) The same thing will work with both (e.g. Android and iOs) devices?
Thanks
Unfortunately the branch.io documentation for setting this is up is pretty incomplete - we just spent about a week testing and debugging the SDK to figure out how to get it to work. The necessary changes itself are actually quite simple.
On Android:
Integrate the Facebook SDK if you haven't done so already
Ensure that the facebook_app_id string resource you added as part of (1) is not prefixed with "fb"
If you are using ProGuard, add rules to keep the relevant parts of the Facebook SDK
Call enableFacebookAppLinkCheck() on your Branch instance right after initializing it
On iOS:
Integrate the Facebook SDK if you haven't done so already
Call registerFacebookDeepLinkingClass(FBSDKAppLinkUtility.self) on your Branch instance right after initializing it
I had this exact same problem, but in a React Native project, so I'm using react-native-branch. #henning-dodenhof 's answer helped me a lot (thanks for figuring this out!), but I needed a couple of further adaptations, so I add this answer in case it's useful for someone else since this post was the main thing I found regarding this issue:
For iOS:
The FB SDK registration needs to happen before initializing Branch, not after as the above answer suggests. So, before this line that you add as part of the normal library setup:
[RNBranch initSessionWithLaunchOptions:launchOptions isReferrable:YES];
You need get the Branch instance from RNBranch and then register this FB SDK class:
[[RNBranch branch] registerFacebookDeepLinkingClass:[FBSDKAppLinkUtility class]];
Adding this new line before the initialization is critical, doesn't work if it's done after.
For Android:
Here the setup code already gets an instance with Branch.getAutoInstance(this), so we can just chain the registration:
Branch.getAutoInstance(this).enableFacebookAppLinkCheck();
It looks like the getAutoInstance above doesn't actually fully initializes the instance, so you can call enableFacebookAppLinkCheck right after, and the instance gets fully initialized after the first use.
I am trying to integrate the ok.ru sdk for an iOS game following these instructions.
The app is created on the website following instructions mentioned here. But when I try to post something, I get the error message
"Indicated redirect_uri is not registered in App Settings.
redirect_uri:ok1139715840://authorize"
The problem is that the redirect uri contains the app id that is obtained only after app creation.
According to this link, the redirect uri needs to be mentioned when creating the app. I cant even go back and edit the app settings as when I click on the app, it says "Page not found".
Has anyone successfully integrated this sdk?
Can some instructions be provided (in english) on how to do this successfully and get rid of the current error??
The same error will arise with the android sdk as that also a redirect uri as shown in the link above.
Go to odnoklassniki API page, and chan your application url to "http://localhost" while you developing.
Once it's in production then change with your site.
API page : http://apiok.ru
Finally figured out:
You have to scroll to the bottom of the page and then you will find an App Settings button. Click on it, enter your application secret and then you will be able to edit the app settings.
Just go to the app settings in Odnoklassniki and add ok1139715840://authorize to accepted redirect_uri list
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
I have researched the most popular questions on SO already (Question 1, Question 2, Question 3, Question 4, and Question 5)... None of them help with my situation.
I have the application settings laid out like this...
App Domains: azeverything.com
Sandbox Mode: Disabled
Website with Facebook Login
Site URL: http://azeverything.com
****App Domains*** requires that no protocol be identified and Site URL requires that a protocol be identified.*
I have tried using www.azeverything.com and that didn't work either. Everything seems to match up. By the way, this is a WP site. I'm not developing locally either. It's all live.
Try to check at Settings > Advanced. At Valid OAuth redirect URIs, make sure you have a correct domain.
Hope it works.
You need to add the URL to your app:
Go to the app, you want for user login, on the Facebook Developers page
Click on the settings tab
Click add platform
Select Website
After selection it will ask for some details such as URL for your website which uses login with facebook feature, fill the form and submit it
That's all and you are done. Make sure that the app's URL is the same from where you're logging in.
Under Basic settings:
Add the platform - Mine was web.
Supply the site URL - mind the http or https.
You can also supply the mobile site URL if you have any - remember to mind the http or https here as well.
Save the changes.
Then hit the advanced tab and scroll down to locate Valid OAuth redirect URIs its right below Client Token.
Supply the redirection URL - The URL to redirect to after the login.
Save the changes.
Then get back to your website or web page and refresh.
This is a basic breakdown for slow people like me, and I didn't see this mentioned before.
The "redirect uri" isn't the place where you're redirecting to, but where it's coming from.
Say you have your app at http://myFBapp.com listening to /auth/facebook, and after they log in, redirecting them to /UserLoginHooray. The "Valid OAuth redirect URIs" should read http://myFBapp.com/auth/facebook, not http://myFBapp/UserLoginHooray.
Explanation:
HTTP Requests that have been redirected (302) include the original address in the header, so Facebook is merely putting a very basic layer of security on the request.
I chased my tail on this issue for hours. My coder and I could login with FB without a problem but my wife couldn't. She would get this topic's subject message. I tried every setting and URL that I could think of for my Lavarel app.
My issue was that my wife was signing in from:
http://www and we were using http://
A short trip to CPanel and a redirect fixed that. Hope this helps someone!
For Lavarel these FB app settings worked for me:
Settings/Basic - App Domain: mydomain.com , Site URL: http://mydomain.com/login.
Settings/Advanced - Client OAuth Login: Yes.
Settings/Advanced - OAuth redirect URIs: http://mydomain.com , http://mydomain.com/login.
App Details/App Center listed platforms = No. I'm only using the login for now.
I have a website with facebook login.
It has been stable and working for months.
No code change has happened for weeks.
Then, suddenly, the facebook login gives an error message:
Error
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
After debugging "for awhile", I reset my facebook app secret and it started to work again!
Michael Blackburn's answer helped me resolve my issue, but I want to give more detail on my fix.
I have a php app that posts to a user's FB page.
I own two domains:
http://app.my-web-app.com
http://app.mywebapp.com (no hyphen)
I built my site off the first domain because it read better IMHO (at least it did at the time).
Some users typoed the url so I bought the second one with no dashes for that reason.
So, one of my users was having the "Given URL" error.
Turns out he was going to http://app.mywebapp.com and the rest of them were going to http://app.my-web-app.com
I fixed everyone by adding all possible redirect URIs:
Granted, there are 100 better ways to implement this, but here is the workaround for now.
1.Make Sure Website Url and platform added, if not then visit https://developers.facebook.com/quickstarts/ then Select
Platform -> Setup SDK -> Website Url And so on..
Note: website url can't be like this : https://www.example.com just remove www and make it simple and working ;)
2.Goto App Dashboard -> Setting -> Click on Advanced Tab then go to bottom of the page and enable Embedded Browser OAuth Login
and leave Valid OAuth redirect URIs blank and Save it
I found Valid OAuth Redirect URIs under PRODUCTS then Facebook Login > Settings not as everyone is stating above. I am supposing this is a version issue.
It still didn't work for me. I guess I really have to add Android Platform rather than just the Website. This is annoying because my app is still in development mode :(
UPDATE: I'm using Expo to develop my react-native app and used info provided here: https://developers.facebook.com/apps/131491964294190/settings/basic/ to set up the Android and iOS platforms. This resolved the issue for me.
Sometimes this error occurs for old javascript sdk. If you save locally javascript file. Update it. I prefer to load it form the facebook server all the time.
Go to facebook developer dashboard
Select settings -> select WEB(for website) -> Add platform
Add your site URL.
This should resolve your issue.
So... facebook distinguishes pretty harshly between http and https in your app. This is just another small thing to check if you run into trouble.
I solved this issue by specifying correct site URL in my App Settings.
It works fine now. You have to specify your website Url such as http://www.xyz.com/
Under advanced tab make sure "Valid OAuth redirect URIs" contains valid URI or leave it empty(not recommended)
"http://example.com/"
instead of
"http://www.example.com"
sometimes you need to check your code (the part of redirect)
$helper = new FacebookRedirectLoginHelper('https://apps.facebook.com/xxx');
$auth_url = $helper->getLoginUrl(array('email', 'publish_actions'));
echo "<script>window.top.location.href='".$auth_url."'</script>";
if any changes happens there (for example, the name of your application "https://apps.facebook.com/xxx" in relation the application settings in facebook, you will get the above error
For Android Developers,
Make sure you have enabled Facebook Login inside the Products list inside Dashboard of your Facebook project app and have added all the required details as you go through the whole flow.
The login should work without giving the same error.
I am using Easy Facebook android SDk v2.3. I could successfully access a page and get details of page including number of likes.
I am trying to implement like button in the app using setLikes(String likes); method of Page class but getting confused with what is to be passed as the parameter.
Sample Code :
p = Global.graphApi.getPage("Page ID");
p.setLikes(String likes); //what should likes be replaced with, replacing it with user id didn't work
Any help on this is appreciated.
According to the facebook documentation, (Page), you cannot like a Page via Graph API, even though you can read the like count information.
User, have to press the like button himself to like the page.
The accepted answer here may help you: like android application page in facebook from application itself
So I have been trying to run the Facebook Connect example for PhoneGap / Android with no luck.
https://github.com/davejohnson/phonegap-plugin-facebook-connect *
There are some similar threads with the same problem.. conclusion is that "Facebook SDK is a moving point"
I have succesfully compiled previously apps using phoneGap & Eclipse.
Now following the example* for Android. If I do exactly what they suggest. App shows the buttons but nothing happens when I click on them.
After analyzing the code I have noticed that
function initFB(){
try {
FB.init({ appId: "45253452345234523", nativeInterface: PG.FB });
document.getElementById('data').innerHTML = "";
} catch (e) {
alert(e);
}
}
there is a parameter nativeInterface : PG.FB which is nowhere described within Facebook API for this call..
http://developers.facebook.com/docs/reference/javascript/FB.init/
what is more interesting is that when i remove this parameter.. suddenly Login button goes to Facebook page with Error Code API 191.
So my question is what this parameter is supposed to do? and why it is not in Facebook API?
I have found no info about this parameter in internet. I guess if it would be a case of an out-dated FB API there would be some info available.
Any ideas?
Thanks,
Marcin
The "nativeInterface: PG.FB" option is to tell PhoneGap to use the native authentication interface instead of the mobile web interface. If you don't add in the "PG.FB" option, you'll get redirected to Facebook's mobile authentication instead. It took me a while to figure this out too, and it's not well documented, but that's what is going on.
Two other things about the PhoneGap Facebook Plugin that are not up to date with the latest Facebook JavaScript SDK:
When using FB.login() you should be using the "scope" parameter, but PhoneGap expects the deprecated "perms" parameter.
When the authentication response from FB.login() you should be getting "response.authResponse", but instead "response.session" is what is given back. This means you'll have to pull out the OAuth Access token with "response.session.auth_token" instead of "response.authResponse.accessToken".
Hopefully they'll get to updating the PhoneGap Facebook Plugin, but for now I use if/else statements to detect if PhoneGap is there. You can check if PhoneGap is initialized by using:
if(window.PhoneGap) {
//PhoneGap Library is Loaded
}