Skip to content
This repository was archived by the owner on Feb 14, 2020. It is now read-only.

Commit 7c0efbd

Browse files
authored
Merge pull request #41 from Jawnnypoo/refactor
Refactor
2 parents 0d95b35 + 8e0be89 commit 7c0efbd

File tree

11 files changed

+78
-330
lines changed

11 files changed

+78
-330
lines changed

.travis.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@ branches:
44
- /^v4-\d+\.\d+\.\d+$/ # regex
55

66
language: android
7-
sudo: false
7+
88
jdk:
99
- oraclejdk8
1010

11-
android:
12-
components:
13-
- tools
14-
- platform-tools
15-
- build-tools-27.0.3
16-
- android-27
17-
- doc-27
18-
1911
before_install:
2012
- pip install --user codecov
13+
- mkdir "$ANDROID_HOME/licenses" || true
14+
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"
2115

2216
script:
2317
- ./gradlew clean testDebugUnitTest jacocoTestReport --info
@@ -30,11 +24,3 @@ cache:
3024
directories:
3125
- $HOME/.gradle
3226
- $HOME/.m2/repository
33-
34-
deploy:
35-
provider: script
36-
script: ./gradlew bintrayUpload
37-
skip_cleanup: true
38-
on:
39-
branch: master
40-
tags: true

CONTRIBUTING.md

Lines changed: 0 additions & 63 deletions
This file was deleted.

README.md

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,62 @@
11
# Parse Facebook Utils for Android
22
[![Build Status][build-status-svg]][build-status-link]
3-
[![Coverage Status][coverage-status-svg]][coverage-status-link]
4-
[![Bintray][bintray-svg]][bintray-link]
53
[![License][license-svg]][license-link]
4+
[![](https://jitpack.io/v/parse-community/ParseFacebookUtils-Android.svg)](https://jitpack.io/#parse-community/ParseFacebookUtils-Android)
65

76
A utility library to authenticate `ParseUser`s with the Facebook SDK. For more information, see our [guide][guide].
87

9-
## Download
10-
Download [the latest AAR][latest] or define in Gradle:
8+
## Dependency
119

12-
```groovy
13-
dependencies {
14-
implementation 'com.parse:parsefacebookutils-v4-android:X.X.X'
10+
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
11+
12+
```gradle
13+
allprojects {
14+
repositories {
15+
...
16+
maven { url "https://jitpack.io" }
17+
}
1518
}
1619
```
1720

18-
where `X.X.X` is the latest version: [![Bintray][bintray-svg]][bintray-link]
19-
20-
Snapshots of the development version are available by using [Jitpack][jitpack-snapshot-link].
21-
22-
## Usage
23-
Everything can done through the supplied gradle wrapper:
24-
25-
### Compile a JAR
26-
```
27-
./gradlew clean jarRelease
21+
Then, add the library to your project `build.gradle`
22+
```gradle
23+
dependencies {
24+
implementation 'com.github.parse-community:ParseFacebookUtils-Android:latest.version.here'
25+
}
2826
```
29-
Outputs can be found in `Parse/build/libs/`
3027

31-
### Run the Tests
32-
```
33-
./gradlew clean testDebug
28+
## Usage
29+
Extensive docs can be found in the [guide][guide]. The basic steps are:
30+
```java
31+
// in Application.onCreate(); or somewhere similar
32+
ParseFacebookUtils.initialize(context);
3433
```
35-
Results can be found in `Parse/build/reports/`
36-
37-
### Get Code Coverage Reports
34+
Within the activity where your user is going to log in with Facebook, include the following:
35+
```java
36+
@Override
37+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
38+
super.onActivityResult(requestCode, resultCode, data);
39+
ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
40+
}
3841
```
39-
./gradlew clean jacocoTestReport
42+
Then elsewhere, when your user taps the login button:
43+
```java
44+
ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
45+
@Override
46+
public void done(ParseUser user, ParseException err) {
47+
if (user == null) {
48+
Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
49+
} else if (user.isNew()) {
50+
Log.d("MyApp", "User signed up and logged in through Facebook!");
51+
} else {
52+
Log.d("MyApp", "User logged in through Facebook!");
53+
}
54+
}
55+
});
4056
```
41-
Results can be found in `Parse/build/reports/`
4257

4358
## How Do I Contribute?
44-
We want to make contributing to this project as easy and transparent as possible. Please refer to the [Contribution Guidelines](CONTRIBUTING.md).
59+
We want to make contributing to this project as easy and transparent as possible. Please refer to the [Contribution Guidelines](https://github.com/parse-community/Parse-SDK-Android/blob/master/CONTRIBUTING.md).
4560

4661
## License
4762
Copyright (c) 2015-present, Parse, LLC.
@@ -53,16 +68,10 @@ We want to make contributing to this project as easy and transparent as possible
5368

5469
As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.
5570

56-
[guide]: https://parse.com/docs/android/guide#users-facebook-users
71+
[guide]: https://docs.parseplatform.org/android/guide/#facebook-users
5772

58-
[latest]: https://search.maven.org/remote_content?g=com.parse&a=parsefacebookutils-v4-android&v=LATEST
59-
[jitpack-snapshot-link]: https://jitpack.io/#parse-community/ParseFacebookUtils-Android/master-SNAPSHOT
73+
[build-status-svg]: https://travis-ci.org/parse-community/ParseFacebookUtils-Android.svg?branch=master
74+
[build-status-link]: https://travis-ci.org/parse-community/ParseFacebookUtils-Android
6075

61-
[build-status-svg]: https://travis-ci.org/ParsePlatform/ParseFacebookUtils-Android.svg?branch=master
62-
[build-status-link]: https://travis-ci.org/ParsePlatform/ParseFacebookUtils-Android
63-
[coverage-status-svg]: https://coveralls.io/repos/ParsePlatform/ParseFacebookUtils-Android/badge.svg?branch=master&service=github
64-
[coverage-status-link]: https://coveralls.io/github/ParsePlatform/ParseFacebookUtils-Android?branch=master
65-
[bintray-svg]: https://api.bintray.com/packages/parse/maven/ParseFacebookUtils-Android/images/download.svg
66-
[bintray-link]: https://bintray.com/parse/maven/ParseFacebookUtils-Android/
6776
[license-svg]: https://img.shields.io/badge/license-BSD-lightgrey.svg
68-
[license-link]: https://github.com/ParsePlatform/ParseFacebookUtils-Android/blob/master/LICENSE
77+
[license-link]: https://github.com/parse-community/ParseFacebookUtils-Android/blob/master/LICENSE

build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
21
buildscript {
32
repositories {
43
google()
54
jcenter()
65
}
76
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.1.2'
7+
classpath 'com.android.tools.build:gradle:3.1.3'
8+
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
9+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
910
}
1011
}
1112

1213
plugins {
13-
id "com.jfrog.bintray" version "1.7.3"
14-
}
15-
16-
plugins {
17-
// This version depends on Gradle version used
18-
// See https://github.com/wupdigital/android-maven-publish#compatibility-information
19-
id 'digital.wup.android-maven-publish' version '3.2.0'
14+
id 'com.github.ben-manes.versions' version '0.20.0'
2015
}
2116

2217
allprojects {
@@ -25,3 +20,7 @@ allprojects {
2520
jcenter()
2621
}
2722
}
23+
24+
task clean(type: Delete) {
25+
delete rootProject.buildDir
26+
}

0 commit comments

Comments
 (0)