Tai Nguyen
Tai Nguyen

Reputation: 956

C# How to Get Access Token Facebook windows phone 8.1

i have one problem, i try to get the access token Facebook. I follow this tutorial http://bsubramanyamraju.blogspot.fr/2014/12/windowsphone-store-81-facebook.html?showComment=1445792544505#c2303536138000766292

I am successfully Login, but i'm can't get the access token. The function : ContinueWithWebAuthenticationBroker isn't Call.

I already put IWebAuthenticationBrokerContinuable in my MainPage.

EDIT :

class ContinuationManager
{
    public void ContinueWith(IActivatedEventArgs args)
    {
        Debug.WriteLine("ContinuationManager::ContinueWith");
        Debug.WriteLine("IActivatedEventArgs args:");
        Debug.WriteLine(args);

        var rootFrame = Window.Current.Content as Frame;
        if (rootFrame == null)
            return;

        switch (args.Kind)
        {
            case ActivationKind.PickFileContinuation:
                break;
            case ActivationKind.PickFolderContinuation:
                break;
            case ActivationKind.PickSaveFileContinuation:
                break;
            case ActivationKind.WebAuthenticationBrokerContinuation:
                Debug.WriteLine("Frame rootFrame.Content:");
                Debug.WriteLine(rootFrame.Content);
                var continuator = rootFrame.Content as IWebAuthenticationBrokerContinuable;
                if (continuator != null)
                {
                    Debug.WriteLine("ContinuationManager::ContinueWith continuator OK > ContinueWithWebAuthenticationBroker");
                    continuator.ContinueWithWebAuthenticationBroker(args as WebAuthenticationBrokerContinuationEventArgs);
                }
                else
                {
                    Debug.WriteLine("ContinuationManager::ContinueWith continuator NULL");
                }
                break;
            default:
                break;
        }
    }
}
interface IWebAuthenticationBrokerContinuable
{
    void ContinueWithWebAuthenticationBroker(WebAuthenticationBrokerContinuationEventArgs args);
}

rootFrame.Content is not Nul but var continuator = rootFrame.Content as IWebAuthenticationBrokerContinuable; is NULL

How i can fix that?

Can you help me?

Upvotes: 1

Views: 176

Answers (1)

Bastien Fulashd
Bastien Fulashd

Reputation: 1

You have to had IWebAuthenticationBrokerContinuable in the page where you have your ContinueWith and the call to the facebookHelper.

"YourPageName" : Page, IWebAuthenticationBrokerContinuable

It worked for me, hope it will helps you.

Upvotes: 0

Related Questions