GithubHelp home page GithubHelp logo

Manually set access_token about hello.js HOT 6 CLOSED

FrEaKmAn avatar FrEaKmAn commented on May 17, 2024
Manually set access_token

from hello.js.

Comments (6)

MrSwitch avatar MrSwitch commented on May 17, 2024

Hi @FrEaKmAn

The credentials can be set using hello.utils.store(network, object) e.g.

hello.utils.store("facebook", {
     access_token:"A1B2C3D4E5F6G7", 
     expires:1381355029
});

let me know how it goes...

from hello.js.

FrEaKmAn avatar FrEaKmAn commented on May 17, 2024

Yes, I think it works. I hope so. I'm using this code

    hello.utils.store("facebook", {
        access_token: app.social.facebook.token,
        expires: app.social.facebook.expires
    });

    hello.api('facebook:/me/share', 'post', { 'message': badge.share_message, 'picture': badge.share_badge }, function(r)
    {
        alert(r);

        (!r || r.error) ? error() : success();
    });

and it posts to facebook. Only problem is that callback is not called. Any ideas how to debug it?

from hello.js.

MrSwitch avatar MrSwitch commented on May 17, 2024

Hi @FrEaKmAn i can't recreate this bug. Can you provide some more info, starting with the network request/response for this. Thanks

from hello.js.

FrEaKmAn avatar FrEaKmAn commented on May 17, 2024

Hi @MrSwitch. Well I'm using this with Phonegap project (testing on Windows PHone 8). It think problem could be with the way you are checking if request has completed. If you check the line 1747 the event r.onload is not firing. I have added below

    r.onreadystatechange = function()
    {
        if (r.readyState == 4)
        {
            r.onload();
        }
    };

to work. I'm sure it could be improved, but for now it works.

from hello.js.

MrSwitch avatar MrSwitch commented on May 17, 2024

Oh cool, i haven't tried it on PhoneGap yet. You probably know better than i. Just a thought though, have you added "https://graph.facebook.com" to the whitelist (as described here http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html) ?

from hello.js.

MrSwitch avatar MrSwitch commented on May 17, 2024

The issue no longer fits the title. @FrEaKmAn Please open an issue to support PhoneGap.

from hello.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.