openmobilehub / android-omh-auth

Apache License 2.0
4 stars 1 forks source link

[BLOCKIN ISSUE] README.md Steps Cannot Be Followed Due to Incorrect Method Reference** #99

Open dzuluaga opened 3 months ago

dzuluaga commented 3 months ago

The instructions provided in the README.md file cannot be followed as described. Specifically, the snippet provided in the "Getting Started" section suggests adding code to the onViewCreated() function within MainActivity.kt. However, AppCompatActivity does not have an onViewCreated() function, making it impossible to implement the code as directed.

Steps to Reproduce

  1. Follow the steps in the README.md under the "Getting Started" section.
  2. Attempt to add the provided code snippet to the MainActivity.kt inside an onViewCreated() function.

Expected Behavior

The README.md should provide accurate and usable instructions for setting up the OMH Auth client, including correct method references that align with standard Android development practices.

Actual Behavior

The suggested code snippet cannot be implemented as described because AppCompatActivity does not contain an onViewCreated() method. This results in frustration and makes the SDK unusable in its current form.

Suggested Fix

Impact

This issue is a blocker for developers trying to integrate the SDK, leading to frustration and delays. Immediate attention is required to address this and ensure the SDK is usable.

Request

Please have developers follow the steps outlined in the README.md to ensure that they are accurate and that the SDK is fully functional as described.

adamTrz commented 2 months ago

Thanks @dzuluaga for reporting the issue.

Could you please elaborate more on this bit please?

AppCompatActivity does not contain an onViewCreated() method

If you go to Sample App and navigate to Main Activity you can see that there is indeed onCreate function which can be overridden:

https://github.com/openmobilehub/android-omh-auth/blob/d798fb1b43c5b123431b9ab703bf58970607c5c3/apps/auth-sample/src/main/java/com/openmobilehub/android/auth/sample/base/MainActivity.kt#L51-L57

In our particular use case for Example Application, since we want to handle multiple providers, we are not initializing client straight away though, we're doing it in inside LoggedInFragment like so:

https://github.com/openmobilehub/android-omh-auth/blob/d1b08b0e4ef1dcd00fdff14918e83a2a35c7fbf8/apps/auth-sample/src/main/java/com/openmobilehub/android/auth/sample/loggedin/LoggedInFragment.kt#L64-L68