-
Notifications
You must be signed in to change notification settings - Fork 79
[discussion] Expose ability to login with custom method + examine response object #7
base: master
Are you sure you want to change the base?
Conversation
…ent.h. Use METMethodCompletionHandler instead of METLogInCompletionHandler to expose the login response body.
I'm wondering if there isn't a better way to achieve what you need, as Meteor itself doesn't expose the result object either it seems, not even in the internal login function (see here). That being said, changing |
To your first point, I do agree there is probably a better way to achieve what I've described since it is indeed not exposed in meteors internal login function. So exposing this in the public header probably isn't the right thing to do. I can keep the function in As far as translating between I'll mess around a little more with this and see if I can do something cleaner that you like. If we dont want to expose _internal.h or change the existing API we can add a separate category...perhaps |
Ideally, I'd like to make it possible for new account methods to be distributed separately (e.g. similar to the For now, I think the pragmatic solution would to be to change I'd prefer not to expose |
Agree that account methods should be in categories and should be able to be distributed separately. I'm in the same boat as you on the CocoaPods knowledge, but I'm sure its not that complicated after a bit of reading up on it. As far as our generic facebook login code, it works well for us, but since method is a custom one, it is not officially supported by meteor so dont think it belongs in this library right now. We can look into submitting a PR for it to meteor, but this will take some time to happen. There are two issues here. One is how to expose the First issue: I think it will be fine to expose this method in a separate public header with this method as you have said (ie Second issue: Changing the API as I have done is an ok solution. I just thought of another that may be cleaner. We leave the existing I'll try to get my new ideas/cleanup into this PR so we can see it in action sometime tomorrow. |
Tried to implement what I just suggested in the last commit. Not sure if this way is cleaner or not than the first. Let me know what you think. There are a lot of diffs since I had to change the podspec to expose Hopefully you can sift through it to see the good stuff. |
Thanks! I'm not sure if having a variant with two completionHandlers is cleaner. I think I prefer one consistent method. Changing I agree checking in the Because I'm working mostly with iOS 8 and Swift now, I've been looking at other approaches like Carthage, which can be used with Git submodules. But this still seem immature and CocoaPods is much more widely known. I'm not sure what to do here. Do you have any recommendations? |
This reverts commit e57e244.
I think this issue would be best solved by building individual submodules within the Obviously, |
Using submodules seems ideal, but I'm not sure how this would work. Do you know anything about splitting framework targets into submodules? You would probably have to specify your own module map. But that wouldn't give you separate binaries I think. Maybe using separate frameworks would make more sense? Using MeteorAccountsFacebook.framework is not as pretty, but might be more practical. It could also have its own dependencies (e.g. FacebookSDK). With CocoaPods you'd probably use subspecs here, but these would all be built into a single library/framework. |
The nice thing about Swift and dynamic frameworks is that every class within the framework can be imported individually. For instance I could create a new class and import the entire ReactiveCocoa module ( Separate frameworks appears to be the best solution, as you can create a framework called |
Expose loginWithMethodName:parameters:completionHandler: in METDDPClient.h. Use METMethodCompletionHandler instead of METLogInCompletionHandler to expose the login response body.
Not sure if this is the right way to go about it but figured i'd send a PR to start a discussion on how to achieve the following:
It is helpful to us to be able to see the login response object as it contains some valuable tracking information (ie whether a new account was created.) in addition to the login tokens/userId.
We have a custom login method that accepts a facebook auth token directly and returns the users meteor credentials. Details on this type of custom login can be seen in our response to the following stack overflow issue here
This PR is what I'm working with now to achieve this. Any feedback on how to expose this power more cleanly from meteor-ios is welcomed.