Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 2a13d78

Browse files
committed
chore(README)
1 parent ca76f8c commit 2a13d78

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ twitter
2727
twitter.logout();
2828
```
2929

30-
## iOS Setup
30+
## iOS setup
3131

3232
- `ionic start my-cap-app --capacitor`
3333
- `cd my-cap-app`
@@ -58,7 +58,7 @@ Then you should be set to go. Run `ionic cap run ios --livereload` to start the
5858

5959
> Important Notice: every time you change a native code you may need to clean the cache (Product > Clean build folder) and then run the app again.
6060
61-
## Android Setup
61+
## Android setup
6262

6363
- `ionic start my-cap-app --capacitor`
6464
- `cd my-cap-app`
@@ -97,10 +97,6 @@ Follow me [@Twitter](https://twitter.com/StewanSilva)
9797

9898
Cheers 🍻
9999

100-
## Related projects
101-
102-
- [Capacitor oAuth2](https://github.com/moberwasserlechner/capacitor-oauth2)
103-
104100
## License
105101

106102
MIT

android/capacitor-twitter/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ repositories {
4242

4343
dependencies {
4444
implementation fileTree(dir: 'libs', include: ['*.jar'])
45-
implementation 'ionic-team:capacitor-android:1+'
45+
implementation project(':capacitor-android')
4646
testImplementation 'junit:junit:4.12'
4747
androidTestImplementation 'com.android.support.test:runner:1.0.1'
4848
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

android/capacitor-twitter/src/main/java/cap/twitter/plugin/TwitterPlugin.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package cap.twitter.plugin;
2+
23
import android.content.Intent;
34
import android.util.Log;
5+
46
import com.getcapacitor.Config;
57
import com.getcapacitor.JSObject;
68
import com.getcapacitor.Plugin;
@@ -20,7 +22,7 @@
2022
import com.twitter.sdk.android.core.TwitterSession;
2123
import com.twitter.sdk.android.core.identity.TwitterAuthClient;
2224

23-
@NativePlugin(requestCodes = {140})
25+
@NativePlugin(requestCodes = {TwitterAuthConfig.DEFAULT_AUTH_REQUEST_CODE})
2426
public class TwitterPlugin extends Plugin {
2527
public static final String CONFIG_KEY_PREFIX = "plugins.TwitterPlugin.";
2628

@@ -38,6 +40,7 @@ public void load() {
3840
.twitterAuthConfig(new TwitterAuthConfig(consumerKey, consumerSecret))
3941
.debug(true)
4042
.build();
43+
4144
Twitter.initialize(config);
4245

4346

@@ -63,6 +66,7 @@ public void success(Result<TwitterSession> result) {
6366
ret.put("userID", result.data.getUserId());
6467
call.success(ret);
6568
}
69+
6670
@Override
6771
public void failure(TwitterException exception) {
6872
Log.d("DEBUG", "OH NO!! THERE WAS AN ERROR");
@@ -89,11 +93,11 @@ public void isLogged(PluginCall call) {
8993

9094
String token = authToken.token;
9195
String secret = authToken.secret;
92-
96+
9397
ret.put("in", true);
9498
ret.put("authToken", token);
9599
ret.put("authTokenSecret", secret);
96-
}else{
100+
} else {
97101
ret.put("in", false);
98102
}
99103

@@ -103,7 +107,7 @@ public void isLogged(PluginCall call) {
103107
@Override
104108
protected void handleOnActivityResult(int requestCode, int resultCode, Intent data) {
105109
if (requestCode == 140) {
106-
authClient.onActivityResult(requestCode, resultCode, data);
110+
authClient.onActivityResult(requestCode, resultCode, data);
107111
} else {
108112
super.handleOnActivityResult(requestCode, resultCode, data);
109113
}

0 commit comments

Comments
 (0)