Register/Initialize DialMyAppComponent in Application class
- Upon request, the DMA SDK might be provided with "auto-init" configuration. In that case No need to trigger the "InjectingRef.defineApplication" function in the app.
Note!: By default, the SDK requires initialization described below:
- Register DialMyAppComponent with help of InjectingRef.defineApplication function. The best place to call this function is in the "onCreate()" method of the subclass of Android "Application" class. Code sample:
-
Optionally it is possible to provide a 3rd parameter as a String variable - the package name. This is not required and not recommended to use, it is for testing purposes only (to support the pre-production environment for some corner cases).
-
Optional: If DMA and company agreed upon the auth tokens inside the application, it is possible to initialize InjectingRef.defineApplication with the 4th parameter, that is your implementation of the org.mbte.dialmyapp.auth.ITokenVerification interface, that has 2 methods. Pass as the 4th parameter this implemented interface:
/**
* Check the given Auth token validity
*
* @param context the calling application context
* @param authToken the Auth token to verify
*/
public void isTokenValid(@NonNull Context context, @NonNull String authToken);
/**
* Refresh the given Auth token
*
* @param context the calling application context
* @param oldAuthToken the Auth token to refresh
*/
public void refreshToken(@NonNull Context context, @NonNull String oldAuthToken);
/**
* Check the given Auth token validity
*
* @param context the calling application context
* @param authToken the Auth token to verify
*/
fun isTokenValid(context: Context, authToken: String)
/**
* Refresh the given Auth token
*
* @param context the calling application context
* @param oldAuthToken the Auth token to refresh
*/
fun refreshToken(context: Context, oldAuthToken: String)
In order to provide the token initially to the application use the static methods of the class org.mbte.dialmyapp.auth.AuthToken.
DexGuard
If you use DexGuard in your application, add the following rules:
In the directories, there are files which we use for the DMA library.
Also, you should have SDK version 4404+. If it is not, please, ask us to create a new build for you.