GithubHelp home page GithubHelp logo

doubleencore / detweetcomposeviewcontroller Goto Github PK

View Code? Open in Web Editor NEW
316.0 316.0 71.0 9.2 MB

The iOS 4 compatible Tweet Sheet.

License: BSD 3-Clause "New" or "Revised" License

Objective-C 99.97% Shell 0.03%

detweetcomposeviewcontroller's People

Contributors

derandereandi avatar jaygraves avatar johankool avatar marykarin avatar oroepcke avatar skabber avatar typester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

detweetcomposeviewcontroller's Issues

Not Tweeting

Hi EveryOne,
I have used this openSource for tweeting from my IOS app, till now it was working fine, but today, its not tweeting, please help me to find out the problem, and to solve, i have also made a new twitter app even with another twitter Id, but still its not tweeting any of the content from my IOS app.
and please tell me how to check why the tweet is failing, i mean how to get the error in DETweetComposeViewController.

Thanks.

DEEmbossedLabel.m implement innerShadow class don't work with accent letter

Hello, i have see this class that implement this class:
https://github.com/mruegenberg/objc-utils/tree/master/UIKitAdditions

and i have see that the letter with accent, like àèòù etc... are not displayed and are display some symbol instead. how fix this?

i think the problem is here:

  • (void)drawTextInContext:(CGContextRef)context
    {
    CGContextSelectFont(context, [self.font.fontName cStringUsingEncoding:[NSString defaultCStringEncoding]], self.font.pointSize, kCGEncodingMacRoman);
    CGRect textRect = [self textRectForBounds:self.bounds limitedToNumberOfLines:1];
    CGContextSetTextPosition(context, textRect.origin.x, textRect.origin.y + 5.0f);
    CGContextShowText(context, [self.text UTF8String], strlen([self.text UTF8String]));
    }

LogOut Issue in DETweetComposeViewController

While using DETweetComposeViewController in iphone 3GS, (IOS Ver 4.3.1), once i login into Twitter account, there is no option to logout or login as Another user in Twitter account.

Consider making a category for checking for iPhone or iPad devices

I see this type of code in three different classes:

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)

This works, but a better pattern might be to add two UIDevice category methods:

[[UIDevice currentDevice] isPad]
[[UIDevice currentDevice] isPhone]

These will keep the code a bit cleaner and simpler!

Wrong saveOAuthContextToUserDefaults called

When calling saveOAuthContextToUserDefaults in (void)twitterDidLogin, it seems to call the one in OAuth+UserDefaults.h instead of OAuth+DEUserDefaults.h. If I delete OAuth+UserDefaults.h, then the method in OAuth+DEUserDefaults.h will be called. My controller imports DETweetComposeViewController.h and OAuth+DEExtensions.h.

Am I missing out anything that causes this behaviour? I'm using Xcode 4.2.1 and testing it in the default templates generated for Single View Application on the iPhone 4.3 Simulator.

Also, in the Twitter authorization window, clicking 'Cancel, and return to app' causes the app to terminate at OAuth synchronousAuthorizeTwitterTokenWithVerifier with this error: Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]

Add clarification for a bit of code in DEViewController

There is a bit of code in DEViewController whose purpose is rather ambiguous to me:

In -viewDidLoad:

[self willAnimateRotationToInterfaceOrientation:self.interfaceOrientation duration:0.0f];

Why are we calling this method? It makes sense to either explain what it's doing in a comment, or create a new method whose name lends some clarity.

Transparent Background Fails with Container Views

If the view controller from which you present the DETweetComposeViewController is a subview of a container view such as a UITabBarController, the view in the background will disappear when the tweet sheet appears.

oauth_token is equal to blank

After twitter made update to their framework(1.1) your application stopped working.
It happened to me 3 days ago.

This is what I get when trying to authenticate inside your application: http://dl.dropbox.com/u/146080740/Screenshots/3.png

I did not edited the twitter application and it used to work for 1 month in my iOS application.

