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

Commit

Permalink
Merge pull request #41 from Jawnnypoo/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
Jawnnypoo authored Jul 17, 2018
2 parents 0d95b35 + 8e0be89 commit 7c0efbd
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 330 deletions.
20 changes: 3 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ branches:
- /^v4-\d+\.\d+\.\d+$/ # regex

language: android
sudo: false

jdk:
- oraclejdk8

android:
components:
- tools
- platform-tools
- build-tools-27.0.3
- android-27
- doc-27

before_install:
- pip install --user codecov
- mkdir "$ANDROID_HOME/licenses" || true
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"

script:
- ./gradlew clean testDebugUnitTest jacocoTestReport --info
Expand All @@ -30,11 +24,3 @@ cache:
directories:
- $HOME/.gradle
- $HOME/.m2/repository

deploy:
provider: script
script: ./gradlew bintrayUpload
skip_cleanup: true
on:
branch: master
tags: true
63 changes: 0 additions & 63 deletions CONTRIBUTING.md

This file was deleted.

83 changes: 46 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,62 @@
# Parse Facebook Utils for Android
[![Build Status][build-status-svg]][build-status-link]
[![Coverage Status][coverage-status-svg]][coverage-status-link]
[![Bintray][bintray-svg]][bintray-link]
[![License][license-svg]][license-link]
[![](https://jitpack.io/v/parse-community/ParseFacebookUtils-Android.svg)](https://jitpack.io/#parse-community/ParseFacebookUtils-Android)

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

## Download
Download [the latest AAR][latest] or define in Gradle:
## Dependency

```groovy
dependencies {
implementation 'com.parse:parsefacebookutils-v4-android:X.X.X'
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):

```gradle
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```

where `X.X.X` is the latest version: [![Bintray][bintray-svg]][bintray-link]

Snapshots of the development version are available by using [Jitpack][jitpack-snapshot-link].

## Usage
Everything can done through the supplied gradle wrapper:

### Compile a JAR
```
./gradlew clean jarRelease
Then, add the library to your project `build.gradle`
```gradle
dependencies {
implementation 'com.github.parse-community:ParseFacebookUtils-Android:latest.version.here'
}
```
Outputs can be found in `Parse/build/libs/`

### Run the Tests
```
./gradlew clean testDebug
## Usage
Extensive docs can be found in the [guide][guide]. The basic steps are:
```java
// in Application.onCreate(); or somewhere similar
ParseFacebookUtils.initialize(context);
```
Results can be found in `Parse/build/reports/`

### Get Code Coverage Reports
Within the activity where your user is going to log in with Facebook, include the following:
```java
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
}
```
./gradlew clean jacocoTestReport
Then elsewhere, when your user taps the login button:
```java
ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
@Override
public void done(ParseUser user, ParseException err) {
if (user == null) {
Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
} else if (user.isNew()) {
Log.d("MyApp", "User signed up and logged in through Facebook!");
} else {
Log.d("MyApp", "User logged in through Facebook!");
}
}
});
```
Results can be found in `Parse/build/reports/`

## How Do I Contribute?
We want to make contributing to this project as easy and transparent as possible. Please refer to the [Contribution Guidelines](CONTRIBUTING.md).
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).

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

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.

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

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

[build-status-svg]: https://travis-ci.org/ParsePlatform/ParseFacebookUtils-Android.svg?branch=master
[build-status-link]: https://travis-ci.org/ParsePlatform/ParseFacebookUtils-Android
[coverage-status-svg]: https://coveralls.io/repos/ParsePlatform/ParseFacebookUtils-Android/badge.svg?branch=master&service=github
[coverage-status-link]: https://coveralls.io/github/ParsePlatform/ParseFacebookUtils-Android?branch=master
[bintray-svg]: https://api.bintray.com/packages/parse/maven/ParseFacebookUtils-Android/images/download.svg
[bintray-link]: https://bintray.com/parse/maven/ParseFacebookUtils-Android/
[license-svg]: https://img.shields.io/badge/license-BSD-lightgrey.svg
[license-link]: https://github.com/ParsePlatform/ParseFacebookUtils-Android/blob/master/LICENSE
[license-link]: https://github.com/parse-community/ParseFacebookUtils-Android/blob/master/LICENSE
17 changes: 8 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

plugins {
id "com.jfrog.bintray" version "1.7.3"
}

plugins {
// This version depends on Gradle version used
// See https://github.com/wupdigital/android-maven-publish#compatibility-information
id 'digital.wup.android-maven-publish' version '3.2.0'
id 'com.github.ben-manes.versions' version '0.20.0'
}

allprojects {
Expand All @@ -25,3 +20,7 @@ allprojects {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Loading

0 comments on commit 7c0efbd

Please sign in to comment.