Facebook登录无法加载URL

时间:2019-06-10 10:16:43

标签: php facebook facebook-php-sdk

我在这里找不到有关此问题的主题,但没有任何帮助。这是我第一次尝试将Facebook登录到我的网站(使用PHP)。我找到了一些教程,完成了所有步骤,当我想尝试登录时,出现错误“错误:无法加载URL:此URL的域未包含在应用程序的域中”。这是我在FB应用管理器中的设置的屏幕截图: basic settings - app domains

fb login settings

即使我尝试将重定向URL粘贴到其验证器中,一切似乎都还不错。 screenshot of redirect URL validator

Scanner scan = new Scanner(System.in);

String strgNum = "";
boolean isValid = false;
while (!isValid) {
    System.out.print("Enter any Integer value: ");
    strgNum = scan.nextLine();

    /* See if a signed or unsigned integer value was supplied.
       RegEx is used with the String#matches() method for this.
       Use this RegEx: "-?\\d+(\\.\\d+)?"  if you want to allow
       the User to enter a signed or unsigned Integer, Long, 
       float, or double values.         */
    if (!strgNum.matches("-?\\d+")) {
        System.out.println("You must supply a numerical value (no alpha characters allowed)!");
        continue;
    }
    isValid = true; // set to true so as to exit loop
}
int num = Integer.parseInt(strgNum); // Convert string numerical value to Integer
/* Uncomment the below line if you use the other RegEx. You would have to also 
   comment out the above line as well.   */
// double num = Double.parseDouble(strgNum); // Convert string numerical value to double
if (num > 0) {
    System.out.println(num + " is positive");
}
else if (num < 0) {
    System.out.println(num + " is negative");
}
else if (num == 0) {
    System.out.println(num + " is neither positive nor negative");
}

0 个答案:

没有答案