Tag: sdk

检索函数数据

我有一个函数,我真的想要检索的数据。 在括号内,我能打印出DecodedData值。 但是,如果我将print(DecodedData)放在函数的外面,Xcode告诉我“预期的声明”,我将如何能够在整个文件中访问DecodedData ? 我已经尝试使用委托方法没有成功,有没有其他的方式? 如果是的话,我该怎么做呢? var DecodedData = "" //Reading Bluetooth Data func peripheral(peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error: NSError?) { if let data = characteristic.value { DecodedData = String(data: data, encoding: NSUTF8StringEncoding)! } print(DecodedData) } 我怎样才能让variablesDecodedData在不同的Swift文件中可用?

在“等待审阅”状态中添加iPhone应用程序的屏幕截图

如果我在“等待审核”状态中添加应用的屏幕截图,是否需要更长时间才能获得批准? 我的意思是,做任何改变,使队列一直到后面,如果该应用程序在当天提交? 感谢名单

thumbnailLink不会使用iOS Google Drive API返回任何文件

理想情况下,我想显示存储在用户Google云端硬盘上的图片的缩略图。 我使用的代码是: GTLQueryDrive *query = [GTLQueryDrive queryForFilesList]; query.pageSize = 50; query.fields = @"nextPageToken, files(id, name, thumbnailLink, imageMediaMetadata)"; query.q = @"(mimeType='image/jpeg' or mimeType='image/png')"; [self.service executeQuery:query delegate:self didFinishSelector:@selector(displayResultWithTicket:finishedWithObject:error:)]; 不幸的是,即使我删除mimetype条件(列出所有文件),没有返回的GTLDrivelogging包含thumbnailLink。 有什么我错过了吗?

无法通过谷歌驱动器API上传/下载文件

我试图从我的应用程序上传图片到谷歌驱动器,但其显示错误 错误域= com.google.HTTPStatus代码= 501 “(空)” 的UserInfo = {数据= <7b226572 726f7222 3a7b2263 6f646522 3a343033 2c226d65 73736167 65223a22 496e7375 66666963 69656e74 20506572 6d697373 696f6e22 2c226461 7461223a 5b7b2264 6f6d6169 6e223a22 676c6f62 616c222c 22726561 736f6e22 3a22696e 73756666 69636965 6e745065 726d6973 73696f6e 73222c22 6d657373 61676522 3a22496e 73756666 69636965 6e742050 65726d69 7373696f 6e227d5d 7d2c2269 64223a22 67746c5f 35227d>} 我的代码是 NSData *data = […]

Googleredirect,Google Drive,iOS SDK太多

我已将我的iOS应用程序与Google Drive iOS API集成在一起。 但是在下载文件时,会抛出以下错误: An error occurred: Error Domain=NSURLErrorDomain Code=-1007 "too many HTTP redirects" 有没有解决scheme?

NSDate dateWithTimeIntervalSince1970不返回GMT / UTC时间

我尝试了一个实验,因为我需要能够在我正在工作的应用程序中生成一个unix时间戳(自1970年以来)。 NSLog(@"Getting timeIntervalSince1970"); double theLoggedInTokenTimestampDateEpochSeconds = [[NSDate date] timeIntervalSince1970]; 这应该已经在格林尼治标准时间(1970年1月1日以来的秒)内返回了纪元秒(自1970年以来)。 但是,在2011年8月15日星期一09:54:30进行实验时,返回1313427270.504315 在Mac OSterminal上用一个简单的perl单行testing,得到: perl -e 'print scalar(localtime(1313427270))' ,它返回星期一8月15日09:54:30 2011 … 这显然不是格林威治时间,当我在SF湾区,当地时区设置为“库比蒂诺”。 怎么回事,请问我该如何解决? 我需要让我的应用程序在通信时向服务器发送UTC时间,所以无论用户在什么时间时间戳都会在一个相同的有效时区内发送。 在我的应用程序的另一部分,当用户从服务器请求数据,它获取它以UTC发送 ​​- 将其转换为显示如下: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setLocale:[NSLocale currentLocale]]; [dateFormatter setTimeZone:nil]; [dateFormatter setDateFormat:@"yyyyMMdd"]; NSDate *conversationDate = [NSDate dateWithTimeIntervalSince1970:[theConversationTimeStampString intValue]]; NSString *conversationDateString = [dateFormatter stringFromDate:conversationDate]; [dateFormatter release]; 而且这个工程很漂亮 – 在用户的时区和区域显示更正的时间…所以我知道正在完成传入的时间戳。 […]

