I am trying to implement Firebase Phone Auth in my project which is based on a clean architecture. I am confused about PhoneAuthOptions class, builder of which requires activity on one hand (which belongs to presentation layer) and on the other hand, auth (which belongs to data layer). How can I provide this builder with activity and auth at the same time without violating principles of code decoupling in Clean Architecture?
val options = PhoneAuthOptions.newBuilder(auth)
.setPhoneNumber(phoneNumber) // Phone number to verify
.setTimeout(60L, TimeUnit.SECONDS) // Timeout and unit
.setActivity(this) // Activity (for callback binding)
.setCallbacks(callbacks) // OnVerificationStateChangedCallbacks
.build()
PhoneAuthProvider.verifyPhoneNumber(options)