संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
FCM HTTP v1 API और सूचना कंपोज़र, दोनों ही डिलीवरी के बाद डिवाइस पर इमेज डाउनलोड करने के लिए, डिसप्ले नोटिफ़िकेशन के पेलोड में इमेज के लिंक भेजने की सुविधा देते हैं.
सूचनाओं के लिए इस्तेमाल की जाने वाली इमेज का साइज़ 1 एमबी से ज़्यादा नहीं होना चाहिए. इसके अलावा, इन इमेज पर Android के इमेज फ़ॉर्मैट से जुड़े नियम लागू होते हैं.
अनुरोध भेजने की सुविधा बनाना
सूचना भेजने के अनुरोध में, AndroidConfig का यह विकल्प सेट करें:
notification.image जिसमें इमेज का यूआरएल शामिल हो
नीचे दिए गए उदाहरण में, सभी प्लैटफ़ॉर्म पर सूचना का एक सामान्य टाइटल भेजने का अनुरोध किया गया है. हालांकि, इसमें एक इमेज भी भेजी गई है. यहां उपयोगकर्ता के डिवाइस पर दिखने वाले विज़ुअल इफ़ेक्ट की अनुमानित जानकारी दी गई है:
Node.js
consttopicName='industry-tech';constmessage={notification:{title:'Sparky says hello!'},android:{notification:{imageUrl:'https://foo.bar.pizza-monster.png'}},apns:{payload:{aps:{'mutable-content':1}},fcm_options:{image:'https://foo.bar.pizza-monster.png'}},webpush:{headers:{image:'https://foo.bar.pizza-monster.png'}},topic:topicName,};getMessaging().send(message).then((response)=>{// Response is a message ID string.console.log('Successfully sent message:',response);}).catch((error)=>{console.log('Error sending message:',error);});
मैसेज बॉडी में, प्लैटफ़ॉर्म के हिसाब से उपलब्ध ब्लॉक में मौजूद कुंजियों के बारे में पूरी जानकारी के लिए, HTTP v1 का रेफ़रंस दस्तावेज़ देखें.
notification को दिखाए गए तरीके से सेट करने पर, यह अनुरोध भेजने की सुविधा चालू करता है. इससे, अनुरोध पाने वाला क्लाइंट, पेलोड में डिलीवर की गई इमेज को मैनेज कर पाता है.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-09-06 (UTC) को अपडेट किया गया."],[],[],null,["The FCM HTTP v1 API and the\n[Notifications composer](//console.firebase.google.com/project/_/notification)\nsupport sending image links in the payload of a display\nnotification, for image download to the device after delivery.\nImages for notifications are limited to 1MB in size, and otherwise are\nrestricted by native Android\n[image support](https://developer.android.com/guide/topics/media/media-formats#image-formats).\n\nBuild the send request\n\nIn your notification send request, set the following [AndroidConfig](/docs/reference/fcm/rest/v1/projects.messages#AndroidConfig)\noption:\n\n- `notification.image` containing the image URL\n\nThe following example send request sends a common notification title to all platforms, but it also sends an image. Here's an approximation of the\nvisual effect on a user's device:\n\nNode.js \n\n const topicName = 'industry-tech';\n\n const message = {\n notification: {\n title: 'Sparky says hello!'\n },\n android: {\n notification: {\n imageUrl: 'https://foo.bar.pizza-monster.png'\n }\n },\n apns: {\n payload: {\n aps: {\n 'mutable-content': 1\n }\n },\n fcm_options: {\n image: 'https://foo.bar.pizza-monster.png'\n }\n },\n webpush: {\n headers: {\n image: 'https://foo.bar.pizza-monster.png'\n }\n },\n topic: topicName,\n };\n\n getMessaging().send(message)\n .then((response) =\u003e {\n // Response is a message ID string.\n console.log('Successfully sent message:', response);\n })\n .catch((error) =\u003e {\n console.log('Error sending message:', error);\n });\n\nREST \n\n POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send HTTP/1.1\n\n Content-Type: application/json\n Authorization: Bearer ya29.ElqKBGN2Ri_Uz...HnS_uNreA\n {\n \"message\":{\n \"topic\":\"industry-tech\",\n \"notification\":{\n \"title\":\"Sparky says hello!\",\n },\n \"android\":{\n \"notification\":{\n \"image\":\"https://foo.bar/pizza-monster.png\"\n }\n },\n \"apns\":{\n \"payload\":{\n \"aps\":{\n \"mutable-content\":1\n }\n },\n \"fcm_options\": {\n \"image\":\"https://foo.bar/pizza-monster.png\"\n }\n },\n \"webpush\":{\n \"headers\":{\n \"image\":\"https://foo.bar/pizza-monster.png\"\n }\n }\n }\n }\n\nSee the\n[HTTP v1 reference documentation](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages)\nfor complete detail on the keys available in platform-specific blocks in the\nmessage body.\n\nWith `notification` set as shown, this send request enables the receiving client\nto handle the image delivered in the payload."]]