facebook

Format Date as “yyyy-MM-dd'T'HH:mm:ss.SSS'Z'”

若如初见. 提交于 2020-08-21 05:04:49
问题 I need to format a date as yyyy-MM-dd'T'HH:mm:ss.SSS'Z' as specified by Parse's REST API for Facebook. I was wondering what the most lightweight solution to this would be. 回答1: Call the toISOString() method: var dt = new Date("30 July 2010 15:05 UTC"); document.write(dt.toISOString()); // Output: // 2010-07-30T15:05:00.000Z 回答2: toISOString() will return current UTC time only not the current local time. If you want to get the current local time in yyyy-MM-ddTHH:mm:ss.SSSZ format then you

Facebook Graph API not returning email

最后都变了- 提交于 2020-08-18 06:25:12
问题 I have the following code: $fb = new Facebook([ 'app_id' => $appId, 'app_secret' => $appSecret, 'default_graph_version' => 'v2.9', ]); $oAuth2Client = $fb->getOAuth2Client(); $tokenMetaData = $oAuth2Client->debugToken($accessToken); dump($tokenMetaData); $graphUser = $fb->get('/me?fields=first_name,last_name,email', $accessToken)->getGraphUser()->asArray(); dump($graphUser); The output for the above is the following: $metaData : [ "app_id" => "..." "application" => "My App Name" "expires_at"

Facebook Graph API not returning email

北城以北 提交于 2020-08-18 06:25:06
问题 I have the following code: $fb = new Facebook([ 'app_id' => $appId, 'app_secret' => $appSecret, 'default_graph_version' => 'v2.9', ]); $oAuth2Client = $fb->getOAuth2Client(); $tokenMetaData = $oAuth2Client->debugToken($accessToken); dump($tokenMetaData); $graphUser = $fb->get('/me?fields=first_name,last_name,email', $accessToken)->getGraphUser()->asArray(); dump($graphUser); The output for the above is the following: $metaData : [ "app_id" => "..." "application" => "My App Name" "expires_at"