The Profile page is the player’s personal hub inside TriviaPP. From here, players can set the name that appears on the leaderboard, pick a profile photo from their device camera roll, and toggle haptic feedback for wrong answers. The page also surfaces the player’s registered email address and their lifetime stats — games played, total correct answers, and personal best score.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dreancaste/TriviaPP/llms.txt
Use this file to discover all available pages before exploring further.
Profile Interface
All profile data is captured in theProfile model:
localStorage under the key sw_profile via StorageService.saveProfile(profile) and read back on page load with StorageService.getProfile(). If no profile has been saved yet, getProfile() returns the default: { displayName: '', avatar: '', vibrateOnError: true }.
Display Name
displayName is the name shown next to the player’s score on both the local and Firebase leaderboards. It is a free-text field with no length constraint enforced at the service level. If the player has not set a name, TriviaPage.finishGame() falls back to "Jugador" when writing ranking and history entries.
Avatar Photo
Players can set a profile photo using the Capacitor Camera plugin. Tapping the avatar area on the profile page callsselectPhoto(), which opens a native prompt letting the player choose between their camera and their photo library:
profile.avatar and persisted to localStorage along with the rest of the profile when the player saves.
Vibration on Error
ThevibrateOnError boolean controls whether the device produces a haptic impact when the player selects a wrong trivia answer. When set to true, TriviaPage.answer() calls:
@capacitor/haptics plugin and only produces physical feedback on a real device. The setting defaults to true for all new profiles.
Auth Info and Cumulative Stats
ProfilePage also displays two read-only pieces of information loaded in ngOnInit:
- Email — retrieved from
AuthService.userEmailand displayed as the player’s account identifier. - Cumulative stats — loaded from
StorageService.getStats(), exposinggamesPlayed,correctAnswers, andmaxScoredirectly on the profile screen.
StorageService.updateStats().