provideAuthClient

fun provideAuthClient(context: Context, scopes: Collection<String>, clientId: String): OmhAuthClient

Provides an auth client interface to interact with the OMH Auth library. This uses reflection to obtain the correct implementation for GMS or non GMS devices depending on what dependency you have.

Return

an OmhAuthClient to interact with the Auth module.

Parameters

context

-> ideally your application context, but an activity context will also work.

scopes

-> your oauth scopes in a collection. Do take into account that non GMS devices won't be able to request more scopes after the first authorization.

clientId

-> your client ID for the Android Application.

ownReflectionPath

-> provide your own reflection path in case you are implementing your own OMH module.

Throws

when reflection fails for any of the implementations of the OmhAuthFactory. If this happens, look if you have configured correctly the gradle plugin or if your obfuscation method hasn't tampered with the library files.