当按下音量button时检测

我已经做了大量的研究,我知道苹果公司不会允许这样做,但是有没有人有代码,或者有人可以指点我的代码,使我能够检测当用户按下iphone上的向上或向下音量button? 我需要能够检测哪一个被按下(向上或向下)。 我不会提交任何有此代码的苹果。 我只是想知道如果可能? 提前致谢。

PayPal iOS SDK响应送货地址:(null)

信息 模式(模拟/沙盒/现场):沙盒 PayPal iOS SDK版本:2.14.3 iOS版本和设备(iOS 8.x,iPhone 6s上的iOS 9.3等):模拟器iPhone 5 iOS 9.3 描述 _payPalConfig = [[PayPalConfiguration alloc] init]; _payPalConfig.payPalShippingAddressOption = PayPalShippingAddressOptionPayPal; 在PayPal控制器中,我select运送地址(PayPal账户地址)。 但作为回应,我收到货运地址:(空)。 CurrencyCode: EUR Amount: 416.99 Short Description: Clothes Intent: sale Processable: Already processed Display: €416.99 Confirmation: { client = { environment = sandbox; "paypal_sdk_version" = "2.14.3"; platform = iOS; "product_name" = "PayPal iOS […]

IOS Facebook SDKlogin对话框显示两次(2login对话框)

我的问题与此非常相似: Facebook SDKlogin对话框出现两次 “login对话框出现两次,我该如何解决这个问题?” 除此之外,我正在使用这个单例与Facebook sdk进行通信: http://matt-swain.com/post/21160566904/facebook-ios-sdk-singleton (即我使用的代码) http:// barrycenter。 com / BAM!编码/ 2011/07 / simpifying-facebook-ios-sdk / (包含解释的旧版本) 我的代码和原来的单例之间唯一的区别是我有一个方法: -(void) postToWallWithDialog:(int)count2 { NSMutableDictionary* params = [self buildPostParams:count2]; [self dialog:@"feed" andParams:params andDelegate:self]; //post } //buildPostParams just makes a dictionary, nothing else. 我不想从fbDidLogin中调用我的方法,因为它需要从视图控制器调用。 我如何消除第二个login对话框? 谢谢!

Google Plus iOS SDK不刷新过期标记

我有一个问题,可能有一个这么简单的解决scheme,我无法看到它。 我将Google Plus iOS SDK安装到了我的应用程序中,并使我的应用程序与Google运行得非常好。 Google Plus iOS SDK 但是,一小时之后,令牌即将到期,我不能find更新它的方法。 – (void)renewGoogleToken { GPPSignIn *gppSignIn = [GPPSignIn sharedInstance]; gppSignIn.shouldFetchGooglePlusUser = YES; gppSignIn.shouldFetchGoogleUserEmail = YES; gppSignIn.clientID = [DSUtils getGoogleClientID]; gppSignIn.scopes = @[@"https://www.googleapis.com/auth/plus.login", @"https://www.googleapis.com/auth/calendar"]; gppSignIn.delegate = self; BOOL success = [gppSignIn trySilentAuthentication]; } 当我想用Google+login时,我最初调用这个方法。 一个小时后,当令牌即将过期时,我再次调用这个方法,但是我收到了即将到期的相同令牌。 有人可以帮我吗? 我在谷歌search激烈,并找不到解决scheme。 SDK文档没有提及更新,这很奇怪。 令牌是否自动刷新? 请帮忙,谢谢。