Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update App Icon and Resolve Android Build Issues #110

Merged
merged 22 commits into from
Nov 28, 2024
Merged

Update App Icon and Resolve Android Build Issues #110

merged 22 commits into from
Nov 28, 2024

Conversation

cfiguer055
Copy link
Collaborator

@cfiguer055 cfiguer055 commented Oct 13, 2024

1. App Icon Changes

  • icon-transparent-expand-2
  • Updated the app icon in app.json.

  • Removed the Android adaptive icon section to add a gradient background, as adaptive icons don't support gradients well. Unless you guys prefer a solid color for the bg.

  • Using the global icon for both Android and iOS to simplify the setup.

    @Vaiterius:
    Can you run the iOS build in the testing branch and see if the app icon renders correctly on the device? I don't want to pay $100 for Apple Dev lol. Also maybe we should push ios/ build here like I did with android/. What do you think, @Persian-of-Interest ?

2. Resolved Android Build Issues

  • There were issues with the Android icon cache keeping the old icon despite multiple changes to the icon and path.
  • The expo prebuild and expo prebuild --clear commands also caused incorrect values in AndroidManifest.xml (package="com.arcs.smartclothingapp") and build.gradle (namespace "com.smartclothingapp"), which had to be manually fixed (I had to run this multiple times to get the icon to change).
  • To avoid this, I customized the native Android code and removed android/ from .gitignore.
  • I'm considering adding a script (bash, PowerShell, or build.gradle plugin) to automate fixing the Android build after clearing the cache for future developers.

3. HomeScreen Charts

  • Uncommented the charts on the HomeScreen.
    Reference: Issue #109

4. Updated Dependencies

  • Updated dependencies for metro and config.

5. Fix Persistent Auth and AsyncStorage Issues

  • Resolved Firebase Auth persistence issue by configuring AsyncStorage for persistent login across app close and device restart.
  • Moved Firestore setDoc to sign-up to ensure user documents are created even if the metrics modal is skipped.
  • Ensured proper AsyncStorage management for UID and metrics, adding clearing on logout and account deletion.

Let me know if any adjustments are needed!

@cfiguer055 cfiguer055 added documentation Improvements or additions to documentation enhancement New feature or request Android Any task related to Android native code iOS Any task related to iOS native code dependencies Pull requests that update a dependency file labels Oct 13, 2024
@cfiguer055
Copy link
Collaborator Author

Screenshot_20241012_222949_One_UI_Home

@cfiguer055
Copy link
Collaborator Author

cfiguer055 commented Oct 15, 2024

  1. Added plugins/customNamespacePlugin script that deletes package from AndroidManifest and replaces namespace in build.gradle for post-install after running 'expo prebuild'.
  2. Re-added android/ to .gitignore since plugin fixes prebuild issue. So we can continue to use expo-workflow instead of bare-workflow.
  3. Changed display name for App from SmartClothingApp to SmartClothing.

@cfiguer055
Copy link
Collaborator Author

Detailed Explanation of Solutions

I’ve addressed several issues related to Firebase Auth persistence and AsyncStorage management:

  1. Firebase Auth Initialization with AsyncStorage
    Updated Firebase Auth to use AsyncStorage for persistence, ensuring the login state is retained even after closing the app or restarting the device. This prevents the auth state from resetting to memory persistence.

  2. Fix for Firestore Document Creation
    Previously, the user document wasn’t being created if the metrics modal was skipped during sign-up. I moved the setDoc function from updateUserMetrics to startSignupWithEmail, ensuring the document is always created, even if the modal is skipped.

  3. Improved AsyncStorage Management

    • The UID is now stored in AsyncStorage during both login and sign-up, ensuring consistency.
    • I added functions to clear UID and metrics data from AsyncStorage upon logout and account deletion to enhance security.
  4. Persistent Login Across Sessions
    Solved the issue with persistent login by asynchronously loading fonts and checking the authentication state in parallel. This ensures proper sequencing and eliminates race conditions, allowing persistent state loading without blocking the UI.

For more details, refer to the related Issue #111.

@cfiguer055
Copy link
Collaborator Author

1. Automated Test Summary:
Test Suites: 16 passed, 16 total
Tests: 103 passed, 103 total
Snapshots: 5 passed, 5 total
Time: 24.315 s
Ran all test suites.

2. New Features:

  • App Icon Update:

    • Unified app icons for Android and iOS with a global icon (gradient background supported).
    • Removed Android adaptive icon configuration.
    • Updated app display name to SmartClothing.
    • Logo successfully tested on both Android and iOS.
  • Resolved Android Build Issues:

    • Added customNamespacePlugin to automate namespace corrections after clearing the cache.
    • Re-added android/ to .gitignore to maintain Expo workflow.
  • Firebase Auth Persistence:

    • Integrated AsyncStorage for persistent login across app closures and device restarts.
    • Ensured user documents are always created by moving Firestore setDoc to sign-up flow.
    • Added secure functions to store and clear user data in AsyncStorage.
  • Persistent Login:

    • Enhanced session restoration by asynchronously loading fonts and verifying auth states.
    • Fixed race conditions for seamless startup experience.
  • Home Screen Updates:

    • Re-enabled charts for activity visualization on HomeScreen.
  • Closes Issues

    • #109: HomeScreen charts uncommented and fixed.
    • #111: Persistent login and Firebase Auth persistence implemented.

3. Regression Testing:
No new issues introduced.
Stable integration with new features.
Additional Notes:
Testing Document:
Google Docs Testing Report
*Will add new testcases for automatic testing related to these feature updates.

Ready to Launch 🚀

@cfiguer055 cfiguer055 merged commit 25f51cf into main Nov 28, 2024
2 checks passed
cfiguer055 added a commit that referenced this pull request Dec 6, 2024
Update App Icon and Resolve Android Build Issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Any task related to Android native code dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request iOS Any task related to iOS native code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants