Skip to content

change source path for loading facebook javascript #5

Closed
wants to merge 1 commit into from

2 participants

@drewrothstein

Hi,
I am not sure how best to submit this question and possibly bug since I don't see the steroids addons js in its own repo. I am sending this request with the understanding that you should probably patch this in source.

I noticed a couple traces from my app when I included the addons, it appears that the path to load these JS files isn't correct. Can you take a look?

Here are the traces-

2014-03-03 10:42:41.665 Simulator[28964:80b] ERROR: Possibly unhandled http://localhost/components/steroids-addons/index.js:8242:7
tryCatchApply@http://localhost/components/steroids-addons/index.js:5010:24
Promise$_callSpread@http://localhost/components/steroids-addons/index.js:2409:25
Promise$_callHandler@http://localhost/components/steroids-addons/index.js:2417:29
Promise$_settlePromiseFromHandler@http://localhost/components/steroids-addons/index.js:2437:30
Promise$_settlePromiseAt@http://localhost/components/steroids-addons/index.js:2619:39
Promise$_fulfillPromises@http://localhost/components/steroids-addons/index.js:2720:30
Async$_consumeFunctionBuffer@http://localhost/components/steroids-addons/index.js:269:16
Async$consumeFunctionBuffer@http://localhost/components/steroids-addons/index.js:242:36
Promise$_Scheduler@http://localhost/components/steroids-addons/index.js:4298:19
dispatchEvent@[native code]
dispatchMessageEvent@http://localhost/components/steroids-js/steroids.js:2613:32
global code@http://localhost/views/walkthrough/walkthrough.html:1:42

and

2014-03-03 10:42:40.416 Simulator[28964:80b] ERROR: Possibly unhandled http://localhost/components/steroids-addons/index.js:8257:11
http://localhost/components/steroids-addons/index.js:5140:31
subscribe@http://localhost/components/steroids-addons/index.js:6711:46
onValue@http://localhost/components/steroids-addons/index.js:5742:28
http://localhost/components/steroids-addons/index.js:8274:30
tryCatch1@http://localhost/components/steroids-addons/index.js:4990:23
Promise$_callHandler@http://localhost/components/steroids-addons/index.js:2421:22
Promise$_settlePromiseFromHandler@http://localhost/components/steroids-addons/index.js:2437:30
Promise$_settlePromiseAt@http://localhost/components/steroids-addons/index.js:2619:39
Promise$_fulfillPromises@http://localhost/components/steroids-addons/index.js:2720:30
Async$_consumeFunctionBuffer@http://localhost/components/steroids-addons/index.js:269:16
Async$consumeFunctionBuffer@http://localhost/components/steroids-addons/index.js:242:36
Promise$_Scheduler@http://localhost/components/steroids-addons/index.js:4298:19
dispatchEvent@[native code]
dispatchMessageEvent@http://localhost/components/steroids-js/steroids.js:2613:32
global code@http://localhost/views/friends/friends.html:1:42
send@[native code]
iOSExec@http://localhost/cordova.js:970:25
logLevel@http://localhost/plugins/org.apache.cordova.console/www/logger.js:233:13
__onDeviceReady@http://localhost/plugins/org.apache.cordova.console/www/logger.js:348:24
fire@http://localhost/cordova.js:747:28
http://localhost/cordova.js:220:53

The line 8257 trace only fires with cordova.js it appears while the 8242 one fires on every page of my app.

8242 is the FB.init block (second line below)-

ready = Promise.join(configuredAppId, pluginready).spread(function(appId, FB) {
    FB.init({
      appId: appId,
      nativeInterface: CDV.FB,
      useCachedDialogs: false
    });
    return FB;
  });

8257 is the FB.event.subscribe below-

facebookEventStream = function(eventName) {
    return pluginready.then(function(FB) {
      return Bacon.fromBinder(function(sink) {
        var subscriber;
        subscriber = function(event) {
          return sink(new Bacon.Next(event));
        };
        FB.Event.subscribe(eventName, subscriber);
        return function() {
          return FB.Event.unsubscribe(subscriber);
        };
      });
    });
  };

Also (cosmetic), it is named steroids.addons.js here (and in various examples) but the latest version that I have is actually just index.js included in the package. It might be helpful to update the examples, docs, and anywhere else.

@Ezku
Ezku commented Mar 7, 2014

Hello,

Thanks for the report and pull request. Here's my understanding of what's going on.

  • You're likely using the Steroids Add-ons branch of kitchensink, which is obsolete. Check out https://github.com/AppGyver/addons-kitchensink for a more current review of Add-ons functionality.
  • The documentation should consistently reference steroids-addons/index.js. If that's not the case, do let us know. Do you find the kitchensink having a different path in its layout to be misleading?
  • The specific errors you reference are partially due to an error in checking for whether the Cordova FB plugin could be properly initialized. This has been fixed in latest updates; I'm afraid the patches aren't public yet.
  • The source paths should be correct because they're not provided by the project, they're provided by the Cordova FB plugin. Thus it appears you don't have the plugin installed. Have you followed the relevant guides?

I'm afraid I won't be merging this pull request, and I'm sorry to say we are unable to accept pull requests for steroids-addons at this point in time. If you follow the guides at http://guides.appgyver.com/steroids-addons/ for installing Add-ons and setting up the Facebook Add-on and still have trouble, I would ask you to open a new issue at https://github.com/AppGyver/steroids-addons-public/issues.

Again, thanks for your contribution. If you're uncertain as to where you should go if you have any problems, try our forums: http://forums.appgyver.com/#!/steroids-add-ons

Best regards,
Eevert

@Ezku Ezku closed this Mar 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.