Please let me know if anyone else has this problem and what is the solution.

Thank you.

YawkeyCleanTeeth.jpg case doesn't match

In the project we have an image named YawkeyCleanTeeth.JPG, but the code references YawkeyCleanTeeth.jpg. The image extension should be changed to all lowercase to match.

Crash in DETweetPoster

Hi there,

just got a crash with this stack trace:

Exception Type:  SIGBUS
Exception Codes: BUS_ADRALN at 0x0
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                     0x34a80466 objc_msgSend + 18
1   WorldViewLive                       0x0010f47d -[DETweetPoster connection:didFailWithError:] (DETweetPoster.m:231)
2   Foundation                          0x31199175 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFail:] + 137
3   Foundation                          0x311990af _NSURLConnectionDidFail + 87

Looks to me that DETweetPoster is already deallocated when this happens. How about adding the connection as an iVar, retain it, and in dealloc cancel the connection and release it, also release in then in didFailWithError and connectionDidFinishLoading which is not used so far.

What do you think? Any other suggestions?

Andreas

-[CALayer renderInContext:] does not work with CAEAGLLayer's

-[CALayer renderInContext:] does not work with CAEAGLLayer's which causes any background OpenGL views/layers to disappear when the Twitter view comes up.

The solution was to disable to background view entirely and use UIModalPresentationCurrentContext for the presenting view controllers modalPresentationStyle.

DEHTTPRequest hanging in iOS 4 when connection issues present

DETweetComposeViewController appears to be getting hung in CheckTwitterCredentials, specifically when OAuth is attempting to use DEHTTPRequest in synchronousRequestTwitterTokenWithCallbackUrl and there is an error with the connection. In these cases, connection:didFailWithError is called instead of connectionDidFinishLoading, so requestFinished is never set to YES. This causes DEHTTPRequest to wait for the request to finish forever which causes DETweetComposeViewController to get stuck on the grey background, so the user is unable to do anything without exiting the app.

A simply fix is to set requestFinished to YES in connection:didFailWithError as well, although I'm not sure if this breaks other things. Also, it would be more elegant to have DETweetComposeViewController show an alert in these cases, although I wasn't sure of the best place to check whether the token request succeeded and show a message otherwise. With just the fix above, the DETweetComposeViewController will show, the user can type a message, and sending will obviously fail, but at least then the user can cancel out of the view and continue using the app.

This is probably not a case hit by many users, but this could happen if an iOS 4 user tries to tweet without internet access.

Add more clarification for a comment in DETweetComposeViewController

There is a comment in DETweetComposeViewController which is a bit unclear to me:

In +displayNoTwitterAccountsAlertWithTarget:action:

// The iOS5 apps mix up cancel and the action, so we do it too.

Dave explained this to me (apparently, the "OK" and "Cancel" button positions get switched in certain situations), but you might want to add that explanation to the comment in the code itself.

Delegate?

Is there any possibility to hook up an event when user completed tweeting?

Remove ASIHTTPRequest

The unofficial-twitter-sdk/OAuth package currently uses ASIHTTPRequest. Switch to something like NSURLConnection.

Tweet dismissal up

Not sure this is something we can imitate but when the iOS 5 Tweet dismisses the Tweet view dismisses up and the keyboard down.

DETweetComposeViewController and ARC

Hello,

I set the use of ARC for my project, and initially implemented the tweet functionality with TweetComposeViewController.

Now I am trying to use DETweetComposeViewController, but, when building, I get many errors related to using ARC (DETweetComposeViewController instead manages the memory).

So, did someone experience using DETweetComposeViewController with ARC?

Thanks!

Duplicate symbol jsonbase with facebook.framework

when i add all facebook and twitter to my application, facebook first and it run okay. but when i intergrate twitter, i follow the instruction, i build fail with error: duplicate symbol _SBJSONErrorDomain in:
/Users/thanhpn/Library/Developer/Xcode/DerivedData/Horoscope-abixdnbahzpoufdebdfkfqkucrzz/Build/Intermediates/Horoscope.build/Debug-iphonesimulator/Horoscope.build/Objects-normal/i386/SBJsonBase.o
/Users/thanhpn/Documents/Horoscope/FacebookSDK/FacebookSDK.framework/FacebookSDK(FBSBJsonBase.o)
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

