@Piyumi Perera
Thank you for following up on this!
From the documentation that you're following, the sample is working with a single-page application (SPA) and might require some additional steps to support iOS/macOS platforms. To make sure this issue is isolated to just your mobile device, you can try testing this app from Internet Explorer or another browser outside of your phone to see if you're running into this same issue.
Additional Links:
Tutorial: Sign in users and call Microsoft Graph from an iOS or macOS app
Tutorial: Sign in users and call the Microsoft Graph API from an Android application
If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.