doubleencore / detweetcomposeviewcontroller Goto Github PK
View Code? Open in Web Editor NEWThe iOS 4 compatible Tweet Sheet.
License: BSD 3-Clause "New" or "Revised" License
The iOS 4 compatible Tweet Sheet.
License: BSD 3-Clause "New" or "Revised" License
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.
After ten lines of text the guidelines disappear.
The grey lines in the TextView should span the width of the Tweet view as in iOS 5.
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:
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.
Compare against height of rows for iOS 5 Tweet sheet.
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!
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]
Maybe tweak the alpha on the text drop shadow?
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.
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.
This will allow it to work correctly even if it's instantiated from a .xib file. Since only -initWithFrame: is implemented, instances follow a different initialization path if they are instantiated from a .xib.
It worked in 5.0 but not in 5.1
http://stackoverflow.com/questions/10055853/opening-ios-settings-preferences
As in iOS 5, should be able to see the existing view behind the Tweet view.
Please check even the demo app crashes on iOS 4 Simulator due access to Accounts Framework which is available in iOS 5+. App crashes on the following function [DETweetPoster accounts].
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.
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.
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 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.
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.
configuration.json defines the max size of a photo that can be posted
http://api.twitter.com/1/help/configuration.json
currently this is
photo_size_limit: 3145728 (3 megabytes)
If running on iOS 5, use the UIKeyboardTypeTwitter. Otherwise, consider using UIKeyboardTypeEmailAddress.
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.
I'm opening the compose view on a modal, and then as soon as the tweet sheet appears, it dismisses itself?
In a DE Tweet, you can see that the bottom line on the paper does not extend to the end of the paper, but stops about 30px short. In the TW Tweet, you can see that the lines actually extend all the way to the edge of the paper.
This feed should be loaded a max once per day and we can only attach as many photos as are in max_media_per_upload
See iOS 5 Tweet sheet.
iOS 5 Tweet sheet allows you to select from multiple Twitter accounts if you have them setup in Twitter settings.
Is there any possibility to hook up an event when user completed tweeting?
The unofficial-twitter-sdk/OAuth package currently uses ASIHTTPRequest. Switch to something like NSURLConnection.
Not sure this is something we can imitate but when the iOS 5 Tweet dismisses the Tweet view dismisses up and the keyboard down.
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!
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 ???
DE image background shows 3 images stacked. iOS 5 background is a single image.
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?
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?
Need to update assets to support retina iPads.
Currently they only go till the clips.
So, these:
should be:
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.
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.
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.
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.
Seems like the backgroundView (the underlying view) is rotated when I try to show the ComposeView on top. It rotates back when I cancel or commit my tweet
DETweetComposeViewController implements two UIAlertView methods:
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.
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!
Personally, I prefer the DE highlighted button state but it doesn't currently match the iOS 5 styling.
Looks like a 3px 0.5 alpha (maybe slightly less opaque) black shadow left and right.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.