Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call verify_credentials api to get email if user has given permission, we only have function showUsers which does not give email #18

Open
vivek0460 opened this issue May 22, 2018 · 4 comments

Comments

@vivek0460
Copy link

No description provided.

@fossman83
Copy link

Did you figure this out?

@wichanan
Copy link

wichanan commented Oct 13, 2018

Take a look at the code here
https://github.com/chroa/twitter-connect-plugin/blob/master/src/ios/TwitterConnect.m
https://github.com/chroa/twitter-connect-plugin/blob/master/src/android/TwitterConnect.java

You will see, there is a function called verifyCredentials which will get the user profile with email from Twitter api.

And if you look closely enough you will see it here
https://github.com/chroa/twitter-connect-plugin/blob/master/www/TwitterConnect.js

That means you can already access it like this
TwitterConnect.verifyCredentials

It is there but it's just not included in the readme file of the repo

@chiemekailo
Copy link

chiemekailo commented Nov 23, 2018

Hello @wichanan,
I have seen the files you listed above with the embedded functions.
My problem is that it is only login(), logout(), and showUser() that are working. All the rest give errors. For example TwitterConnect.openComposer throws

Property 'openComposer' does not exist on type 'TwitterConnect'.

Even my VS code editor highlights this same error. (it underlines the openComposer in red, and on hover it prints the above error to tool tip).
Is there something I am doing wrong? the login/logout/showUser all work fine.
NB: I have also noticed that only the 3 functions (login(), logout(), and showUser()) are listed in ionicframework's Twitter Connect. Could it be suppressing the other function calls somehow?crazy idea here

@wichanan
Copy link

@chiemekailo Maybe my answer was too vague.
If you are using ionic framework you can easily access those available functions by editing the

project_dir/node_modules/@ionic-native/twitter-connect/ngx/index.js

//original ionic prototype
TwitterConnect.prototype.showUser = function () { return cordova(this, "showUser", {}, arguments); };
// your custom ionic prototype
TwitterConnect.prototype.verifyCredentials = function () { return cordova(this, "verifyCredentials", {}, arguments); };

and then on the
project_dir/node_modules/@ionic-native/twitter-connect/ngx/index.d.ts

export declare class TwitterConnect extends IonicNativePlugin {
    .....

    verifyCredentials(): Promise<any>;
}

and then you should be able to access any available function other than login(), logout(), and showUser().

List of available functions:
https://github.com/chroa/twitter-connect-plugin/blob/master/src/ios/TwitterConnect.m
https://github.com/chroa/twitter-connect-plugin/blob/master/src/android/TwitterConnect.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants