-
-
Notifications
You must be signed in to change notification settings - Fork 56
Add support for using PF_Twitter
without a linking or logging into a Parse account
#27
Add support for using PF_Twitter
without a linking or logging into a Parse account
#27
Conversation
It is useful to be able to create a standalone instance of `PFTwitter` to make authenticated Twitter API calls without having to link a Twitter account to a Parse account or require Twitter login.
@@ -22,6 +22,15 @@ NS_ASSUME_NONNULL_BEGIN | |||
@interface PF_Twitter : NSObject | |||
|
|||
/** | |||
An instance of `PF_Twitter` configured to access device Twitter accounts with Accounts.framework, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Initializes an instance of ...
Hey @zadr, this is amazing and almost flawless. I am not sure on why OCMock doesn't like that expectation and doesn't want to mock it, so this would need a little bit of debugging probably. If you can't make it work though - you can simply create an issue for it to implement it later and I'll be happy to jump on it at any given point. Overall, once again, this looks great and is an amazing idea to implement this! |
@nlutsenko thanks for 👀ing this so quickly and thoroughly! added a new commit that addresses all your nits, and, should make all the tests pass. Using Xcode 7.3, what I had to do to get the tests run (and see what was failing) by: explicitly set the deployment target of the xcodeproj to iphoneos, and then running the following command:
Which differs from the command Travis uses to run tests on Xcode 7.2.1:
in that it doesn't specify the Earlier, on another machine, I wasn't able to get the same steps running with Xcode 7.3.1, so, I guess, Apple changed things around again? Let me know if you want me to rebase the commit with the PR feedback onto the commit that does most of the work! |
It passes as a PR on Travis - that's the important part. You can ignore |
NSError *error = task.error; | ||
XCTAssertNil(error); | ||
XCTAssertNotNil(task.result); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checks for userId
and screenName
were still useful, sorry if I was not explicit enough about this portion. I feel like it's fine to leave it as is, but if you want to update it till next morning (will merge it then) - feel free to update this part.
Looks great. Will merge in tomorrow morning. |
Re-added the asserts. And, hm. There aren't any submodules in the projects, and, I had to run To run tests in Xcode, (opening up Thanks again for reviewing this so quickly (and so late^wearly, this time :D) |
We actually do have a submodule there in |
(The obvious thing i'm missing is that |
Perfect, merging now. Just sent a PR as well for updating all dependencies and Travis CI to Xcode 7.3, so we are going to get better on that front as well. |
There are two things going on here, in two separate commits:
-[PFTwitter init]
works in that it is okay to call, and after settingconsumerKey
andconsumerSecret
, can be used to make Twitter API calls.oauth2/invalidate_token
on Twitter's API, and then to clear out local state on success.6e5e9ca contains tests for the newly added
deauthorizeInBackground
call, however, I wasn't able to get the tests to run locally, so, I can't promise that the tests do the right thing (after runningbundle install
locally, updating the deployment target, enabling ARC in the project and a few other steps that have slipped my mind, the rabbit hole seemed too deep to keep following).Went to sign the CLA, and it told me
The 'Email' value has been registered on this form before. If you would like to update an existing contributor account, please email [email protected] with your details.
, so, I think thats all taken care of.