App Domains: localhost
Website with Facebook login: http://localhost/auth
मैं http://localhost/auth/
और मेरे क्रोम डेवलपर कंसोल में जाना मैं त्रुटि देखें: 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.
मैं स्थानीयहोस्ट फेसबुक ऐप विकास में क्या गलत कर रहा हूं?
मैं एक दृश्य के स्रोत निम्न कार्य को देखने के लिए:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div id="fb-root"></div>
<script>
// Additional JS functions here
window.fbAsyncInit = function() {
FB.init({
appId : 'myappidremovedfromstackoverflowquestion', // App ID
channelUrl : '//localhost/auth/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional init code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<p>hello</p>
</body>
</html>
मैं http://localhost/auth/channel.html
के पास जाकर एकल रेखा देखने के लिए स्रोत देखें:
<script src="//connect.facebook.net/en_US/all.js"></script>
चूंकि एसओ वॉचडॉन्ग मुझे जवाब संपादित करने नहीं देंगे, इसलिए मैं सही भाग को एक टिप्पणी के रूप में पोस्ट करूंगा: समस्या यह थी कि कुछ समय पर मैंने वैध ओएथ को उन्नत सेटिंग्स के तहत यूआरआई को रीडायरेक्ट किया था अलग और वह सभी अन्य सेटिंग्स ओवरराइड कर रहा था। उस फ़ील्ड को खाली करने से समस्या ठीक हो गई है, लेकिन निश्चित रूप से सही फ़ील्ड उस फ़ील्ड को उस विशिष्ट URL पर सेट करना होगा जिसे मैं एक्सेस टोकन प्राप्त करना चाहता हूं। – necromancer
शानदार जवाब! – user123
इसके अतिरिक्त, यदि आप कस्टम पोर्ट का उपयोग कर रहे हैं, उदा। 127: 0.0.1: 8080, मेरे लिए यह केवल तभी काम करता था जब मैंने फेसबुक के ऐप डैश में बंदरगाह जोड़ा। तो/etc/hosts 127.0.0.1 में, लेकिन एफबी में: 127.0.0.1:8080 – willdanceforfun