-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deferred initialization of the provider #36
Comments
This is actually fairly big problem on our end, because we have different config settings between staging/dev and production, and we are unable to set different AppId's because of this difference. Maybe making the Might do a pull request to implement this later tonight |
@matthew, do you not have the option to define your javascript differently On Sat, Sep 13, 2014 at 11:44 PM, Matthew de Detrich <
|
@gafilson We do have that option, however it would significantly complicate our development/production/staging cycle, seeing as our assets are statically hosted (including our javascript) in a single location For other libraries (such as angulartics using google analytics) we are easily able to set up the id which we get when we do a request from the server. In any case its something that should definitely be possible, and I am currently coding a solution that lets you pass as a promise so you can initialize facebook ID any way you wish Also, according to the anuglarjs irc channel, you should not be using .config for setting up stuff like id's. Its meant to be for statically defined properties, not for ID's on libraries which change depending on deployment environment |
@matthew, that makes sense to me. The current solution is inflexible. W/r to your solution would the promise be accepted by the provider and then On Tue, Sep 23, 2014 at 11:54 PM, Matthew de Detrich <
|
My solution would retain the current option of setting an appId via This means if you get your appId via |
Just wanna letting u know that a pitch PR would be really appreciated. |
Quite busy this week, so still working on it. I have had to rewrite almost all of the test cases, while learning how karma works, should be done during this week |
Just let me know if you need help about the karma tests. May you can provide the prototype first and we work out the tests together ? |
I'm excited about this change. Let me know also if I can help with code On Mon, Sep 29, 2014 at 10:51 PM, Moritz notifications@github.com wrote:
|
Hey guys, unfortunately I have had less time this week then originally anticipated, so I have posted what my curent implementation is. Its unfinished but the foundations are there, will have more time to look at it next week but if someone wants to help out, then that is more then welcome! |
Hey guys, i'm encountering a similar problem and am very interested in the proposed fix. Can I help at all with getting this merged in? |
@absolutehype there is a pull request that I have done, however its not finished yet (due to time constraints). I suppose you can have a look at trying to finish it off, the premise is simple, config is passed through using a promise, which can mean anything (including a Pull request is here |
Just letting you guys know, that I am using the pull request and its working for me, just need to update and fix the tests As an example, this is how I initialize my Facebook SDK var facebookDefer;
facebookDefer = $q.defer();
facebookSettings.load(function(settings) {
return facebookDefer.resolve(settings.appId);
});
Facebook.initAppId(facebookDefer.promise);
You can obviously get promises from |
What happened with this issue? |
I am using my branch in production, and its working fine. Some tests still need to be adjusted for it to work, and I haven't had time to do that (mainly because its non trivial, my branch made If someone wants to work on my branch, they are more then welcome to do so. Else I will have some time in a couple of weeks to try and finish it off |
+1 |
@mdedetrich just cant make it working in production with minified js, really need a solution to load it in run phase (or controllers), thoughts? |
Will have a look into it in a couple of days |
+1 |
@stewones I just had a look at the code, there is nothing indicating why it wouldn't work minified (and we use it minified in production). Can you provide any more info? |
I've been using it for half a year now without any problems :) |
Hi!
Is there any way how one can init Facebook dynamically when on specific stage AppId gets known? It is being received by some query and is not defined on config phase.
So what I would like to know - is how could I provide following sequence:
Thank you in advance!
The text was updated successfully, but these errors were encountered: