forge.facebook.authorize 不重定向網站 (forge.facebook.authorize not redirecting for website)


問題描述

forge.facebook.authorize 不重定向網站 (forge.facebook.authorize not redirecting for website)

I have a trigger.io app working fine using facebook authentication on Android and iPhone, however, when I publish it locally for web via Chrome clicking on the "Connect to facebook" button does not call the forge.facebook.authorize function. There is no output of it failing either. Help?

forge.logging.info("Facebook pressed!");

            forge.facebook.authorize(['email', 'user_birthday', 'user_about_me'], function () {
                forge.logging.info("Facebook success");

                forge.facebook.api('/me', function (response) {
                    FBLoginOrCreateAccount(response);
                }, function () {
                    forge.logging.info("facebook graph call failed.");
                    $(".loading").hide();
                });
            }, function (e) {
                forge.logging.info("facebook failed: " + JSON.stringify(e));
                $(".loading").hide();
            });

參考解法

方法 1:

Our Facebook SDK integration is for mobile platforms only: http://docs.trigger.io/en/v1.4/modules/facebook.html#facebook-authorize

What you should do is branch your code using forge.is.web() and use Facebook's normal oauth and REST API for your web version.

方法 2:

www.facebook.com

        forge.logging.info("Facebook pressed!");

        forge.facebook.authorize(['email', 'user_birthday', 'user_about_me'], function () {
            forge.logging.info("Facebook success");

            forge.facebook.api('/me', function (response) {
                FBLoginOrCreateAccount(response);
            }, function () {
                forge.logging.info("facebook graph call failed.");
                $(".loading").hide();
            });
        }, function (e) {
            forge.logging.info("facebook failed: " + JSON.stringify(e));
            $(".loading").hide();
        });

(by user1551227Amir NathooPséèko Slipknot Chahin)

參考文件

  1. forge.facebook.authorize not redirecting for website (CC BY-SA 3.0/4.0)

#forge #trigger.io #facebook






相關問題

forge.facebook.authorize 不重定向網站 (forge.facebook.authorize not redirecting for website)

iOS6 和 XCode 4.5 - 無法將應用上傳到應用商店 (iOS6 and XCode 4.5 - Unable to upload app to app store)

trigger.io facebook аўтарызаваць «нечаканы збой» з iphone 5 (trigger.io facebook authorize "unexpected failure" with iphone 5)

Đóng ứng dụng di động Trigger.io forge qua javascript (Android / iOS) - để áp dụng Tải lại (Closing a Trigger.io forge mobile app via javascript (Android / iOS) - in order to apply Reload)

為什麼@inject 方法在實時服務器上不起作用 (why @inject method is not working on the live server)

在 GForge、LDAP 身份驗證中,如何設置屬性 authenticatedBind 的值? (In GForge, LDAP Authentication, how do I set the value for the property authenticatedBind?)

創建一個類對象列表以將它們與另一個類對象進行比較 (creating a list of class objects to compare them with another class object)

Autodesk Forge 如何保存和顯示標記 (Autodesk Forge how to save and show Markups)

如何在 Forge Laravel 網站上進行 404 錯誤的高級調試 (How to do advanced debugging of 404 Error on Forge Laravel Website)

Forge:選擇單個零件:無法在零件之間切換 (Forge: Select a single part: cant switch between parts)

為什麼 composer.json 需要 PHP 7.4 但服務器正在運行 PHP 7.3 不會中斷部署? (Why composer.json requires PHP 7.4 but server is running PHP 7.3 doesn't break in deployment?)

是否可以通過從外部網頁接收特定 ID 來實現 Forge Viewer 中的突出顯示功能? (Is it possible to implement the highlight function in Forge Viewer by receiving a specific ID from an external web page?)







留言討論