userinfo

Swift NSTimer retrieving userInfo as CGPoint

☆樱花仙子☆ 提交于 2020-01-06 04:01:11
问题 override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { let touch = touches.anyObject() as UITouch let touchLocation = touch.locationInNode(self) timer = NSTimer.scheduledTimerWithTimeInterval(0.5, target: self, selector: "shoot", userInfo: touchLocation, repeats: true) // error 1 } func shoot() { var touchLocation: CGPoint = timer.userInfo // error 2 println("running") } I am trying to create a timer that runs periodicly that passes the touched point (CGPoint) as userInfo to

Google Oauth2 userinfo API not returning user's name data

守給你的承諾、 提交于 2020-01-04 01:51:05
问题 For the past couple months I have been using this url to retrieve a user's name and info after logging in with OAuth. https://www.googleapis.com/oauth2/v1/userinfo?alt=json This gave me JSON in the following format: { "id": "12345", "email": "name@gmail.com", "verified_email": true, "name": "First Last", "given_name": "First", "family_name": "Last", "link": "https://plus.google.com/12345", "picture": "https://lh3.googleusercontent.com/123photo.jpg", "locale": "en" } This morning, when my app

How to get user profile on Google API using the JAVA library?

怎甘沉沦 提交于 2020-01-02 04:25:06
问题 I have a Java ClientRequest to the Google API that returns a json containing the profile based in an access_token. The URL is: https://www.googleapis.com/oauth2/v1/userinfo?access_token=ya29.1.AADtN_VALuuUTBm8ENfNTz8s... And the response is: { "id": "111223344556677889900", "email": "myemail@gmail.com", "verified_email": true, "name": "My Name", "given_name": "My", "family_name": "Name", "link": "plus.google.com/111223344556677889900", "picture": "photo.jpg", "gender": "male", "locale": "en"

Sorting an NSArray by a key-value relationship that is 2 levels deep

偶尔善良 提交于 2019-12-31 05:33:07
问题 I have an NSArray of UILocalNotification objects that I need to sort according to a key within the UILocalNotification's userInfo property, which is an NSDictionary. I know how to sort NSArrays by a value that is one level deep, e.g., a key within an array of NSDictionaries, but two levels deep I'm lost. I want to do something like this is psuedo-code: NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"userInfo.personName" ascending:YES]; //the personName key within

extra argument userinfo in call

China☆狼群 提交于 2019-12-23 15:13:25
问题 Get the compile error message from xCode with Swift language: "extra argument userinfo in call". the question is how to use userInfo data from timer to argument "userInfo" in notification center. func onSetAudioWithTrackIndex(CurrentTrackIndex:Int, urlAudio: String){ ........ //try to pass currentTrackIndex data to timerfire playTimeClock = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: "onSetPlayProgressTime:", userInfo: CurrentTrackIndex, repeats: true) } //Timerfire

Is it a good idea to let your users change their usernames? [closed]

故事扮演 提交于 2019-12-20 09:49:11
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I'm back and forth on the idea of letting the users on my site change their usernames, which would be displayed through out the site. On one side I want to give the users flexibility. But on the other, I don't want them to use this feature as a way to hide if they do

Django: How can i get the logged user outside of view request?

北慕城南 提交于 2019-12-19 04:51:17
问题 I have a class method (outside of a view) who needs the logged user's information. How can i retrieve the logged in user without passing the request to the method? Unfortunately i can't find nowhere a nice solution and it's not logical just not exist such a way to do it, because Django should store somewhere the logged in user. Otherwise (i believe) it would be impossible to use @login_required decorator from django.contrib.auth.decorators . Right? So if it's not possible why it's not? Why

Get Userinfo from Oauth2 Google Contacts API

北战南征 提交于 2019-12-18 05:57:13
问题 Error which i am getting: com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized { "code" : 401, "errors" : [ { "domain" : "global", "location" : "Authorization", "locationType" : "header", "message" : "Invalid Credentials", "reason" : "authError" } ], "message" : "Invalid Credentials" } Below code, i am using: GoogleCredential credential = new GoogleCredential.Builder() .setTransport(this.TRANSPORT).setJsonFactory(this.JSON_FACTORY) .setClientSecrets(Constants

How to add userInfo to a UIAlertView?

随声附和 提交于 2019-12-17 08:59:39
问题 I would like to know how to add a userInfo object, or any NSDictionary, to a UIAlertView? Thank you. 回答1: If you are on > iOS 4.0 (for blocks) and you only want one or two buttons, you could use this category I made: https://github.com/rsaunders100/UIAlertView-Blocks It bypasses the need to add user info since you put your click handeling function straight into the alert. e.g. #import UIAlertView+Blocks.h ... ... NSString* myUserInfo = @"example"; [UIAlertView displayAlertWithTitle:@"Example

Get user info via Google API

我怕爱的太早我们不能终老 提交于 2019-12-17 02:26:33
问题 Is it possible to get information from user's profile via Google API? If it is possible, which API should I use? I'm interesting in such information: Url to the user profile (e.g. https://profiles.google.com/115063121183536852887); Gender (sex); Profile photo. Also it would be cool to get other information from user's profile. 回答1: Add this to the scope - https://www.googleapis.com/auth/userinfo.profile And after authorization is done, get the information from - https://www.googleapis.com