Tag: twitter

如何使用XCode在iOS应用中的推文上传video

我是iOS开发新手,需要对我接pipe的iOS应用程序进行更改,以将video添加到推文中。 我目前的应用UI允许用户input推文的文字,但我会改变,让他们select一个video上传,类似于推特应用的工作方式。 我看到Twitter API支持上传video,但是我还没有find任何关于如何使用XCode和Objective-C来完成这个任务的好例子。 任何推荐的方法或工具包,我可以利用这一点呢? https://dev.twitter.com/rest/public/uploading-media

自定义iOS Twitterauthentication页面?

我正在制作一个移动应用程序,用户可以将他们的Twitter帐户连接到应用程序。 我只是有点好奇,最好的办法是什么。 现在,我很乐意能够制作自己的自定义页面(而不必使用UIWebView)。 这可能吗? 如果怎么样? 谢谢。

Swift 3:如何反转一个透明的导航栏?

我试图创build一个叽叽喳喳的应用程序,模拟真正的应用程序,使用twitter API。 在时间轴视图中,我有一个常规导航栏,当用户点击用户configuration文件时,configuration文件视图具有一个透明栏,以便显示用户的标题图像。 我用下面的代码在导航栏在用户configuration文件视图中是透明的: self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationController?.navigationBar.shadowImage = UIImage() self.navigationController?.navigationBar.isTranslucent = true 我遇到的问题是当我从configuration文件视图返回,时间轴导航栏已成为混乱(下面的截图)。 我猜这是因为我改变了视图控制器中的导航栏的一些方面的configuration文件视图,当我回到时间轴视图结转。 我怎样才能扭转导航栏的透明度,以解决这个不稳定的导航栏? 在时间轴视图控制器中我尝试使用下面的代码来尝试将其反转,但它不起作用。 self.navigationController?.navigationBar.setBackgroundImage(nil, for: .default) self.navigationController?.navigationBar.shadowImage = nil self.navigationController?.navigationBar.isTranslucent = false 带有定期导航栏的时间轴视图 configuration文件视图与透明的导航栏 从configuration文件视图返回后,用随机的导航栏的时间轴视图

在iOS上如何显示UIAlertView?

从块中显示UIAlertView的最好方法是什么? 我在我的代码中有以下操作: – (IBAction)connectWithTwitterClicked:(id)sender { ACAccountStore * account = [[ACAccountStore alloc]init]; ACAccountType * accountType = [account accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; [account requestAccessToAccountsWithType:accountType options:nil completion:^(BOOL granted, NSError *error) { if (granted == YES){ NSLog(@"Twitter account has been granted"); NSArray * arrayOfAccounts = [account accountsWithAccountType:accountType]; if([arrayOfAccounts count] > 0){ ACAccount * twitterAccount = [arrayOfAccounts lastObject]; NSLog(@"Found twitter Id of [%@]", […]

iOS使用embedded式tweet计算htmlstring的正确WKWebview高度

我正在使用wkwebview使用loadHTMLString方法加载给定的HTMLstring。 wkwebview didFinishNavigation后,我正在通过评估JavaScript“document.height”更新内容高度的wkwebview的高度。 这是纯HTMLstring的工作。 但对于embedded式tweet高度计算的htmlstring出错。 这里是鸣叫内容 </p> <blockquote class="twitter-tweet"> <p lang="fr" dir="ltr">Union Cabinet approves civil aviation policy.</p>&mdash; Press Trust of India (@PTI_News) <a href="https://twitter.com/PTI_News/status/742990663495647232">June 15, 2016</a></blockquote> <p> <script>window.twttr = (function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0],t = window.twttr || {};if (d.getElementById(id)) return t;js = d.createElement(s);js.id = id; js.src = "https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js, fjs);t._e = []; t.ready […]

以编程方式在Twitter上发布video

任何人都可以告诉我如何我可以在Twitter使用Twitterkit或任何其他方法编程(swift或objective-c)发布video。 我看过很多与此相关的post,但没有find任何解决办法。 我不想用织物Api。 我正在使用下面的代码上传图像在twitter上,它完美的作品,我可以使用这个代码上传video后修改,如果有任何人有想法我可以做这个再见使用这段代码。 谢谢 func post(tweetString: String, tweetImage: Data ,withUserID :String) { let uploadUrl = "https://upload.twitter.com/1.1/media/upload.json" let updateUrl = "https://api.twitter.com/1.1/statuses/update.json" let imageString = tweetImage.base64EncodedString(options: NSData.Base64EncodingOptions()) let client = TWTRAPIClient.init(userID: withUserID) let requestUploadUrl = client.urlRequest(withMethod: "POST", url: uploadUrl, parameters: ["media": imageString], error: nil) client.sendTwitterRequest(requestUploadUrl) { (urlResponse, data, connectionError) -> Void in if connectionError == nil […]

Twitter应用程序专用authentication总是返回401

我试图使用应用程序唯一身份validation,我成功获取不记名的令牌,但是当我试图打电话给REST API时,我总是得到一个401错误,这是我的代码: private var accessToken: String? private let consumerKey = "*********" private let consumerSecret = "*********" private let baseUrlString = "https://api.twitter.com/1.1/" private let pageSize = 20 private func authenticate(completionBlock: Void -> ()) { if accessToken != nil { completionBlock() } let credentials = "\(consumerKey):\(consumerSecret)" let headers = ["Authorization": "Basic \(credentials.getBase64())"] let params: [String : AnyObject] […]

Twitterlogin没有社交框架

我正在尝试在我的iOS应用程序中实现twitterlogin。 我不想使用社交框架工作。 我已经尝试了所有的方式来twitterlogin,但不幸的是这不工作。 主要是我面临的callbackurl问题。 你能帮我吗? 我也试过这个url http://codegerms.com/login-with-twitter-example-with-ios-tutorial-using-oauth/ 但主要是我面临的callback问题。 任何人都可以请build议其他插件。

TwitterKit偶尔为现有用户返回零会话

当用户打开我的应用程序时,loginstream程如下所示: 用Twitter.sharedInstance().start(withConsumerKey: consumerKey, consumerSecret: consumerSecret) 。 用Fabric.with([Crashlytics.self, Twitter.self])开始Fabric.with([Crashlytics.self, Twitter.self]) 。 使用Twitter.sharedInstance().sessionStore.session()检查现有会话。 如果没有现有会话,请允许他们使用Twitter.sharedInstance().logIn(withMethods: TWTRLoginMethod.webBasedForceLogin)login。 我经常看到一个间歇性的问题,一个用户在先前login之后会打开这个应用程序,并且不会有一个现有的会话 – 它将返回零,所以他们被要求再次login。 但是,如果他们退出应用程序或取消新的login,然后再次启动应用程序,现有的会话按预期返回。

SLCOmviewviewcontroller微博分享警报问题

我一直在使用这个代码的Twitter发布。 SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) { SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){ [fbController dismissViewControllerAnimated:YES completion:nil]; switch(result){ case SLComposeViewControllerResultCancelled: default: { NSLog(@"Cancelled….."); } break; case SLComposeViewControllerResultDone: { NSLog(@"Posted…."); UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Posted Successfully" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } break; }}; [fbController addImage:[UIImage imageNamed:@"1.jpg"]]; [fbController setInitialText:@"Check out this article."]; //[fbController addURL:[NSURL URLWithString:@"http://soulwithmobiletechnology.blogspot.com/"]]; [fbController setCompletionHandler:completionHandler]; […]