title: How to mock firebase cloud messaging under android with firebase-server
body: <p>I'm currently trying to <strong>mock firebase cloud messaging service</strong> for an Android unit test and I'm using <a href="https://github.com/urish/firebase-server" rel="nofollow noreferrer">firebase-server</a>, a web-socket emulator for firebase. </p>
  
  <p>Normally, the AndroidStudio tool generates a <code>json</code> file based on your firebase client account info. The problem here is that I'm using firebase-server and I'm not sure what info I should change in the <code>json</code>, I've changed my API key for <code>1</code> as mentioned in <a href="https://github.com/urish/firebase-server/issues/113#issuecomment-350171600" rel="nofollow noreferrer">a firebase-server issue</a>, but what should I do for app info and project info?</p>
  
  <p>Here's an example of my <code>json</code> for <code>google-services</code>:</p>
  
  <pre class="lang-javascript prettyprint-override"><code>{
    "project_info": {
      "project_number": "************",
      "firebase_url": "************",
      "project_id": "***********",
      "storage_bucket": "***********"
    },
    "client": [
      {
        "client_info": {
          "mobilesdk_app_id": "**********",
          "android_client_info": {
            "package_name": "ca.project.my"
          }
        },
        "oauth_client": [
          {
            "client_id": "***********",
            "client_type": 1,
            "android_info": {
              "package_name": "app.ca.project.my",
              "certificate_hash": "***********"
            }
          },
          {
            "client_id": "***********",
            "client_type": 3
          }
        ],
        "api_key": [
          {
            "current_key": "1"
          }
        ],
        "services": {
          "analytics_service": {
            "status": 1
          },
          "appinvite_service": {
            "status": 2,
            "other_platform_oauth_client": [
              {
                "client_id": "************",
                "client_type": 2,
                "ios_info": {
                  "bundle_id": "app.ca.project.my",
                  "app_store_id": "********"
                }
              },
              {
                "client_id": "************",
                "client_type": 3
              }
            ]
          },
          "ads_service": {
            "status": 2
          }
        }
      }
    ],
    "configuration_version": "1"
  }
  </code></pre>
  
  <p>How do I connect my app to the firebase mock, or how does it work.</p>
  
  <p>I'm using a global installation of <code>firebase-server</code> to start the <code>firebase-server</code></p>
  
  <pre class="lang-bash prettyprint-override"><code>$ npm install firebase-server -g
  $ firebase-server
  </code></pre>