any help for me ???

Different characters counts in DE Tweet & TW Tweet

If you tap the DE Tweet button, then delete all of the pre-populated text, the character counter will show 77 characters.
If you tap the TW Tweet button, then delete all of the pre-populated text, the character counter will show 78 characters.

Possibly an extra space in the text that gets added to the DE Tweet?

Connection to Twitter Failed?

When trying to tweet a message I am getting a "connection to Twitter failed" error Message with the option of trying again.

I was able to send a tweet twice, and now I get this error.

consumer key and secret key are set.

What could be causing the connection failure?

DETweetPoster instances should pass themselves back in their callback methods

So, these:

  • (void)tweetSucceeded;
  • (void)tweetFailed;
  • (void)tweetFailedAuthentication;

should be:

  • (void)tweetSucceeded:(DETweetPoster *)tweetPoster;
  • (void)tweetFailed:(DETweetPoster *)tweetPoster;
  • (void)tweetFailedAuthentication:(DETweetPoster *)tweetPoster;

This way, users of this class will be able differentiate which DETweetPoster objects have finished, in case more than one of them are in use.

Background does not rotate while tweet sheet is open

In the main view, if you rotate your device to landscape, tap a button to Tweet, then turn the device back to portrait, you can see that the double encore logo in the background is still in landscape and the right side of the screen shows a lighter linen background.

Ideally we should be rotating the background as the orientation changes, even with a tweet open.

Consider making a category for checking for iOS5

DETweetComposeViewController implements a private method called -isIOS5 for detecting iOS5. This works, but a better pattern might be to add this method as a category somewhere, so that other classes are able to use it, too. I've added a similar method to UIDevice in other projects.

Twitter Auth problem

Hi there. When I use the demo project on Simulator 4.3 I get following error from twitter:
"There is no request token for this page. That's the special key we need from applications asking to use your Twitter account..."

The same happens on my device (iphone4 with iOS5.0.1) when I use the following code from demo project (just for tests):

self.oAuth = [[[OAuth alloc] initWithConsumerKey:kDEConsumerKey andConsumerSecret:kDEConsumerSecret] autorelease];
TwitterDialog *td = [[[TwitterDialog alloc] init] autorelease];
td.twitterOAuth = self.oAuth;
td.delegate = self;
td.logindelegate = self;
[td show];

Screenshot of the problem:
http://twitpic.com/7wb9j6/full

Console output:
[5844:11303] Got unknown key from provider response. Key: "<?xml version", value: ""1.0" encoding"
[5844:11303] api.twitter.com
[5844:11303] http://api.twitter.com/oauth/authorize?oauth_token=
[5844:11303] Twitter didn't login

PS: I entered kDEConsumerKey and kDEConsumerSecret

Any thought? Thanks guys for your work.

Remove hard-coded button indices in DETweetComposeViewController

