Not able to fetch twitter user email id using react-native-twitter-signin - react-native

Trying to build twitter login using "react-native-twitter-signin": "^1.1.1" few days before it is working fine but now in android version it only return error Error: { NativeMap: {"email":"COULD_NOT_FETCH",... and in IOS email is null. below is my code snippet
_twitterSignIn = () => { RNTwitterSignIn.init(Constants.TWITTER_COMSUMER_KEY, Constants.TWITTER_CONSUMER_SECRET) RNTwitterSignIn.logIn() .then(loginData => { console.log(loginData)
if (loginData.authToken && loginData.authTokenSecret) {
var user = {}
user.social_type = 'twitter'
user.social_id = loginData.userID
user.email = loginData.email
user.name = loginData.name + " " + loginData.name
/// this._social_login(user)// after getting data perform action
}
}).catch(error => {
console.log(error)})}
Please help
so did anyone get any solution ?can anyone figure it out that it is library problem or twitter developer cosole settings problem? Though somany time I cross checked the developer console which is perfectly configured describe in doc. means for Email id fetching 'Request email from users' is on and also privacy & terms service urls are present. So any solution is highly appriciated. thank you

Related

How to get all users by project on Youtrack rest api?

I can't get users by project or by filter on YouTrack REST API;
I wrote the following code:
var login = "mylogin";
var password = "mypassword";
(async function getAllUserByProject(login, password, project) {
var url = ``https://mycompany.myjetbrains.com/hub/api/rest/users?`;
return new Promise((done, fail)=> {
request.get({
url, auth: {user: login, pass: password, sendImmediately: true}
}, (error, body, result)=> {
if (error || !result) {
return fail({
error: JSON.parse(error), result: result ? JSON.parse(result) : null
})
}
console.log(result)
done(JSON.parse(result));
})
})
}
)(login, password, project);
Old question but:
users by project
Use /rest/admin/user?project=<PROJECT_ID>. I tested this on v2017.3 and it works.
Reference: https://www.jetbrains.com/help/youtrack/standalone/GET-Users.html
by filter
As seen in the documentation, the resource url takes the form of /rest/admin/user?{q}&{group}&{role}&{project}&{permission}&{onlineOnly}&{start} where:
q can be part of user login, name, or email
group is the user's groupID
role is the users's role
project see above
permission is one of the user's permissions
onlineOnly get only users which are currently online
start for pagination (page size fixed at 10)
As of YouTrack 2018.3, the old REST API is becoming deprecated in favor of one that allows much more elaborate queries.
With the new API, you can use /hub/api/rest/projectteams/?$top=-1&fields=id to get the full list of ids of all project teams, and, for each of those, /hub/api/rest/projectteams/{project id}/users to get the list of users in a given project team.

Google Apps Marketplace CustomerLicense Authorization Steps ?

We have recently create the google marketplace app and published as public .admin of the google apps domain users can able to install it .
i recently try to implement the CustomerLicense,LicenseNotification Apis in for my app
But i dont know how to send a Authorization for it Please suggest me to how to do this
My requirement :
1.I need to know whether the given domain has installed my marketplace app or not (My input is authorization,email id or domain name
2.If any user uninstall or revoke the data access for my marketplace app i need to get the notify (optional)
Here is sample code :
$appId = '';**//Where i get this**
$userid = '';**//It is emailid or domain name or user unique numeric id**/
$oauthOptions = array(
'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER,
'signatureMethod' => 'HMAC-SHA1',
'consumerKey' => '', **//Where i get this**
'consumerSecret' => "" **//Where i get this**
);
//We get from APP URL
try {
$userid = 'backup-testing.in';
$token = new Zend_Oauth_Token_Access();
$client = $token->getHttpClient($oauthOptions);
$url = "https://www.googleapis.com/appsmarket/v2/customerLicense/$appId/$userid";
$client->setMethod(Zend_Http_Client::GET);
$gdata_put = new Zend_Gdata($client);
$resultR = $gdata_put->get($url);
} catch (Exception $e) {
var_dump($e);
}
This is my marketplace app
in chrome westore : https://chrome.google.com/webstore/detail/gapps-backup/jmjnfmekbahcminibjmedfehecoihglj
Here you can find information about the Licensing API https://developers.google.com/google-apps/marketplace/v2/developers_guide which i think will be useful for what you want to do. hope it helps.

Getting user data is inconsistent on the php and javascript sdk

I've been developing a facebook application that uses a combination of the php sdk and the javascript sdk. It runs in a tabbed iframe on facebook and is hosted on my own server. I'm using the latest php and javascript sdk files as of now (Sept 06, 2011, 2:50PM). The first inconsistency is in the php sdk when getting the user id. This is my code:
require 'fb_php_sdk/facebook.php';
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$user = $facebook->getUser();
if ($user) {
$permissions_granted = true;
} else {
$permissions_granted = false;
}
This very frequently returns '0' as the facebook ID, no idea why. Though almost as frequently returns the actual facebook id.
The other issue is with images. I often get images not showing up when calling this url:
<img src="https://graph.facebook.com/' . $uid. '/picture/" />
When I use fql I inconsistently get 'undefined' as a result when performing this query:
FB.api(
{
method: 'fql.query',
query: 'SELECT name,pic FROM user WHERE uid=<? echo $user ?>'
},
function(response)
{
alert(response[0].pic);
}
);
I really don't understand what would cause this inconsistency and it's making bug testing very difficult. If anyone has experienced this kind of behaviour and can point me in the right direction I'd really appreciate it. Thanks!
This very frequently returns '0' as the facebook ID, no idea why. Though almost as frequently returns the actual facebook id.
Of course, because your app needs at least the default permissions. Otherwise you'll get nothing about the user. And same with your images. I bet most time your $uid contains the number zero.
Did you check what facebook returns? It should be something like:
{
"error": {
"type": "OAuthException",
"message": "An active access token must be used to query information about the current user."
}
}
So you need to get permissions of the user to get access to his/her data.
Kind regards,
Jurik

gmail contextual gadget makeRequest call responds with Internal Server Error

I am building a google contextual gadget in it i use the following code to load a page:
var params = {};
url = "http://example.com:2057/tasks/create";
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
params["OAUTH_SERVICE_NAME"] = "HMAC";
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
gadgets.io.makeRequest(url, function(response)
{
if (response.data && response.data.RedirectUrl)
HandleLogin(response.data.RedirectUrl);
else if(response.text)
{
showOneSection('main');
$('#main').append(response.text);
}
else
ShowDebug(response);
}, params);
The call does not reach my server. and when i try reaching the url in a browser it returns fast.
what can be the problem? how can i trouble shoot it?
Thanks
I finally found the problem.
when making a signed request you have to first obtain a consumer key + secret key.
see http://www.google.com/support/forum/p/apps-apis/thread?tid=31db71169fb6fc77&hl=en
you can do that here: https://www.google.com/gadgets/directory/verify
without the keys google is unable to sign the request (although one would expect a proper error message).

Facebook FB.api post how to specify a target

I am using FB.api OpenGraph to post a message on the user's wall. I would like the link target to be equal to '_blank' so it opens in a new tab. Is it possible ? The Facebook documentation doesn't give much details.
var params = {};
params['message'] = 'message';
params['name'] = 'name';
params['link'] = 'http://link';
params['picture'] = 'http://picture';
params['description'] = 'description';
FB.api('/me/feed', 'post', params, function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Post ID: ' + response);
}
});
that's something they manage themselves. there's nothing you can do. Still, AFAIK, that's the default behavior.
I think it has something to do with your Apps Url in the app settings.
Im witnessing that , when the apps url was app.com
all links i shared on my users feed with the link app.com/results.php would open on the same tab and links i shared with the link www.app.com/results.php would open in a new link.
The problem there , was , that from www.app.com , i couldnot authorize api access for some reason.
I'll try to register both urls , and see what happens.