-
-
Notifications
You must be signed in to change notification settings - Fork 323
Login Library
ParseUI-Login
is a library for building login and signup flows with the Parse Android SDK. You can easily configure the look and feel of the login screens by either specifying XML configurations or constructing an Intent in code. To use this project with your app, you should import it as a library project in Android Studio.
We built several sample apps demonstrating how to use the ParseLoginUI library. Before importing this library into your app, we recommend that you run these sample apps to become familiar with its functionality and customizations. To run our sample apps, you need to import this repo as a standalone Gradle project:
- Clone this repository onto your machine.
- Import this repository's project with Android Studio (File > Import Project > ParseUI-Android folder). The project has Maven dependencies on the Parse Android SDK, Facebook SDK and the Bolts framework. Android Studio automatically resolves these via Gradle.
- Specify the following in res/values/strings.xml of each sample project: parse_app_id and parse_client_key facebook_app_id twitter_consumer_key and twitter_consumer_secret
- Build and run the sample apps using Android Studio.
-
Import and config Parse as described in README.md.
-
Add the following to your
AndroidManifest.xml
within the<application></application>
section. You can see a complete example in our sample app.<activity android:name="com.parse.ui.ParseLoginActivity" android:label="@string/app_name" android:launchMode="singleTop"> <!-- For more options, see https://www.parse.com/docs/android_guide#ui-login --> <meta-data android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_ENABLED" android:value="true"/> <meta-data android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_EMAIL_AS_USERNAME" android:value="true"/> </activity>
-
To start the login flow from your own activity, you launch the
ParseLoginActivity
with two lines of code:ParseLoginBuilder builder = new ParseLoginBuilder(MyActivity.this); startActivityForResult(builder.build(), 0);
ParseLoginActivity
will guide the user through the login experience, where the user can also sign up or reset a forgotten password.
Each screen in the login experience is implemented by a fragment hosted within this activity.
When ParseLoginActivity
finishes, you can check ParseUser.getCurrentUser()
in your own activity to see whether the user actually logged in. This library is ultra-customizable, allowing you to configure the login experience through either XML or code. You can directly configure the login experience through the activity meta-data in AndroidManifest.xml
.
For complete details about this library project, please see our documentation on the Parse website.