DETweetComposeViewController implements two UIAlertView methods:

  • (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  • (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex

And, in these methods, there are two button index checks:

if (buttonIndex == 0) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://Twitter"]];
}

if (buttonIndex == 1) {
// The user wants to try again.
[self send];
}

It makes it easier to decipher what's going on if the indices are checked against either constant or enumerated values. Simply checking if 'buttonIndex' equals 0 or 1 isn't as obvious as checking for something like "OKButtonIndex", etc.

Question: Integrating DETweetComposeViewController in Adobe AIR iOS Native Extension

Hello,

I'm right now working on integrating both Twitter.framework and DETweetComposeViewController for an Adobe AIR Native Extension.

My Adobe Native Extension (ANE) compiles and work perfectly on iOS 5.

On iOS 4 I'm having a bit of setback. When I try to display the Tweet Sheet, I'm always getting a message from Twitter asking me to authorize my test app to post on my behalf. After giving it authorization, I get a greyed out screen.

Here are some screengrabs of my problem: http://imgur.com/a/70YBd#0

Here's the relevant code:

- (void) showOniOS4:(NSString*) initialText
{
    DETweetComposeViewController *tweetSheet = [[[DETweetComposeViewController alloc] init] autorelease];

    [tweetSheet setInitialText:initialText];

    UIWindow* keyWindow = [[UIApplication sharedApplication]keyWindow];
    UIViewController* mainController = [keyWindow rootViewController];
    mainController.modalPresentationStyle = UIModalPresentationCurrentContext;

    [mainController presentModalViewController:tweetSheet animated:YES];
}

- (void) showOniOS5:(NSString*) initialText
{
    if ( [TWTweetComposeViewController canSendTweet] )
    {
        TWTweetComposeViewController *tweetSheet = [[TWTweetComposeViewController alloc] init];

        UIWindow* keyWindow = [[UIApplication sharedApplication]keyWindow];
        UIViewController* mainController = [keyWindow rootViewController];

        [tweetSheet setInitialText:initialText];

        [mainController presentModalViewController:tweetSheet animated:YES];
        [tweetSheet release];
    }
    else
    {
        NSLog(@"No Twitter account on device.  Will not display Tweet Sheet.");
    }
}

// here is how these code blocks are called.

NSString *initialText = @"this is a test";
NSString *currentSysVer = [[UIDevice currentDevice] systemVersion];
if ([currentSysVer compare:@"5.0" options:NSNumericSearch] != NSOrderedAscending) {
    [AirTwitter sharedInstance] showOniOS5:initialText];
} else {
    [AirTwitter sharedInstance] showOniOS4:initialText];
}

Here are the logs from the device console in xcode's organizer

Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: Entering twitterExtInitializer()
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: Exiting twitterExtInitializer()
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: Entering ContextInitializer()
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: Exiting ContextInitializer()
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: Entering showTweetSheet()
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: Entering showTweetSheetForiOS4()
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: The view controller <CTStandaloneViewController: 0x109e530> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: The view controller <DETweetComposeViewController: 0x10babd0> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.
Sep 14 12:46:32 unknown TwitterTest[1680] <Warning>: The view controller <CTStandaloneViewController: 0x109e530> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.
> 
Sep 14 12:46:33 unknown TwitterTest[1680] <Warning>: Exiting showTweetSheetForiOS4()
Sep 14 12:46:33 unknown TwitterTest[1680] <Warning>: Exiting showTweetSheet()
Sep 14 12:46:34 unknown TwitterTest[1680] <Warning>: api.twitter.com
Sep 14 12:46:34 unknown TwitterTest[1680] <Warning>: http://api.twitter.com/oauth/authorize?oauth_token=<AN_OAUTH_TOKEN>
> 
Sep 14 12:46:51 unknown TwitterTest[1680] <Warning>: api.twitter.com
Sep 14 12:46:51 unknown TwitterTest[1680] <Warning>: https://api.twitter.com/oauth/authorize
> 
Sep 14 12:46:53 unknown TwitterTest[1680] <Warning>: google.co.uk
Sep 14 12:46:53 unknown TwitterTest[1680] <Warning>: http://google.co.uk/?oauth_token=A6mfDuuO4qVRTjqNiVittzpYHDT5jkl9wl4O3h43Fg&oauth_verifier=AeIb75OiOkGWFnAt8a5NjKB4eyp2yt8C4O1Z6lT7du8
Sep 14 12:46:53 unknown TwitterTest[1680] <Warning>: At Yatterbox
Sep 14 12:46:53 unknown TwitterTest[1680] <Warning>: Suceeded Now Getting Access Token

It looks like the Tweet sheet is attempting to get the access token but not succeeding. Also, the logs show google.com as a callback url, which I put there as a placeholder.

Is an actual callback url necessary for this to work correctly?

Thanks!

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.