Skip to content
Android Sample Project with IGDB Sign In
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea Sample App Jan 24, 2019
SVG Updated project with igdb button Jan 25, 2019
app
gradle/wrapper Sample App Jan 24, 2019
.DS_Store Updated project with igdb button Jan 25, 2019
.gitignore Initial commit Jan 24, 2019
LICENSE Update LICENSE Jul 24, 2019
README.md added a "the" Jan 24, 2019
build.gradle Sample App Jan 24, 2019
gradle.properties Sample App Jan 24, 2019
gradlew Sample App Jan 24, 2019
gradlew.bat Sample App Jan 24, 2019
settings.gradle Sample App Jan 24, 2019

README.md

IGDB Sign In (Android Sample Project)

Android Sample Project with IGDB Sign In

About this sample project

This sample project gives an example of how to use IGDB sign in, in an Android project.

Project Dependecies Dependencies used to create this project:

Set-up

This project does not come with keys, for obvious reasons.
The first thing you need to do is add your own credentials in a few places.

  1. Fill out the empty variables in AuthenticationActivity with your own keys.
private val igdb_api_key = "YOUR_API_KEY" // Place your API key here
private val client_id = "YOUR_CLIENT_ID" // Place your Client ID here
private val client_secret = "YOUR_CLIENT_SECRET" // Place your Client Secret here
private val redirect_uri = "YOUR_REDIRECT_URI".toUri() // Place your Redirect URI here
private val scopes = "YOUR_SCOPES" // Place your scopes here with black space in between them
  1. In the AndroidManifest file you need to change the android:scheme to your scheme.
<!-- AppAuth -->

<activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="your_redirect_scheme"/>
    </intent-filter>
</activity>

<!-- AppAuth -->

NOTE: The scheme is the first part of your redirect_uri. Example: redirect_uri = "com.yourdomain.app://oauth2callback" -> scheme = "com.yourdomain.app"

  1. In the build.gradle file your need to add the same scheme as in your AndroidManifest file
// AppAuth
implementation 'net.openid:appauth:0.7.1'
android.defaultConfig.manifestPlaceholders = [
        'appAuthRedirectScheme': 'YOUR_REDIRECT_SCHEME' // Change to Your Redirect Scheme
]

After these changes you should be able to build and run the project. Sign in with an IGDB account and you will see the application connecting to our servers and retrieving the username and avatar of the IGDB user.

You can’t perform that action at this time.