{"id":7503,"date":"2022-09-09T02:16:38","date_gmt":"2022-09-08T20:46:38","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/"},"modified":"2022-09-09T02:16:38","modified_gmt":"2022-09-08T20:46:38","slug":"solved-emails-in-c2dm","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/","title":{"rendered":"[Solved] Emails in C2DM?"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-6747941\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"6747941\" data-parentid=\"6725570\" data-score=\"1\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>It seems that you are under the wrong impression that the Role Email account which is created to identify the application using the C2DM service should be changed in the registration intent.<\/p>\n<p>You must have that role email the same as the one on the server otherwise Google will not be able to identify your application as sender\/receiver of this c2dm message.<br \/>\nSample Registration Intent:<\/p>\n<pre><code>    Intent registrationIntent = new Intent(\n            C2DMessaging.REQUEST_REGISTRATION_INTENT);\n    registrationIntent.setPackage(C2DMessaging.GSF_PACKAGE);\n    registrationIntent.putExtra(\n            C2DMessaging.EXTRA_APPLICATION_PENDING_INTENT,\n            PendingIntent.getBroadcast(context, 0, new Intent(), 0));\n    registrationIntent.putExtra(C2DMessaging.EXTRA_SENDER, senderId);\n    context.startService(registrationIntent);\n<\/code><\/pre>\n<p>The Variable senderId here should hold the role account you created and signed up for C2DM on the google <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/code.google.com\/android\/c2dm\/signup.html\">C2DM signup Page<\/a><\/p>\n<p>This same email is used to obtain the Authentication token from google servers which is used to send C2DM messages later<\/p>\n<p>Sample server code to get an authentication key:<\/p>\n<pre><code>        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);\n        nameValuePairs.add(new BasicNameValuePair(\"Email\",\n                senderId));\n        nameValuePairs.add(new BasicNameValuePair(\"Passwd\", \"testpassword\"));\n        nameValuePairs.add(new BasicNameValuePair(\"accountType\", \"GOOGLE\"));\n        nameValuePairs.add(new BasicNameValuePair(\"source\",\n                \"Fleet Tracker Pro\"));\n        nameValuePairs.add(new BasicNameValuePair(\"service\", \"ac2dm\"));\n        post.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n        HttpResponse response = client.execute(post);\n        BufferedReader rd = new BufferedReader(new InputStreamReader(\n                response.getEntity().getContent()));\n\n        String line = \"\";\n        while ((line = rd.readLine()) != null) {\n            if (line.startsWith(\"Auth=\")) {\n                String auth = line.substring(5);\n                System.out.println(\"Auth token = \" + auth);\n                return auth;\n            }\n        }\n<\/code><\/pre>\n<p>notice the variable senderId this should also hold the role account you created and signed up for C2DM on the google <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/code.google.com\/android\/c2dm\/signup.html\">C2DM signup Page<\/a><br \/>\nany other email can be changed to whatever you like, but these to emails have to remain identical<\/p>\n<p>here is the definition from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"http:\/\/code.google.com\/android\/c2dm\/#arch\">google C2DM page<\/a> at google code:<\/p>\n<blockquote>\n<p>Sender ID An email account associated with the application&#8217;s<br \/>\n  developer. The sender ID is used in the registration process to<br \/>\n  identify a Android application that is permitted to send messages to<br \/>\n  the device. This ID is typically role-based rather than being a<br \/>\n  personal account\u2014- for example, my-app@gmail.com.<\/p>\n<\/blockquote>\n<p>I hope i helped have a nice day.<\/p>\n<p>would have been nice if you included code snippets or more information about the emails you are talking about.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\"><\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Emails in C2DM? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] It seems that you are under the wrong impression that the Role Email account which is created to identify the application using the C2DM service should be changed in the registration intent. You must have that role email the same as the one on the server otherwise Google will not be able to identify &#8230; <a title=\"[Solved] Emails in C2DM?\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\" aria-label=\"More on [Solved] Emails in C2DM?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[452,2084],"class_list":["post-7503","post","type-post","status-publish","format-standard","hentry","category-solved","tag-android","tag-android-c2dm"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Emails in C2DM? - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Emails in C2DM? - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] It seems that you are under the wrong impression that the Role Email account which is created to identify the application using the C2DM service should be changed in the registration intent. You must have that role email the same as the one on the server otherwise Google will not be able to identify ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-08T20:46:38+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Emails in C2DM?\",\"datePublished\":\"2022-09-08T20:46:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\"},\"wordCount\":268,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"android\",\"android-c2dm\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\",\"name\":\"[Solved] Emails in C2DM? - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-09-08T20:46:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Emails in C2DM?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Emails in C2DM? - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Emails in C2DM? - JassWeb","og_description":"[ad_1] It seems that you are under the wrong impression that the Role Email account which is created to identify the application using the C2DM service should be changed in the registration intent. You must have that role email the same as the one on the server otherwise Google will not be able to identify ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/","og_site_name":"JassWeb","article_published_time":"2022-09-08T20:46:38+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Emails in C2DM?","datePublished":"2022-09-08T20:46:38+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/"},"wordCount":268,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["android","android-c2dm"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/","url":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/","name":"[Solved] Emails in C2DM? - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-08T20:46:38+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-emails-in-c2dm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Emails in C2DM?"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/7503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=7503"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/7503\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=7503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=7503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=7503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}