Skip to content

Commit 88570eb

Browse files
authored
Add facebook and twitter modules (#1002)
1 parent e9d986f commit 88570eb

31 files changed

+3205
-62
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ These are other official libraries we made that can help you create your Parse a
8585
- [Parse Coroutines](/coroutines) - Kotlin Coroutines support for various Parse async operations
8686
- [ParseLiveQuery](https://github.com/parse-community/ParseLiveQuery-Android) - Realtime query subscription.
8787
- [ParseGoogleUtils](/google) - Google login/signup.
88-
- [ParseFacebookUtils](https://github.com/parse-community/ParseFacebookUtils-Android) - Facebook login/signup.
89-
- [ParseTwitterUtils](https://github.com/parse-community/ParseTwitterUtils-Android) - Twitter login/signup.
88+
- [ParseFacebookUtils](/facebook) - Facebook login/signup.
89+
- [ParseTwitterUtils](/twitter) - Twitter login/signup.
9090
- [ParseUI](https://github.com/parse-community/ParseUI-Android) - Prebuilt UI elements.
9191

9292
## License

coroutines/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Parse SDK Android Coroutines
22
Kotlin coroutines support for Parse Android
33

4-
## Setup
4+
## Dependency
55

6-
### Installation
76
After including JitPack:
8-
9-
```groovy
7+
```gradle
108
dependencies {
119
implementation "com.github.parse-community.Parse-SDK-Android:coroutines:latest.version.here"
1210
}

coroutines/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ android {
99
targetSdkVersion rootProject.ext.targetSdkVersion
1010
versionCode 1
1111
versionName "1.0"
12-
13-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1412
}
1513

1614
packagingOptions {

facebook/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Parse Facebook Utils for Android
2+
A utility library to authenticate `ParseUser`s with the Facebook SDK. For more information, see our [guide][guide].
3+
4+
## Dependency
5+
6+
After including JitPack:
7+
```gradle
8+
dependencies {
9+
implementation "com.github.parse-community.Parse-SDK-Android:facebook:latest.version.here"
10+
}
11+
```
12+
13+
## Usage
14+
Extensive docs can be found in the [guide](https://docs.parseplatform.org/android/guide/#facebook-users). The basic steps are:
15+
```java
16+
// in Application.onCreate(); or somewhere similar
17+
ParseFacebookUtils.initialize(context);
18+
```
19+
Within the activity where your user is going to log in with Facebook, include the following:
20+
```java
21+
@Override
22+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
23+
super.onActivityResult(requestCode, resultCode, data);
24+
ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
25+
}
26+
```
27+
Then elsewhere, when your user taps the login button:
28+
```java
29+
ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
30+
@Override
31+
public void done(ParseUser user, ParseException err) {
32+
if (user == null) {
33+
Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
34+
} else if (user.isNew()) {
35+
Log.d("MyApp", "User signed up and logged in through Facebook!");
36+
} else {
37+
Log.d("MyApp", "User logged in through Facebook!");
38+
}
39+
}
40+
});
41+
```
42+
43+
## License
44+
Copyright (c) 2015-present, Parse, LLC.
45+
All rights reserved.
46+
47+
This source code is licensed under the BSD-style license found in the
48+
LICENSE file in the root directory of this source tree. An additional grant
49+
of patent rights can be found in the PATENTS file in the same directory.

facebook/build.gradle

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apply plugin: "com.android.library"
2+
3+
android {
4+
compileSdkVersion rootProject.ext.compileSdkVersion
5+
6+
defaultConfig {
7+
minSdkVersion rootProject.ext.minSdkVersion
8+
targetSdkVersion rootProject.ext.targetSdkVersion
9+
versionCode 1
10+
versionName "1.0"
11+
}
12+
13+
packagingOptions {
14+
exclude "**/BuildConfig.class"
15+
}
16+
17+
lintOptions {
18+
abortOnError false
19+
}
20+
}
21+
22+
dependencies {
23+
api "com.facebook.android:facebook-login:5.11.2"
24+
implementation project(":parse")
25+
26+
testImplementation "junit:junit:4.13"
27+
testImplementation "org.mockito:mockito-core:1.10.19"
28+
testImplementation "org.robolectric:robolectric:3.8"
29+
}
30+
31+
apply from: "https://raw.githubusercontent.com/Commit451/gradle-android-javadocs/1.1.0/gradle-android-javadocs.gradle"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--
2+
~ Copyright (c) 2015-present, Parse, LLC.
3+
~ All rights reserved.
4+
~
5+
~ This source code is licensed under the BSD-style license found in the
6+
~ LICENSE file in the root directory of this source tree. An additional grant
7+
~ of patent rights can be found in the PATENTS file in the same directory.
8+
-->
9+
<manifest package="com.parse.facebook" />

0 commit comments

Comments
 (0)