connected app to firebase

pull/415/head
Muqheet 7 years ago
parent 4808941539
commit 1555347e76

@ -13,6 +13,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
classpath 'org.ajoberstar:grgit:1.5.0'
classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
classpath 'com.google.gms:google-services:3.1.1'
}
}

@ -108,6 +108,9 @@ dependencies {
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$KOTLIN_VERSION"
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
compileOnly "javax.annotation:jsr250-api:1.0"
compileOnly "com.google.auto.factory:auto-factory:1.0-beta3"
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
@ -188,3 +191,5 @@ task coverageReport(type: JacocoReport) {
play {
track = 'alpha'
}
apply plugin: 'com.google.gms.google-services'

@ -0,0 +1,59 @@
{
"project_info": {
"project_number": "1070387411684",
"firebase_url": "https://uhabits-60f5c.firebaseio.com",
"project_id": "uhabits-60f5c",
"storage_bucket": "uhabits-60f5c.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1070387411684:android:c24ac74afee79412",
"android_client_info": {
"package_name": "org.isoron.uhabits"
}
},
"oauth_client": [
{
"client_id": "1070387411684-62dgqp208udgiql8k3nk9nnsj99tps2n.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "org.isoron.uhabits",
"certificate_hash": "f7ade3b34bad8aadad38b28645d32ff5674a96a5"
}
},
{
"client_id": "1070387411684-sinls84quiqltb6t9mlok2cg1qaqu4hk.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "1070387411684-sinls84quiqltb6t9mlok2cg1qaqu4hk.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyA_FuA7_lt1HQ6yG39YDHykKa5B9Bngs6s"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "1070387411684-sinls84quiqltb6t9mlok2cg1qaqu4hk.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
~
~ This file is part of Loop Habit Tracker.
@ -17,16 +16,12 @@
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest
package="org.isoron.uhabits"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.isoron.uhabits">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
@ -52,11 +47,13 @@
android:label="@string/main_activity_title"
android:launchMode="singleTop"
android:targetActivity=".activities.habits.list.ListHabitsActivity">
<!--
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
-->
</activity-alias>
<activity
@ -91,11 +88,11 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.habits.list.ListHabitsActivity" />
</activity>
<activity android:name=".notifications.SnoozeDelayPickerActivity"
<activity
android:name=".notifications.SnoozeDelayPickerActivity"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
</activity>
android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
<receiver
android:name=".widgets.CheckmarkWidgetProvider"
@ -220,8 +217,15 @@
<service
android:name=".sync.SyncService"
android:enabled="true"
android:exported="false">
</service>
android:exported="false"></service>
<activity android:name=".activities.login.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,46 @@
package org.isoron.uhabits.activities.login;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.firebase.ui.auth.AuthUI;
import org.isoron.uhabits.R;
import java.util.Arrays;
import java.util.List;
public class LoginActivity extends AppCompatActivity {
private static final int RC_SIGN_IN = 123;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
signin();
}
private void signin() {
// ...
// Choose authentication providers
List<AuthUI.IdpConfig> providers = Arrays.asList(
new AuthUI.IdpConfig.EmailBuilder().build(),
new AuthUI.IdpConfig.PhoneBuilder().build(),
new AuthUI.IdpConfig.GoogleBuilder().build(),
new AuthUI.IdpConfig.FacebookBuilder().build(),
new AuthUI.IdpConfig.TwitterBuilder().build());
// Create and launch sign-in intent
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN);
}
}

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.login.LoginActivity">
</android.support.constraint.ConstraintLayout>

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
~
~ This file is part of Loop Habit Tracker.

Loading…
Cancel
Save