Skip to content

Instantly share code, notes, and snippets.

@maheshj01
Last active October 27, 2025 16:53
Show Gist options
  • Select an option

  • Save maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a to your computer and use it in GitHub Desktop.

Select an option

Save maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a to your computer and use it in GitHub Desktop.

Revisions

  1. maheshj01 revised this gist Oct 27, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion firebase.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    5. *[Firebase analytics](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)*
    7. *[Firebase Functions](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#7-firebase-functions)*
    8. *[Firebase crashlytics]()*
    8. *[Firebase crashlytics](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#8-firebase-crashlytics)*

    ### 1. Deploying flutter webapp using Firebase Hosting

  2. maheshj01 revised this gist Oct 27, 2025. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    5. *[Firebase analytics](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)*
    7. *[Firebase Functions](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#7-firebase-functions)*
    8. *[Firebase crashlytics]()*

    ### 1. Deploying flutter webapp using Firebase Hosting

    @@ -524,3 +525,7 @@ firebase functions:delete scheduledFunction

    for more: `firebase functions --help`

    ### 8. Firebase Crashlytics

    1. Manually uploading debug symbols: https://stackoverflow.com/a/78716766/8253662
    2. Automate by adding a run script: https://stackoverflow.com/a/76310123/8253662
  3. maheshj01 revised this gist Oct 9, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -219,6 +219,7 @@ Send notification to a firebase topic

    ```bash
    gcloud auth login
    gcloud projects list
    gcloud config set project furdle
    ```

  4. maheshj01 revised this gist Sep 29, 2025. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -210,6 +210,8 @@ _sample push notification payload_
    xcrun simctl push booted com.nevercode.triage assets/api.json
    ```

    > Note: For IOS you have to create a Apple Push notification Certificate (.p8 file)
    And under Authentication key add your key and teamId and upload the certificate.

    Send notification to a firebase topic

  5. maheshj01 revised this gist Sep 22, 2025. 1 changed file with 31 additions and 0 deletions.
    31 changes: 31 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -210,6 +210,37 @@ _sample push notification payload_
    xcrun simctl push booted com.nevercode.triage assets/api.json
    ```


    Send notification to a firebase topic

    1. select project

    ```bash
    gcloud auth login
    gcloud config set project furdle
    ```

    2. send test notification to a topic

    ```bash
    mahesh@MacBook-Pro-81 functions % ACCESS_TOKEN=$(gcloud auth print-access-token)
    curl -X POST \
    "https://fcm.googleapis.com/v1/projects/furdle/messages:send" \
    -H "Authorization: Bearer ${ACCESS_TOKEN}" \
    -H "Content-Type: application/json" \
    -d '{
    "message": {
    "topic": "daily_challenge",
    "notification": {
    "title": "<0001f9e9> Test Notification",
    "body": "Testing from curl!"
    }
    }
    }'
    ```



    ### 4. CORS issue in firebase storage

    ```
  6. maheshj01 revised this gist Sep 21, 2025. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -477,4 +477,16 @@ e.g
    firebase deploy --only functions:updateLogs
    ```

    5. Delete a deployed function

    ```bash
    firebase functions:delete <functionName>
    ```
    e.g

    ```bash
    firebase functions:delete scheduledFunction
    ```

    for more: `firebase functions --help`

  7. maheshj01 revised this gist Apr 28, 2025. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -2,12 +2,12 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc

    #### Table of Contents

    1. *[Deploying flutter webapp using Firebase Hosting](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#1-deploying-flutter-webapp-using-firebase-hosting)*
    2. *[Set Firebase messaging notification icon](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)*
    1. *[Deploying flutter webapp using Firebase Hosting](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#1-deploying-flutter-webapp-using-firebase-hosting)*
    2. *[Set Firebase messaging notification icon](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)*
    7. *[Firebase Functions](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#7-firebase-functions)*

    ### 1. Deploying flutter webapp using Firebase Hosting
  8. maheshj01 revised this gist Apr 24, 2025. 1 changed file with 1 addition and 38 deletions.
    39 changes: 1 addition & 38 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -420,44 +420,7 @@ This will create `firebase.json`, `.firebaserc` and `functions/` in your project

    If you want to use environment variables [Firebase 2nd gen env configs][1] (Optional)

    firebase exposes these methods in gen2 `defineInt`, `defineBoolean`, `defineSecret` and `defineList`

    As usual you would add your environment variables in `functions/.env` file
    and then your functions method you can access them as below

    ```js
    const { onRequest } = require('firebase-functions/v2/https');
    const { defineInt, defineString } = require('firebase-functions/params');

    // Define some parameters
    const minInstancesConfig = defineInt('HELLO_WORLD_MININSTANCES');
    const welcomeMessage = defineString('WELCOME_MESSAGE');
    ```

    access the value of these keys as

    ```
    res.send(`${welcomeMessage.value()}! I am a function.`);
    ```

    > note that these env variables are only available in runtime (after deployment)
    > Environment variables stored in .env files can be used for function configuration, but you should not consider them a secure way to store sensitive information such as database credentials or API keys. This is especially important if you check your .env files into source control.
    To create a secret, use the Firebase CLI.

    ```
    firebase functions:secrets:set SECRET_NAME
    ```


    access them like a normal env variable

    ```js
    response.send(`The secret API key is ${process.env.SECRET_NAME}`)
    ```
    [1]: https://firebase.google.com/docs/functions/config-env?gen=2nd

    see: https://stackoverflow.com/a/79587286/8253662

    2. If you are using typescript compile to javascript by running

  9. maheshj01 revised this gist Apr 22, 2025. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -418,8 +418,7 @@ firebase init functions

    This will create `firebase.json`, `.firebaserc` and `functions/` in your project root

    If you want to use environment variables (Optional)
    Note that `functions.config()` is deprecated as of [Firebase 2nd gen env configs][1]
    If you want to use environment variables [Firebase 2nd gen env configs][1] (Optional)

    firebase exposes these methods in gen2 `defineInt`, `defineBoolean`, `defineSecret` and `defineList`

  10. maheshj01 revised this gist Apr 22, 2025. 1 changed file with 36 additions and 7 deletions.
    43 changes: 36 additions & 7 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -419,17 +419,46 @@ firebase init functions
    This will create `firebase.json`, `.firebaserc` and `functions/` in your project root

    If you want to use environment variables (Optional)
    Note that `functions.config()` is deprecated as of [Firebase 2nd gen env configs][1]

    ```bash
    mahesh@MacBook-Pro-81 functions % firebase functions:config:set resend_api_key.key="my-api-key-goes-here"
    (node:36291) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    ✔ Functions config updated.
    firebase exposes these methods in gen2 `defineInt`, `defineBoolean`, `defineSecret` and `defineList`

    As usual you would add your environment variables in `functions/.env` file
    and then your functions method you can access them as below

    ```js
    const { onRequest } = require('firebase-functions/v2/https');
    const { defineInt, defineString } = require('firebase-functions/params');

    // Define some parameters
    const minInstancesConfig = defineInt('HELLO_WORLD_MININSTANCES');
    const welcomeMessage = defineString('WELCOME_MESSAGE');
    ```

    access the value of these keys as

    ```
    res.send(`${welcomeMessage.value()}! I am a function.`);
    ```

    > note that these env variables are only available in runtime (after deployment)
    > Environment variables stored in .env files can be used for function configuration, but you should not consider them a secure way to store sensitive information such as database credentials or API keys. This is especially important if you check your .env files into source control.
    Please deploy your functions for the change to take effect by running firebase deploy --only functions
    To create a secret, use the Firebase CLI.

    mahesh@MacBook-Pro-81 functions %
    ```
    firebase functions:secrets:set SECRET_NAME
    ```


    access them like a normal env variable

    ```js
    response.send(`The secret API key is ${process.env.SECRET_NAME}`)
    ```
    [1]: https://firebase.google.com/docs/functions/config-env?gen=2nd


    2. If you are using typescript compile to javascript by running

  11. maheshj01 revised this gist Apr 22, 2025. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -418,6 +418,19 @@ firebase init functions

    This will create `firebase.json`, `.firebaserc` and `functions/` in your project root

    If you want to use environment variables (Optional)

    ```bash
    mahesh@MacBook-Pro-81 functions % firebase functions:config:set resend_api_key.key="my-api-key-goes-here"
    (node:36291) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    ✔ Functions config updated.

    Please deploy your functions for the change to take effect by running firebase deploy --only functions

    mahesh@MacBook-Pro-81 functions %
    ```

    2. If you are using typescript compile to javascript by running

    ```
  12. maheshj01 revised this gist Mar 20, 2025. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,8 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)
    7. *[Firebase Functions]()
    6. *[Google SignIn](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)*
    7. *[Firebase Functions](https://gist.github.com/maheshj01/e4a29a387c6e9ad3b71d71d2ca968d0a#7-firebase-functions)*

    ### 1. Deploying flutter webapp using Firebase Hosting

  13. maheshj01 revised this gist Mar 20, 2025. 1 changed file with 69 additions and 1 deletion.
    70 changes: 69 additions & 1 deletion firebase.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)
    7. *[Firebase Functions]()

    ### 1. Deploying flutter webapp using Firebase Hosting

    @@ -405,4 +406,71 @@ Generate SHA fingerprint (Mac)

    ```
    keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
    ```
    ```

    ### 7. Firebase Functions

    1. In your project root run initialize firebase functions

    ```bash
    firebase init functions
    ```

    This will create `firebase.json`, `.firebaserc` and `functions/` in your project root

    2. If you are using typescript compile to javascript by running

    ```
    cd functions/
    npm run-script build
    ```
    generates `functions/lib/index.js`

    3. To test locally start the firebase functions shell

    ```bash
    firebase functions:shell
    ```

    Then you can invoke firebase functions

    e.g

    ```bash
    mahesh@MacBook-Pro-10 functions % firebase functions:shell
    (node:26758) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    ⚠ functions: Functions Emulator unable to start on port 5000, starting on 5001 instead.
    ⚠ functions: Your requested "node" version "22" doesn't match your global version "23". Using node@23 from host.
    Serving at port 8727
    i functions: Loaded functions: updateLogs
    ⚠ functions: The following emulators are not running, calls to these services will affect production: firestore, database, pubsub, storage, eventarc, tasks
    firebase > updateLogs()
    Successfully invoked function.'
    firebase > > (node:26791) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    > (Use `node --trace-deprecation ...` to show where the warning was created)
    ⚠ functions: The Cloud Firestore emulator is not running, so calls to Firestore will affect production.
    ⚠ Google API requested!
    - URL: "https://oauth2.googleapis.com/token"
    ...

    ```

    4. Deploy functions

    ```bash
    firebase deploy --only functions
    ```

    to deploy a specific function
    ```bash
    firebase deploy --only functions:<functionName>
    ```
    e.g

    ```bash
    firebase deploy --only functions:updateLogs
    ```


  14. maheshj01 revised this gist Jun 18, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -159,6 +159,8 @@ originally posted here https://github.com/flutter/flutter/issues/17941#issuecomm
    android:name="io.flutter.app.FlutterApplication"
    android:label="When Coin"
    android:icon="@mipmap/ic_launcher">

    <!-- Specify the metadata here under applications -->
    <meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@mipmap/ic_notification" />
  15. maheshj01 revised this gist Mar 7, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn]()
    6. *[Google SignIn](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#6-google-signin)

    ### 1. Deploying flutter webapp using Firebase Hosting

    @@ -397,7 +397,7 @@ Disable debug mode
    adb shell setprop debug.firebase.analytics.app .none.
    ```

    6. Google SignIn
    ### 6. Google SignIn

    Generate SHA fingerprint (Mac)

  16. maheshj01 revised this gist Mar 7, 2023. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*
    6. *[Google SignIn]()

    ### 1. Deploying flutter webapp using Firebase Hosting

    @@ -394,4 +395,12 @@ adb shell setprop debug.firebase.analytics.app <package_name>
    Disable debug mode
    ```
    adb shell setprop debug.firebase.analytics.app .none.
    ```

    6. Google SignIn

    Generate SHA fingerprint (Mac)

    ```
    keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
    ```
  17. maheshj01 revised this gist Nov 7, 2022. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -187,6 +187,21 @@ originally posted here https://github.com/flutter/flutter/issues/17941#issuecomm

    Set up push Notifications: https://medium.com/comerge/implementing-push-notifications-in-flutter-apps-aef98451e8f1

    _sample push notification payload_
    ```json
    {
    "aps" : {
    "alert" : {
    "title" : "Game Request",
    "subtitle" : "Five Card Draw",
    "body" : "Bob wants to play poker"
    },
    "category" : "GAME_INVITATION"
    },
    "gameID" : "12345678"
    }
    ```

    ```
    xcrun simctl push booted com.nevercode.triage assets/api.json
    ```
  18. maheshj01 revised this gist Nov 6, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion firebase.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,6 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*


    ### 1. Deploying flutter webapp using Firebase Hosting

    1. install npm cli
    @@ -186,6 +185,8 @@ originally posted here https://github.com/flutter/flutter/issues/17941#issuecomm

    ### 3. Send notification to ios simulator/device

    Set up push Notifications: https://medium.com/comerge/implementing-push-notifications-in-flutter-apps-aef98451e8f1

    ```
    xcrun simctl push booted com.nevercode.triage assets/api.json
    ```
  19. maheshj01 revised this gist Nov 6, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion firebase.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    1. *[Deploying flutter webapp using Firebase Hosting](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#1-deploying-flutter-webapp-using-firebase-hosting)*
    2. *[Set Firebase messaging notification icon](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#4-cors-issue-in-firebase-storage)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*


  20. maheshj01 revised this gist Nov 6, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion firebase.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    2. *[Set Firebase messaging notification icon](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#5-firebase-analytics)*


    ### 1. Deploying flutter webapp using Firebase Hosting
  21. maheshj01 revised this gist Nov 6, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,11 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc

    #### Table of Contents

    1. *Deploying flutter webapp using Firebase Hosting*
    1. *[Deploying flutter webapp using Firebase Hosting](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#1-deploying-flutter-webapp-using-firebase-hosting)*
    2. *[Set Firebase messaging notification icon](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    3. *Send notification to ios simulator/device*
    4. *CORS issue in firebase storage*
    5. *Firebase analytics*
    3. *[Send notification to ios simulator/device](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    4. *[CORS issue in firebase storage](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a)*
    5. *[Firebase analytics](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a)*


    ### 1. Deploying flutter webapp using Firebase Hosting
  22. maheshj01 revised this gist Nov 6, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion firebase.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc
    #### Table of Contents

    1. *Deploying flutter webapp using Firebase Hosting*
    2. *Set Firebase messaging notification icon*
    2. *[Set Firebase messaging notification icon](https://gist.github.com/maheshmnj/e4a29a387c6e9ad3b71d71d2ca968d0a#2-set-firebase-messaging-notification-icon-in-android-app)*
    3. *Send notification to ios simulator/device*
    4. *CORS issue in firebase storage*
    5. *Firebase analytics*
  23. maheshj01 revised this gist Jul 8, 2022. 1 changed file with 131 additions and 31 deletions.
    162 changes: 131 additions & 31 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -193,37 +193,143 @@ originally posted here https://github.com/flutter/flutter/issues/17941#issuecomm
    ### 4. CORS issue in firebase storage

    ```
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil cors set cors.json gs://app-triage.appspot.com
    Setting CORS on gs://app-triage.appspot.com/...
    ServiceException: 401 Anonymous caller does not have storage.buckets.update access to the Google Cloud Storage bucket.
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gcloud init Welcome! This command will take you through the configuration of gcloud.
    mahesh@Maheshs-MacBook-Air-M1 ~ % cd google-cloud-sdk
    mahesh@Maheshs-MacBook-Air-M1 google-cloud-sdk % ./install.sh
    Welcome to the Google Cloud CLI!
    To help improve the quality of this product, we collect anonymized usage data
    and anonymized stacktraces when crashes are encountered; additional information
    is available at <https://cloud.google.com/sdk/usage-statistics>. This data is
    handled in accordance with our privacy policy
    <https://cloud.google.com/terms/cloud-privacy-notice>. You may choose to opt in this
    collection now (by choosing 'Y' at the below prompt), or at any time in the
    future by running the following command:
    gcloud config set disable_usage_reporting false
    Do you want to help improve the Google Cloud CLI (y/N)? y
    Your current Google Cloud CLI version is: 392.0.0
    The latest available version is: 392.0.0
    ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Components │
    ├───────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬──────────┤
    │ Status │ Name │ ID │ Size │
    ├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼──────────┤
    │ Not Installed │ App Engine Go Extensions │ app-engine-go │ 4.0 MiB │
    │ Not Installed │ Appctl │ appctl │ 18.5 MiB │
    │ Not Installed │ Artifact Registry Go Module Package Helper │ package-go-module │ < 1 MiB │
    │ Not Installed │ Cloud Bigtable Command Line Tool │ cbt │ 9.3 MiB │
    │ Not Installed │ Cloud Bigtable Emulator │ bigtable │ 5.7 MiB │
    │ Not Installed │ Cloud Datalab Command Line Tool │ datalab │ < 1 MiB │
    │ Not Installed │ Cloud Datastore Emulator │ cloud-datastore-emulator │ 34.9 MiB │
    │ Not Installed │ Cloud Firestore Emulator │ cloud-firestore-emulator │ 39.5 MiB │
    │ Not Installed │ Cloud Pub/Sub Emulator │ pubsub-emulator │ 60.7 MiB │
    │ Not Installed │ Cloud Run Proxy │ cloud-run-proxy │ 7.4 MiB │
    │ Not Installed │ Cloud SQL Proxy │ cloud_sql_proxy │ 7.3 MiB │
    │ Not Installed │ Google Cloud Build Local Builder │ cloud-build-local │ 6.2 MiB │
    │ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr │ │
    │ Not Installed │ Kustomize │ kustomize │ 7.4 MiB │
    │ Not Installed │ Minikube │ minikube │ 27.1 MiB │
    │ Not Installed │ Nomos CLI │ nomos │ 23.5 MiB │
    │ Not Installed │ On-Demand Scanning API extraction helper │ local-extract │ 10.9 MiB │
    │ Not Installed │ Skaffold │ skaffold │ 19.2 MiB │
    │ Not Installed │ anthos-auth │ anthos-auth │ 18.2 MiB │
    │ Not Installed │ config-connector │ config-connector │ 52.7 MiB │
    │ Not Installed │ gcloud Alpha Commands │ alpha │ < 1 MiB │
    │ Not Installed │ gcloud Beta Commands │ beta │ < 1 MiB │
    │ Not Installed │ gcloud app Java Extensions │ app-engine-java │ 51.9 MiB │
    │ Not Installed │ gcloud app PHP Extensions │ app-engine-php │ 21.9 MiB │
    │ Not Installed │ gcloud app Python Extensions │ app-engine-python │ 7.8 MiB │
    │ Not Installed │ gcloud app Python Extensions (Extra Libraries) │ app-engine-python-extras │ 26.4 MiB │
    │ Not Installed │ kpt │ kpt │ 12.6 MiB │
    │ Not Installed │ kubectl │ kubectl │ < 1 MiB │
    │ Not Installed │ kubectl-oidc │ kubectl-oidc │ 18.2 MiB │
    │ Not Installed │ pkg │ pkg │ │
    │ Installed │ BigQuery Command Line Tool │ bq │ 1.6 MiB │
    │ Installed │ Cloud Storage Command Line Tool │ gsutil │ 15.5 MiB │
    │ Installed │ Google Cloud CLI Core Libraries │ core │ 23.8 MiB │
    └───────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴──────────┘
    To install or remove components at your current SDK version [392.0.0], run:
    $ gcloud components install COMPONENT_ID
    $ gcloud components remove COMPONENT_ID
    To update your SDK installation to the latest version [392.0.0], run:
    $ gcloud components update
    To take a quick anonymous survey, run:
    $ gcloud survey
    Modify profile to update your $PATH and enable shell command completion?
    Do you want to continue (Y/n)? y
    The Google Cloud SDK installer will now prompt you to update an rc file to bring
    the Google Cloud CLIs into your environment.
    Enter a path to an rc file to update, or leave blank to use
    [/Users/mahesh/.zshrc]:
    Backing up [/Users/mahesh/.zshrc] to [/Users/mahesh/.zshrc.backup].
    [/Users/mahesh/.zshrc] has been updated.
    ==> Start a new shell for the changes to take effect.
    For more information on how to get started, please visit:
    https://cloud.google.com/sdk/docs/quickstarts
    mahesh@Maheshs-MacBook-Air-M1 google-cloud-sdk % gcloud init
    Welcome! This command will take you through the configuration of gcloud.
    Settings from your current configuration [cors] are:
    core:
    account: [email protected]
    disable_usage_reporting: 'True'
    project: furdle-21410493
    Pick configuration to use:
    [1] Re-initialize this configuration [cors] with new settings
    [2] Create a new configuration
    [3] Switch to and re-initialize existing configuration: [default]
    Please enter your numeric choice: 3
    Your current configuration has been set to: [default]
    You can skip diagnostics next time by using the following flag:
    gcloud init --skip-diagnostics
    Network diagnostic detects and fixes local network connection issues.
    Checking network connection...done.
    Checking network connection...done.
    Reachability Check passed.
    Network diagnostic passed (1/1 checks passed).
    You must log in to continue. Would you like to log in (Y/n)? y
    Choose the account you would like to use to perform operations for this
    configuration:
    [1] [email protected]
    [2] [email protected]
    [3] Log in with a new account
    Please enter your numeric choice: 2
    Your browser has been opened to visit:
    https://accounts.google.com/o/oauth2/auth?xxxxxxxxxxx
    You are logged in as: [[email protected]].
    You are logged in as: [[email protected]].
    Pick cloud project to use:
    [1] app-triage
    [2] hello-79c7c
    [3] world-voyage-217607
    [4] Create a new project
    Please enter numeric choice or text value (must exactly match list item): 1
    Your current project has been set to: [app-triage].
    [1] project-1
    [2] project-2
    [3] project-3
    ...
    ...
    [14] Project-14
    [15]
    [16]
    Please enter numeric choice or text value (must exactly match list item): 14
    Your current project has been set to: [Project-14].
    Not setting default zone/region (this feature makes it easier to use
    [gcloud compute] by setting an appropriate default value for the
    @@ -234,13 +340,10 @@ able to do this for you the next time you run it, make sure the
    Compute Engine API is enabled for your project on the
    https://console.developers.google.com/apis page.
    Created a default .boto configuration file at [/Users/mahesh/.boto]. See this file and
    [https://cloud.google.com/storage/docs/gsutil/commands/config] for more
    information about configuring Google Cloud Storage.
    Your Google Cloud SDK is configured and ready to use!
    * Commands that require authentication will use [email protected] by default
    * Commands will reference project `camera-triage` by default
    * Commands that require authentication will use [email protected] by default
    * Commands will reference project `Project-14` by default
    Run `gcloud help config` to learn how to change individual settings
    This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
    @@ -250,14 +353,11 @@ Some things to try next:
    * Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
    * Run `gcloud topic --help` to learn about advanced features of the SDK like arg files and output formatting
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil listingDid you mean this?
    list
    CommandException: Invalid command "listing".
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil list
    gs://camera-triage.appspot.com/
    gs://staging.camera-triage.appspot.com/
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://app-triage.appspot.com/...
    * Run `gcloud cheat-sheet` to see a roster of go-to `gcloud` commands.
    mahesh@Maheshs-MacBook-Air-M1 myproject % gcloud --help
    mahesh@Maheshs-MacBook-Air-M1 myproject % gsutil cors set cors.json gs://myproject-id.appspot.com
    Setting CORS on gs://myproject-id.appspot.com/...
    mahesh@Maheshs-MacBook-Air-M1 myproject %
    ```

    ### 5. Firebase analytics
  24. maheshj01 revised this gist Jun 10, 2022. 1 changed file with 11 additions and 4 deletions.
    15 changes: 11 additions & 4 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,9 @@ Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/doc

    1. *Deploying flutter webapp using Firebase Hosting*
    2. *Set Firebase messaging notification icon*
    3. *CORS issue in firebase storage*
    4. *Firebase analytics*
    3. *Send notification to ios simulator/device*
    4. *CORS issue in firebase storage*
    5. *Firebase analytics*


    ### 1. Deploying flutter webapp using Firebase Hosting
    @@ -183,7 +184,13 @@ originally posted here https://github.com/flutter/flutter/issues/17941#issuecomm
    </application>
    ```

    ### 3. CORS issue in firebase storage
    ### 3. Send notification to ios simulator/device

    ```
    xcrun simctl push booted com.nevercode.triage assets/api.json
    ```

    ### 4. CORS issue in firebase storage

    ```
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil cors set cors.json gs://app-triage.appspot.com
    @@ -253,7 +260,7 @@ mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil cors set cors.json gs://
    Setting CORS on gs://app-triage.appspot.com/...
    ```

    ### 4. Firebase analytics
    ### 5. Firebase analytics
    - Add routeObserver to MaterialApp
    ```
    navigatorObservers: [
  25. maheshj01 revised this gist Mar 15, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    Set up firebase for flutter using firebase cli: https://firebase.flutter.dev/docs/overview/

    #### Table of Contents

    1. *Deploying flutter webapp using Firebase Hosting*
  26. maheshj01 revised this gist Feb 11, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion firebase.md
    Original file line number Diff line number Diff line change
    @@ -247,7 +247,7 @@ CommandException: Invalid command "listing".
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil list
    gs://camera-triage.appspot.com/
    gs://staging.camera-triage.appspot.com/
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % cors set cors.json gs://camera-triage.appspot.com
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://app-triage.appspot.com/...
    ```

  27. maheshj01 revised this gist Jan 22, 2022. 1 changed file with 22 additions and 2 deletions.
    24 changes: 22 additions & 2 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    1. *Deploying flutter webapp using Firebase Hosting*
    2. *Set Firebase messaging notification icon*
    3. *CORS issue in firebase storage*

    4. *Firebase analytics*


    ### 1. Deploying flutter webapp using Firebase Hosting
    @@ -147,7 +147,7 @@ Hosting URL: https://vocabhub.web.app
    ```


    ### 2.Set Firebase messaging Notification icon in Android app
    ### 2. Set Firebase messaging Notification icon in Android app

    originally posted here https://github.com/flutter/flutter/issues/17941#issuecomment-412242466

    @@ -249,4 +249,24 @@ gs://camera-triage.appspot.com/
    gs://staging.camera-triage.appspot.com/
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://app-triage.appspot.com/...
    ```

    ### 4. Firebase analytics
    - Add routeObserver to MaterialApp
    ```
    navigatorObservers: [
    FirebaseAnalyticsObserver(analytics: firebaseAnalytics),
    ],
    ```
    - Send events to firebase using `firebaseAnalytics`
    e.g firebaseAnalytics.setScreen(name:'screenName');
    - To test in realtime use debugView

    enable debug mode
    ```
    adb shell setprop debug.firebase.analytics.app <package_name>
    ```
    Disable debug mode
    ```
    adb shell setprop debug.firebase.analytics.app .none.
    ```
  28. maheshj01 revised this gist Jan 6, 2022. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -184,8 +184,8 @@ originally posted here https://github.com/flutter/flutter/issues/17941#issuecomm
    ### 3. CORS issue in firebase storage

    ```
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://camera-triage.appspot.com/...
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil cors set cors.json gs://app-triage.appspot.com
    Setting CORS on gs://app-triage.appspot.com/...
    ServiceException: 401 Anonymous caller does not have storage.buckets.update access to the Google Cloud Storage bucket.
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gcloud init Welcome! This command will take you through the configuration of gcloud.
    @@ -203,18 +203,18 @@ You must log in to continue. Would you like to log in (Y/n)? y
    Your browser has been opened to visit:
    https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=32555940559.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=DhG6cC8mYGUhJpqQTFSpvlNtKTV0dS&access_type=offline&code_challenge=_gncpaJOULfzwjlfvyZkI9z53AojzRk-8a9dL3mRQVQ&code_challenge_method=S256
    https://accounts.google.com/o/oauth2/auth?xxxxxxxxxxx
    You are logged in as: [[email protected]].
    Pick cloud project to use:
    [1] camera-triage
    [2] triage-79c7c
    [3] woven-voyage-217607
    [1] app-triage
    [2] hello-79c7c
    [3] world-voyage-217607
    [4] Create a new project
    Please enter numeric choice or text value (must exactly match list item): 1
    Your current project has been set to: [camera-triage].
    Your current project has been set to: [app-triage].
    Not setting default zone/region (this feature makes it easier to use
    [gcloud compute] by setting an appropriate default value for the
    @@ -244,9 +244,9 @@ Some things to try next:
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil listingDid you mean this?
    list
    CommandException: Invalid command "listing".
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil list
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % gsutil list
    gs://camera-triage.appspot.com/
    gs://staging.camera-triage.appspot.com/
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://camera-triage.appspot.com/...
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://app-triage.appspot.com/...
    ```
  29. maheshj01 revised this gist Jan 6, 2022. 1 changed file with 71 additions and 0 deletions.
    71 changes: 71 additions & 0 deletions firebase.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@

    1. *Deploying flutter webapp using Firebase Hosting*
    2. *Set Firebase messaging notification icon*
    3. *CORS issue in firebase storage*



    @@ -178,4 +179,74 @@ originally posted here https://github.com/flutter/flutter/issues/17941#issuecomm
    </intent-filter>
    </activity>
    </application>
    ```

    ### 3. CORS issue in firebase storage

    ```
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://camera-triage.appspot.com/...
    ServiceException: 401 Anonymous caller does not have storage.buckets.update access to the Google Cloud Storage bucket.
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gcloud init Welcome! This command will take you through the configuration of gcloud.
    Your current configuration has been set to: [default]
    You can skip diagnostics next time by using the following flag:
    gcloud init --skip-diagnostics
    Network diagnostic detects and fixes local network connection issues.
    Checking network connection...done.
    Reachability Check passed.
    Network diagnostic passed (1/1 checks passed).
    You must log in to continue. Would you like to log in (Y/n)? y
    Your browser has been opened to visit:
    https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=32555940559.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=DhG6cC8mYGUhJpqQTFSpvlNtKTV0dS&access_type=offline&code_challenge=_gncpaJOULfzwjlfvyZkI9z53AojzRk-8a9dL3mRQVQ&code_challenge_method=S256
    You are logged in as: [[email protected]].
    Pick cloud project to use:
    [1] camera-triage
    [2] triage-79c7c
    [3] woven-voyage-217607
    [4] Create a new project
    Please enter numeric choice or text value (must exactly match list item): 1
    Your current project has been set to: [camera-triage].
    Not setting default zone/region (this feature makes it easier to use
    [gcloud compute] by setting an appropriate default value for the
    --zone and --region flag).
    See https://cloud.google.com/compute/docs/gcloud-compute section on how to set
    default compute region and zone manually. If you would like [gcloud init] to be
    able to do this for you the next time you run it, make sure the
    Compute Engine API is enabled for your project on the
    https://console.developers.google.com/apis page.
    Created a default .boto configuration file at [/Users/mahesh/.boto]. See this file and
    [https://cloud.google.com/storage/docs/gsutil/commands/config] for more
    information about configuring Google Cloud Storage.
    Your Google Cloud SDK is configured and ready to use!
    * Commands that require authentication will use [email protected] by default
    * Commands will reference project `camera-triage` by default
    Run `gcloud help config` to learn how to change individual settings
    This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
    Run `gcloud topic configurations` to learn more.
    Some things to try next:
    * Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
    * Run `gcloud topic --help` to learn about advanced features of the SDK like arg files and output formatting
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil listingDid you mean this?
    list
    CommandException: Invalid command "listing".
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil list
    gs://camera-triage.appspot.com/
    gs://staging.camera-triage.appspot.com/
    mahesh@Maheshs-MacBook-Air-M1 firebase_storage % /Users/mahesh/Downloads/google-cloud-sdk/bin/gsutil cors set cors.json gs://camera-triage.appspot.com
    Setting CORS on gs://camera-triage.appspot.com/...
    ```
  30. maheshj01 renamed this gist Jan 4, 2022. 1 changed file with 46 additions and 2 deletions.
    48 changes: 46 additions & 2 deletions firebasehosting.md → firebase.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,15 @@
    1. install npm cli
    #### Table of Contents

    1. *Deploying flutter webapp using Firebase Hosting*
    2. *Set Firebase messaging notification icon*



    ### 1. Deploying flutter webapp using Firebase Hosting

    1. install npm cli
    2. Install firebase tools using npm
    3. firebase login
    3. run `firebase login`

    And then you ar ready to deploy to firebase

    @@ -134,4 +143,39 @@ i hosting[vocabhub]: releasing new version...
    Project Console: https://console.firebase.google.com/project/vocabhub-34c7f/overview
    Hosting URL: https://vocabhub.web.app
    ```


    ### 2.Set Firebase messaging Notification icon in Android app

    originally posted here https://github.com/flutter/flutter/issues/17941#issuecomment-412242466

    ```xml
    <application
    android:name="io.flutter.app.FlutterApplication"
    android:label="When Coin"
    android:icon="@mipmap/ic_launcher">
    <meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@mipmap/ic_notification" />
    <activity
    android:name=".MainActivity"
    android:launchMode="singleTop"
    android:theme="@style/LaunchTheme"
    android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
    android:hardwareAccelerated="true"
    android:windowSoftInputMode="adjustResize">
    <!-- This keeps the window background of the activity showing
    until Flutter renders its first frame. It can be removed if
    there is no splash screen (such as the default splash screen
    defined in @style/LaunchTheme). -->
    <meta-data
    android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
    android:value="true" />
    <intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
    </activity>
    </application>
    ```