<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prathyaksh on Medium]]></title>
        <description><![CDATA[Stories by Prathyaksh on Medium]]></description>
        <link>https://medium.com/@iamprathyaksh?source=rss-929533b53645------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jfNSSCpeiDSMxLKCH0rDkw.jpeg</url>
            <title>Stories by Prathyaksh on Medium</title>
            <link>https://medium.com/@iamprathyaksh?source=rss-929533b53645------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:29:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamprathyaksh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating Firebase Cloud Messaging and Setting Up a Node.js Backend for Push Notifications]]></title>
            <link>https://medium.com/@iamprathyaksh/integrating-firebase-cloud-messaging-and-setting-up-a-node-js-backend-for-push-notifications-93acf98f3eb9?source=rss-929533b53645------2</link>
            <guid isPermaLink="false">https://medium.com/p/93acf98f3eb9</guid>
            <category><![CDATA[sendpushnotifications]]></category>
            <category><![CDATA[notifications]]></category>
            <dc:creator><![CDATA[Prathyaksh]]></dc:creator>
            <pubDate>Thu, 19 Sep 2024 11:51:45 GMT</pubDate>
            <atom:updated>2024-09-19T11:52:18.611Z</atom:updated>
            <content:encoded><![CDATA[<h3>Table of Contents</h3><ol><li><a href="#overview">Overview</a></li><li><a href="#firebase-setup">Firebase Setup</a></li><li><a href="#integrating-fcm-in-your-app">Integrating FCM in Your App</a></li><li><a href="#setting-up-a-nodejs-backend-api">Setting Up a Node.js Backend API</a></li><li><a href="#sending-notifications-from-nodejs">Sending Notifications from Node.js</a></li><li><a href="#conclusion">Conclusion</a></li></ol><h3>1. Overview</h3><p>Firebase Cloud Messaging (FCM) is a service provided by Google that enables you to send notifications and messages to apps across platforms like Android, iOS, and the web. This guide walks you through setting up FCM for your app, generating an FCM token, and setting up a Node.js backend to send notifications.</p><h3>2. Firebase Setup</h3><p>Before integrating FCM, you’ll need to configure Firebase in your project.</p><h4>Steps:</h4><ol><li><strong>Create a Firebase Project</strong>: Go to the Firebase Console.</li></ol><ul><li>Click on “Add project” and follow the steps to create a new Firebase project.</li></ul><p><strong>2. Add Firebase to Your App</strong>:</p><ul><li>Select your newly created Firebase project.</li><li>For Android: Add an Android app by providing the package name, and download the google-services.json file.</li></ul><p>3. Add google-services.json to your app in case of flutter add it in android/app folder</p><h3><strong>3. Integrating FCM in Your Flutter App</strong></h3><blockquote><strong>Install these packages in to your yaml file.</strong></blockquote><pre>  firebase_messaging: ^14.7.10<br>  flutter_local_notifications: ^17.2.2<br>  app_settings: ^5.1.1<br>  firebase_core: ^2.24.2</pre><pre>import &#39;package:firebase_messaging/firebase_messaging.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_local_notifications/flutter_local_notifications.dart&#39;;<br><br>class NotificationService {<br>  // Firebase Messaging instance<br>  final FirebaseMessaging messaging = FirebaseMessaging.instance;<br>  final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =<br>      FlutterLocalNotificationsPlugin();<br><br>  // Method to request notification permission<br>  Future&lt;void&gt; requestNotificationPermission() async {<br>    try {<br>      NotificationSettings settings = await messaging.requestPermission(<br>        alert: true,<br>        announcement: true,<br>        badge: true,<br>        carPlay: true,<br>        criticalAlert: true,<br>        provisional: true,<br>        sound: true,<br>      );<br><br>      if (settings.authorizationStatus == AuthorizationStatus.authorized) {<br>        print(&#39;User granted permission&#39;);<br>      } else if (settings.authorizationStatus ==<br>          AuthorizationStatus.provisional) {<br>        print(&#39;User granted provisional permission&#39;);<br>      } else {<br>        print(&#39;User denied permission&#39;);<br>      }<br>    } catch (e) {<br>      print(&#39;Error requesting permission: $e&#39;);<br>    }<br>  }<br><br>  // Method to initialize local notifications<br>  Future&lt;void&gt; initLocalNotification(<br>      BuildContext context, RemoteMessage message) async {<br>    var androidInitializationSettings =<br>        const AndroidInitializationSettings(&#39;@mipmap/ic_launcher&#39;);<br>    var initializationSettings =<br>        InitializationSettings(android: androidInitializationSettings);<br><br>    // Initialize local notification plugin<br>    await flutterLocalNotificationsPlugin.initialize(<br>      initializationSettings,<br>      onDidReceiveNotificationResponse: (NotificationResponse response) {<br>        // Handle notification tap event<br>        print(&quot;Notification clicked: ${response.payload}&quot;);<br>      },<br>    );<br>  }<br><br>  // Method to show local notifications<br>  Future&lt;void&gt; showNotification(RemoteMessage message) async {<br>    RemoteNotification? notification = message.notification;<br>    AndroidNotification? android = message.notification?.android;<br><br>    if (notification != null &amp;&amp; android != null) {<br>      var androidPlatformChannelSpecifics = AndroidNotificationDetails(<br>        &#39;channel_id&#39;,<br>        &#39;channel_name&#39;,<br>        importance: Importance.max,<br>        priority: Priority.high,<br>        icon: &#39;@mipmap/ic_launcher&#39;,<br>      );<br><br>      var platformChannelSpecifics =<br>          NotificationDetails(android: androidPlatformChannelSpecifics);<br><br>      await flutterLocalNotificationsPlugin.show(<br>        notification.hashCode,<br>        notification.title,<br>        notification.body,<br>        platformChannelSpecifics,<br>        payload: message.data[&#39;payload&#39;], // Pass data payload if needed<br>      );<br>    }<br>  }<br><br>  // Method to get the device token<br>  Future&lt;String?&gt; getDeviceToken() async {<br>    try {<br>      String? token = await messaging.getToken();<br>      print(&#39;Device Token: $token&#39;);<br>      return token;<br>    } catch (e) {<br>      print(&#39;Error getting device token: $e&#39;);<br>      return null;<br>    }<br>  }<br><br>  // Method to initialize the notification service<br>  void initialize(BuildContext context) {<br>    // Handle foreground messages<br>    FirebaseMessaging.onMessage.listen((RemoteMessage message) {<br>      print(&#39;Received a message while in the foreground: ${message.data}&#39;);<br>      showNotification(<br>          message); // Show local notification when the app is in the foreground<br>    });<br><br>    // Handle background messages<br>    FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);<br>  }<br><br>  // Background message handler<br>  static Future&lt;void&gt; _firebaseMessagingBackgroundHandler(<br>      RemoteMessage message) async {<br>    print(&#39;Handling a background message: ${message.messageId}&#39;);<br>    // Handle the message as needed, can also show notification in background if needed<br>  }<br><br>  // Method to listen for token refresh<br>  void listenForTokenRefresh() {<br>    messaging.onTokenRefresh.listen((newToken) {<br>      print(&#39;New token: $newToken&#39;);<br>      // Save the new token to your server or update as needed<br>    });<br>  }<br>}</pre><blockquote><em>Call the NotificationService class in the initState() in the main</em></blockquote><pre>class _MyAppState extends State&lt;MyApp&gt; {<br>  late NotificationService notificationService;<br><br>  void initState() {<br>    super.initState();<br>    notificationService = NotificationService();<br>    notificationService.requestNotificationPermission(); // Request permission<br>    notificationService.initialize(context); // Initialize notification service<br>    notificationService.listenForTokenRefresh(); // Listen for token refresh<br>    notificationService.getDeviceToken();<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      debugShowCheckedModeBanner: false,<br>      title: &#39;Skillbanc Acdeamy&#39;,<br>      theme: lightThemeData(context),<br>      darkTheme: darkThemeData(context),<br>      themeMode: ThemeMode.dark,<br>      home: Stack(<br>        children: [<br>          WelcomePage(), // Your app content// Number line widget on top<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><blockquote>After running the code you will get FCM Token, use this token to send push notifications. In case of firebase open cloud messaging tab and add this token. In case of your node.js backend check for end of the page.</blockquote><blockquote><strong>Notifications will be sent successfully through firebase.</strong></blockquote><h3><strong>Possible Errors:</strong></h3><pre> Error getting device token: [firebase_messaging/unknown] java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: INVALID_SENDER</pre><p>If you face issues generating the fcm token check for the below solutions:</p><ol><li>Check if you have any double files of google-services.json</li><li>Check if you have values.xml file in your android/app/src/main/res/values/values.xml</li><li>Add Sender Id in place of ‘YOUR SENDER ID’ in the below code 2nd line. You get this sender Id in firebase project settings</li></ol><pre>&lt;resources&gt;<br>    &lt;!-- Replace these values with the actual values from your google-services.json --&gt;<br>    &lt;string name=&quot;default_web_client_id&quot; translatable=&quot;false&quot;&gt;78111930096-stfh009vblpdq6mh64bspdtj02i50a58.apps.googleusercontent.com&lt;/string&gt;<br>    &lt;!--    &lt;string name=&quot;firebase_database_url&quot; translatable=&quot;false&quot;&gt;https://refil-69828-default-rtdb.asia-southeast1.firebasedatabase.app&lt;/string&gt;--&gt;<br>    &lt;string name=&quot;gcm_defaultSenderId&quot; translatable=&quot;false&quot;&gt;YOURSENDERID&lt;/string&gt;<br>    &lt;string name=&quot;google_api_key&quot; translatable=&quot;false&quot;&gt;AIzaSyCuKhlIZO0hIyIldXTuKn61GIOagf9_tWA&lt;/string&gt;<br>    &lt;string name=&quot;google_app_id&quot; translatable=&quot;false&quot;&gt;1:78111930096:android:8257d47aa5d9560c7d7435&lt;/string&gt;<br>    &lt;string name=&quot;google_crash_reporting_api_key&quot; translatable=&quot;false&quot;&gt;YOUR_API_KEY&lt;/string&gt;<br>    &lt;string name=&quot;project_id&quot; translatable=&quot;false&quot;&gt;skillbanc-academy&lt;/string&gt;<br>&lt;/resources&gt;</pre><p>After this restart the app and run. If you still face error try un installing the app and run. You will definitely get the token.</p><h3><strong>4. Setting Up a Node.js Backend API</strong></h3><p><strong>4.1 Initialize a Node.js project</strong>:</p><pre>mkdir fcm-backend<br>cd fcm-backend<br>npm init -y</pre><p><strong>4.2 Install necessary packages</strong>:</p><pre>npm install express body-parser firebase-admin</pre><p><strong>4.3 Set Up Firebase Admin SDK</strong>:</p><ul><li>Download your Firebase serviceAccount.json from the Firebase Console under “Project Settings” &gt; “Service Accounts”.</li><li>Save the JSON file, e.g., firebase-adminsdk.json.</li></ul><p><strong>4.4 Create the Express Server (</strong><strong>index.js)</strong>:</p><pre>const admin = require(&#39;firebase-admin&#39;);<br>const express = require(&#39;express&#39;);<br>const app = express();<br>const path = require(&#39;path&#39;);<br>const bodyParser = require(&#39;body-parser&#39;);<br><br>// Parse JSON request body<br>app.use(bodyParser.json());<br><br>// Path to your Firebase service account JSON file<br>const serviceAccount = require(path.join(__dirname, &#39;firebase&#39;, &#39;serviceAccountKey.json&#39;));<br><br>// Initialize the Firebase Admin SDK<br>admin.initializeApp({<br>  credential: admin.credential.cert(serviceAccount),<br>});<br><br>app.post(&#39;/send-notification&#39;, (req, res) =&gt; {<br>  const { title, body, fcmToken } = req.body;<br><br>  // Create the notification message payload<br>  const message = {<br>    notification: {<br>      title: title,<br>      body: body,<br>    },<br>    token: fcmToken,  // Target the device by FCM token<br>  };<br><br>  // Send the notification using Firebase Admin<br>  admin<br>    .messaging()<br>    .send(message)<br>    .then((response) =&gt; {<br>      console.log(&#39;Successfully sent message:&#39;, response);<br>      res.status(200).send(&#39;Notification sent successfully!&#39;);<br>    })<br>    .catch((error) =&gt; {<br>      console.error(&#39;Error sending message:&#39;, error);<br>      res.status(500).send(&#39;Error sending notification&#39;);<br>    });<br>});<br><br>// Start the server<br>const PORT = process.env.PORT || 3000;<br>app.listen(PORT, () =&gt; {<br>  console.log(`Server is running on port ${PORT}`);<br>});</pre><p>4.5 Run the node application with command :<strong> node index.js</strong></p><h3><strong>5. Sending Notifications from Node.js/ Test from Postman</strong></h3><p>Using the post method with url : <a href="http://localhost:3000/send-notification">http://localhost:3000/send-notification</a></p><p>Body:</p><pre>{<br>  &quot;title&quot;: &quot;Hello from Postman&quot;,<br>  &quot;body&quot;: &quot;This is a test notification sent via Postman&quot;,<br>  &quot;fcmToken&quot;: &quot;PASTE HERE YOUR FCM TOKEN&quot;<br>}</pre><p>You will get a message Notification sent successfully!</p><p>If you face any errors sending the notifications from node backend check whether the server is running or not.</p><h3>7. Conclusion</h3><p>You’ve now integrated Firebase Cloud Messaging into your app and set up a Node.js backend API to send push notifications. With this setup, you can easily send targeted notifications to specific devices or users, enhancing user engagement in your app.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93acf98f3eb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Make API Call through Flutter App using dio]]></title>
            <link>https://medium.com/@iamprathyaksh/how-to-make-api-call-through-flutter-app-using-dio-17908f10ed0a?source=rss-929533b53645------2</link>
            <guid isPermaLink="false">https://medium.com/p/17908f10ed0a</guid>
            <dc:creator><![CDATA[Prathyaksh]]></dc:creator>
            <pubDate>Fri, 23 Aug 2024 07:58:38 GMT</pubDate>
            <atom:updated>2024-08-23T07:58:38.158Z</atom:updated>
            <content:encoded><![CDATA[<p>This documentation provides a structured guide on how to implement API calls in a Flutter application using the Dio library, along with a provider for state management and a dependency injection setup using GetIt.</p><h3><strong>Directory Structure:</strong></h3><p>lib/<br>├── core/<br>│ ├── network/<br>│ │ ├── dio/<br>│ │ │ ├── dio_client.dart<br>│ │ │ └── logging_interceptor.dart<br>│ └── utils/<br>│ └── app_constants.dart<br>├── provider/<br>│ └── object_provider.dart<br>├── repo/<br>│ └── object_repository.dart<br>└── di_container.dart</p><h3><strong>1. Setting Up Dependency Injection</strong></h3><h3>di_container.dart</h3><p>This file sets up dependency injection for various components of the application, using the GetIt package.</p><pre>import &#39;package:dio/dio.dart&#39;;<br>import &#39;package:get_it/get_it.dart&#39;;<br>import &#39;package:shared_preferences/shared_preferences.dart&#39;;<br>import &#39;package:skillbanc_app/provider/object_provider.dart&#39;;<br>import &#39;package:skillbanc_app/repo/object_repository.dart&#39;;<br>import &#39;core/network/dio/dio_client.dart&#39;;<br>import &#39;core/network/dio/logging_interceptor.dart&#39;;<br>import &#39;core/utils/app_constants.dart&#39;;<br><br>final sl = GetIt.instance;<br><br>Future&lt;void&gt; init() async {<br>  // Register DioClient<br>  sl.registerLazySingleton(() =&gt; DioClient(<br>      AppConstants.BASE_URL, <br>      sl(),<br>      loggingInterceptor: sl(), <br>      sharedPreferences: sl(),<br>  ));<br><br>  // Register ObjectRepository<br>  sl.registerLazySingleton(() =&gt; ObjectRepository(dioClient: sl()));<br><br>  // Register ObjectProvider<br>  sl.registerFactory(() =&gt; ObjectProvider(repository: sl()));<br><br>  // External dependencies<br>  final sharedPreference = await SharedPreferences.getInstance();<br>  sl.registerLazySingleton(() =&gt; sharedPreference);<br>  sl.registerLazySingleton(() =&gt; Dio());<br>  sl.registerLazySingleton(() =&gt; LoggingInterceptor());<br>}</pre><h3>Explanation:</h3><ul><li><strong>DioClient</strong>: Configures the Dio client with the base URL and required interceptors.</li><li><strong>ObjectRepository</strong>: Acts as an intermediary between the API and the provider.</li><li><strong>ObjectProvider</strong>: Manages the state and API calls related to objects.</li><li><strong>SharedPreferences</strong>: Used to persist user preferences.</li><li><strong>LoggingInterceptor</strong>: For logging HTTP requests and responses.</li></ul><h3>2. Creating the API Repository</h3><h3>object_repository.dart</h3><p>This file contains the ObjectRepository, which is responsible for making API calls.</p><pre>import &#39;package:dio/dio.dart&#39;;<br>import &#39;package:skillbanc_app/core/network/dio/dio_client.dart&#39;;<br>import &#39;../core/utils/app_constants.dart&#39;;<br>import &#39;../models/api_response.dart&#39;;<br><br>class ObjectRepository {<br>  final DioClient dioClient;<br><br>  ObjectRepository({required this.dioClient});<br><br>  Future&lt;ApiResponse&gt; postObject(String sessionId, String grade, String chapter, String topic) async {<br>    try {<br>      Response response = await dioClient.post(<br>        AppConstants.SAVE_POST +<br>            &quot;?sessionId=$sessionId&quot; +<br>            &quot;&amp;c1name=Task App&quot; +<br>            &quot;&amp;o1name=SBApp&quot; +<br>            &quot;&amp;c2name=Task&quot; +<br>            &quot;&amp;o2name=$grade$chapter$topic&quot;,<br>        data: null,<br>        options: Options(headers: {&#39;Accept&#39;: &#39;application/json; charset=UTF-8&#39;}),<br>      );<br>      return ApiResponse.withSuccess(response);<br>    } on DioException catch (e) {<br>      return ApiResponse.withError(e.response);<br>    } catch (e) {<br>      return ApiResponse.withError(e.toString());<br>    }<br>  }<br>}</pre><h3>Explanation:</h3><ul><li><strong>postObject</strong>: This method constructs the API request URL using the provided parameters and sends a POST request. It handles errors and returns an ApiResponse object.</li></ul><h3><strong>3. Creating the Provider</strong></h3><h3>object_provider.dart</h3><p>This file contains the ObjectProvider, which is a ChangeNotifier that manages API interactions and notifies listeners of state changes.</p><pre>import &#39;package:flutter/cupertino.dart&#39;;<br>import &#39;package:skillbanc_app/repo/object_repository.dart&#39;;<br>import &#39;../models/api_response.dart&#39;;<br><br>class ObjectProvider extends ChangeNotifier {<br>  final ObjectRepository repository;<br><br>  ObjectProvider({required this.repository});<br><br>  Future&lt;void&gt; postObject(String grade, String chapter, String topic) async {<br>    ApiResponse apiResponse = await repository.postObject(<br>        &#39;fb0cf9b1-80af-4c1c-b498-6b7dfdfde368&#39;, grade, chapter, topic);<br><br>    print(apiResponse.response?.statusCode.toString());<br>    print(apiResponse.response?.statusMessage.toString());<br><br>    if (apiResponse.response != null &amp;&amp; apiResponse.response?.statusCode == 200) {<br>      Map&lt;String, dynamic&gt;? response = apiResponse.response?.data;<br><br>      if (response != null) {<br>        print(response.toString());<br>      }<br>    } else {<br>      print(&#39;Failed to post object.&#39;);<br>    }<br>  }<br>}</pre><h3>Explanation:</h3><ul><li><strong>postObject</strong>: Calls the ObjectRepository&#39;s postObject method, logs the response status, and processes the response data.</li></ul><h3><strong>4. Integrating the Provider into Your Application</strong></h3><p>In your main Dart file, use the ObjectProvider to make API calls in response to user actions.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;<br>import &#39;di_container.dart&#39;;<br>import &#39;provider/object_provider.dart&#39;;<br><br>void main() async {<br>  WidgetsFlutterBinding.ensureInitialized();<br>  await init(); // Initialize dependencies<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return ChangeNotifierProvider(<br>      create: (_) =&gt; sl&lt;ObjectProvider&gt;(),<br>      child: MaterialApp(<br>        home: HomeScreen(),<br>      ),<br>    );<br>  }<br>}<br><br>class HomeScreen extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    final provider = Provider.of&lt;ObjectProvider&gt;(context);<br><br>    return Scaffold(<br>      appBar: AppBar(title: Text(&quot;API Call Example&quot;)),<br>      body: Center(<br>        child: ElevatedButton(<br>          onPressed: () {<br>            provider.postObject(&#39;2&#39;, &#39;Addition of Numbers&#39;, &#39;SomeTopicString&#39;);<br>          },<br>          child: Text(&quot;Post Object&quot;),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><h3>Explanation:</h3><ul><li>The HomeScreen widget contains a button that, when pressed, calls the postObject method from the ObjectProvider, initiating the API call.</li></ul><h3>Conclusion</h3><p>This documentation outlines how to set up API calls in a Flutter application using the Dio library, along with state management through the Provider package and dependency injection using GetIt. By following these steps, you can efficiently manage API interactions and state within your Flutter app.</p><p>Feel free to modify the code snippets to fit your specific requirements and improve upon this foundation for your application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17908f10ed0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Generate a Client ID and Client Secret for Google Sign-In]]></title>
            <link>https://medium.com/@iamprathyaksh/how-to-generate-a-client-id-and-client-secret-for-google-sign-in-01561f40f351?source=rss-929533b53645------2</link>
            <guid isPermaLink="false">https://medium.com/p/01561f40f351</guid>
            <dc:creator><![CDATA[Prathyaksh]]></dc:creator>
            <pubDate>Sat, 03 Aug 2024 18:28:18 GMT</pubDate>
            <atom:updated>2024-08-03T18:28:18.187Z</atom:updated>
            <content:encoded><![CDATA[<p>Integrating Google Sign-In into your application can streamline the user authentication process.</p><h4>Step 1: Create a Project in Google Cloud Console</h4><ol><li><strong>Go to the Google Cloud Console</strong>: <a href="https://console.cloud.google.com/">Open Google Cloud Console.</a></li><li><strong>Create a New Project</strong>: Click on the project drop-down menu and select “New Project.” Enter a project name and click “Create.”</li></ol><h4>Step 2: Enable the Google Sign-In API</h4><ol><li><strong>Select Your Project</strong>: Make sure you are in the correct project in the Google Cloud Console.</li><li><strong>Navigate to API Library</strong>: Click the navigation menu (three horizontal lines) in the top-left corner, then go to “APIs &amp; Services” &gt; “Library.”</li><li><strong>Enable the API</strong>: Search for “Google Sign-In” and select the “Google Sign-In API.” Click “Enable.” and also enable the following api’s.</li></ol><blockquote><strong>Enable These API’s :</strong></blockquote><p><strong>Identity Toolkit Api</strong></p><p><strong>People API</strong></p><h4>Step 3: Configure the OAuth Consent Screen</h4><ol><li><strong>Go to OAuth Consent Screen</strong>: In the “APIs &amp; Services” menu, select “OAuth consent screen.”</li><li><strong>Choose User Type</strong>: Select “External” or “Internal” based on your user base.</li><li><strong>Fill Out Required Information</strong>: Provide the app name, user support email, and developer contact email. Click “Save and Continue.”</li><li><strong>Add Scopes</strong>: Include necessary scopes such as email and profile. Save and continue.</li></ol><h4>Step 4: Create OAuth 2.0 Credentials : <a href="https://developers.google.com/identity/sign-in/ios/start-integrating">OAuthLink</a>(click here)</h4><ol><li><strong>Navigate to Credentials</strong>: In the “APIs &amp; Services” menu, select “Credentials.”</li><li><strong>Create OAuth Client ID</strong>: Click “Create Credentials” and choose “OAuth 2.0 Client ID.”</li><li><strong>Select Application Type</strong>: Choose your application type (e.g., Web application).</li><li><strong>Add Authorized Redirect URIs</strong>: For a web app, include your redirect URIs (e.g., http://localhost:3000 for local testing). *<strong>(If you forget this option. It will give you Error:400 redirect_uri_mismatch)</strong></li></ol><h4>Step 5: Retrieve Your Client ID and Secret</h4><ol><li><strong>View Credentials</strong>: After creation, your client ID and secret will be displayed.</li><li><strong>Copy and Store Securely</strong>: Make sure to copy these credentials and store them securely.</li></ol><blockquote>By following these steps, you’ll be able to generate the necessary credentials for integrating Google Sign-In into your application. This will enhance the user experience by providing a simple and secure authentication method.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01561f40f351" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>