{"id":323,"date":"2016-11-15T15:11:45","date_gmt":"2016-11-15T09:41:45","guid":{"rendered":"https:\/\/pushalert.co\/blog\/?p=323"},"modified":"2017-02-24T14:51:10","modified_gmt":"2017-02-24T09:21:10","slug":"how-to-get-gcm-api-key-project-number","status":"publish","type":"post","link":"https:\/\/pushalert.co\/blog\/how-to-get-gcm-api-key-project-number\/","title":{"rendered":"How to get Project Number and API Key for GCM?"},"content":{"rendered":"<p style=\"background: #fcd04b; padding: 10px 15px; border-radius: 5px; font-size: 16px;\"><strong>Update:\u00a0<\/strong>Google has now started using Firebase Cloud Messaging for Web Push, this post is now outdated. You can see how to get the FCM ID and key from our <strong><a href=\"https:\/\/pushalert.co\/documentation\/firebase-config-web-push\">documentation here<\/a><\/strong>. However, if you had used your own GCM configuration with us, there is no need to change that, it is still applicable.<\/p>\n<p>Chrome currently uses Google Cloud Messaging (GCM) for web push notifications. By default\u00a0we use our own GCM account for notifications, it means your subscribers will be\u00a0associated with our account.\u00a0If you don&#8217;t have your own GCM account to work with, you won&#8217;t be able to export your subscriber list.<\/p>\n<p>To get a\u00a0GCM (Google Cloud Messaging) API key, you have to follow these steps:<\/p>\n<h2>Create a project<\/h2>\n<ol>\n<li>First go to the\u00a0<a href=\"https:\/\/console.developers.google.com\/\">Google Developer Console<\/a>. Then you have to accept the terms of service. Once done, in the top left you will see &#8220;Project&#8221; option. Click on it and select &#8220;Create project&#8221;.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-603 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu.png\" width=\"649\" height=\"260\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu.png 649w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu-300x120.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-new-project-menu-549x220.png 549w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/li>\n<li>A dialog will appear, mention the Project name in the text box and click on &#8220;Create&#8221;. Be patient, this will take some time.<a href=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/07\/Project-Name.png\" target=\"_blank\"><br \/>\n<\/a><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-605 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name.png\" width=\"637\" height=\"302\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name.png 637w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name-300x142.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/project-name-464x220.png 464w\" sizes=\"(max-width: 637px) 100vw, 637px\" \/><\/li>\n<li>Now, to get the Project Number, click on the &#8220;3-dots menu&#8221; at the top right and choose &#8220;Project settings&#8221;. A page will open up, just copy the Project Number and paste it into the PushAlert Dashboard.<a href=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/07\/gcm-project-id.png\" target=\"_blank\"><br \/>\n<\/a><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-606 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id.png\" width=\"549\" height=\"340\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id.png 549w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id-300x186.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-project-id-355x220.png 355w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-607 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info.png\" width=\"549\" height=\"268\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info.png 549w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info-300x146.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/GCM-Project-ID-Info-451x220.png 451w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>GCM API Key<\/h2>\n<ol>\n<li>Now, head over to the sidebar, click on the overview menu and select &#8220;API Manager&#8221;. Then click on Dashboard, followed by &#8220;Enable API&#8221; on the right.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-608\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api.png\" alt=\"gcm-enable-api\" width=\"639\" height=\"300\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api.png 639w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api-300x141.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-enable-api-469x220.png 469w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/li>\n<li>Once done, search for &#8220;google cloud messaging&#8221; in the text box and click on it. You will be redirected to Google Cloud Messaging\u00a0overview page, and then just click on\u00a0&#8220;Enable&#8221; at the top.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-609 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging.png\" width=\"782\" height=\"392\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging.png 782w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-300x150.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-768x385.png 768w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/Choose-Google-Cloud-Messaging-439x220.png 439w\" sizes=\"(max-width: 782px) 100vw, 782px\" \/><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-611 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm.png\" width=\"469\" height=\"309\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm.png 469w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm-300x198.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/enable-gcm-334x220.png 334w\" sizes=\"(max-width: 469px) 100vw, 469px\" \/><\/li>\n<li>Go to &#8220;Credentials&#8221; tab available in\u00a0left sidebar. Now you will get one of the two options, either &#8220;Add credentials to your project&#8221; where you have to click on API key in the first step or &#8220;Create credentials&#8221;, where you have to select\u00a0API key option from a drop down menu.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-612 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials.png\" width=\"493\" height=\"256\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials.png 493w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials-300x156.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/choose-credentials-424x220.png 424w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-613 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1.png\" width=\"538\" height=\"500\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1.png 538w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1-300x279.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/create-credential-1-237x220.png 237w\" sizes=\"(max-width: 538px) 100vw, 538px\" \/><\/li>\n<li>You will get the API Key directly with no restrictions applied, and if you are given the option to choose any restrictions just select &#8220;None&#8221;, type in a name and then press the &#8220;Create&#8221; button.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-615 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name.png\" width=\"632\" height=\"484\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name.png 632w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name-300x230.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/api-key-name-287x220.png 287w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/li>\n<li>Copy and paste the API key into PushAlert dashboard.<a href=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/07\/gcm-api-key-copy.jpg\" target=\"_blank\"><br \/>\n<\/a><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-617 size-full\" src=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key.png\" width=\"590\" height=\"309\" srcset=\"https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key.png 590w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key-300x157.png 300w, https:\/\/pushalert.co\/blog\/wp-content\/uploads\/2016\/11\/gcm-api-key-420x220.png 420w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/li>\n<\/ol>\n<p>That&#8217;s it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update:\u00a0Google has now started using Firebase Cloud Messaging for Web Push, this post is now outdated. You can see how to get the FCM ID and key from our documentation here. However, if you had used your own GCM configuration with us, there is no need to change that, it is still applicable. Chrome currently [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":603,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[36],"tags":[25,24,27,29,28],"_links":{"self":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts\/323"}],"collection":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/comments?post=323"}],"version-history":[{"count":34,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts\/323\/revisions"}],"predecessor-version":[{"id":890,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/posts\/323\/revisions\/890"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/media\/603"}],"wp:attachment":[{"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/media?parent=323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/categories?post=323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pushalert.co\/blog\/wp-json\/wp\/v2\/tags?post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}