Apple प्लैटफ़ॉर्म पर मौजूद एक से ज़्यादा डिवाइसों पर मैसेज भेजना

किसी मैसेज को कई डिवाइसों पर टारगेट करने के लिए, विषय के मैसेज का इस्तेमाल करें. इस सुविधा की मदद से, किसी खास विषय के लिए ऑप्ट-इन किए गए अलग-अलग डिवाइसों पर मैसेज भेजा जा सकता है.

यह ट्यूटोरियल FCM के लिए एडमिन SDK या REST API का इस्तेमाल करके आपके ऐप्लिकेशन सर्वर से विषय के मैसेज भेजने और उन्हें Apple ऐप्लिकेशन में पाने और मैनेज करने पर फ़ोकस करता है. इस पेज पर इसे पाने के सभी चरणों की सूची दी गई है, जैसे कि सेटअप से लेकर पुष्टि की प्रोसेस तक. अगर आपने FCM के लिए Apple क्लाइंट ऐप्लिकेशन सेट अप किया है या अपना पहला मैसेज भेजने की प्रोसेस पूरी की है, तो इसमें आपके पहले से पूरे किए गए चरण शामिल हो सकते हैं.

अपने Apple प्रोजेक्ट में Firebase जोड़ना

इस सेक्शन में, अपने ऐप्लिकेशन के लिए पहले से ही Firebase की अन्य सुविधाएं चालू करने पर पूरे किए जा सकने वाले टास्क के बारे में जानकारी दी गई है. खास तौर पर, FCM के लिए, आपको एपीएन की पुष्टि करने वाली कुंजी अपलोड करनी होगी और रिमोट से सूचनाएं पाने के लिए रजिस्टर करना होगा.

ज़रूरी शर्तें

  • इन्हें इंस्टॉल करें:

    • Xcode 14.1 या उसके बाद का वर्शन
  • पक्का करें कि आपका प्रोजेक्ट इन ज़रूरी शर्तों को पूरा करता हो:

    • आपके प्रोजेक्ट को प्लैटफ़ॉर्म के इन वर्शन या इसके बाद के वर्शन को टारगेट करना होगा:
      • iOS 11
      • macOS 10.13 वर्शन
      • TVOS 12
      • WatchOS 6
  • अपना ऐप्लिकेशन चलाने के लिए, एक Apple डिवाइस सेट अप करें और ये काम पूरे करें:

    • अपने Apple Developer खाते के लिए, Apple पुश नोटिफ़िकेशन से पुष्टि करने वाली कुंजी पाएं.
    • ऐप्लिकेशन > क्षमताएं में जाकर, XCode में पुश नोटिफ़िकेशन चालू करें.

अगर आपके पास पहले से कोई Xcode प्रोजेक्ट नहीं है और आपको सिर्फ़ Firebase प्रॉडक्ट आज़माना है, तो हमारे क्विकस्टार्ट सैंपल में से कोई एक डाउनलोड किया जा सकता है.

Firebase प्रोजेक्ट बनाना

अपने Apple ऐप्लिकेशन में Firebase जोड़ने से पहले, आपको अपने ऐप्लिकेशन से कनेक्ट करने के लिए एक Firebase प्रोजेक्ट बनाना होगा. Firebase प्रोजेक्ट के बारे में ज़्यादा जानने के लिए, Firebase प्रोजेक्ट के बारे में जानकारी पर जाएं.

अपने ऐप्लिकेशन को Firebase के साथ रजिस्टर करना

Apple ऐप्लिकेशन में Firebase का इस्तेमाल करने के लिए, आपको अपने ऐप्लिकेशन को Firebase प्रोजेक्ट के साथ रजिस्टर करना होगा. ऐप्लिकेशन को रजिस्टर करने को अक्सर आपके प्रोजेक्ट में "ऐप्लिकेशन जोड़ना" कहा जाता है.

  1. Firebase कंसोल पर जाएं.

  2. सेटअप वर्कफ़्लो लॉन्च करने के लिए, प्रोजेक्ट की खास जानकारी देने वाले पेज के बीच में मौजूद, iOS+ आइकॉन पर क्लिक करें.

    अगर आपने पहले ही अपने Firebase प्रोजेक्ट में कोई ऐप्लिकेशन जोड़ लिया है, तो प्लैटफ़ॉर्म के विकल्प देखने के लिए, ऐप्लिकेशन जोड़ें पर क्लिक करें.

  3. बंडल आईडी फ़ील्ड में अपने ऐप्लिकेशन का बंडल आईडी डालें.

  4. (ज़रूरी नहीं) ऐप्लिकेशन की अन्य जानकारी डालें: ऐप्लिकेशन का कोई दूसरा नाम और App Store का आईडी.

  5. ऐप्लिकेशन रजिस्टर करें पर क्लिक करें.

Firebase कॉन्फ़िगरेशन फ़ाइल जोड़ना

  1. अपनी Firebase Apple प्लैटफ़ॉर्म कॉन्फ़िगरेशन फ़ाइल (GoogleService-Info.plist) पाने के लिए, GoogleService-Info.plist डाउनलोड करें पर क्लिक करें.

  2. अपनी कॉन्फ़िगरेशन फ़ाइल को Xcode प्रोजेक्ट के रूट में ले जाएं. अगर कहा जाए, तो सभी टारगेट में कॉन्फ़िगरेशन फ़ाइल जोड़ने का विकल्प चुनें.

अगर आपके प्रोजेक्ट में एक से ज़्यादा बंडल आईडी हैं, तो आपको हर बंडल आईडी को Firebase कंसोल में रजिस्टर किए गए ऐप्लिकेशन से जोड़ना होगा. ऐसा करने से, हर ऐप्लिकेशन की अपनी GoogleService-Info.plist फ़ाइल हो सकेगी.

अपने ऐप्लिकेशन में Firebase SDK टूल जोड़ना

Firebase डिपेंडेंसी इंस्टॉल और मैनेज करने के लिए, Swift पैकेज मैनेजर का इस्तेमाल करें.

  1. Xcode में, अपना ऐप्लिकेशन प्रोजेक्ट खोलने के लिए, फ़ाइल > पैकेज जोड़ें पर जाएं.
  2. जब कहा जाए, तब Firebase Apple प्लैटफ़ॉर्म SDK टूल का रिपॉज़िटरी जोड़ें:
  3.   https://github.com/firebase/firebase-ios-sdk.git
  4. Firebase क्लाउड से मैसेज लाइब्रेरी चुनें.
  5. अपने टारगेट की बिल्ड सेटिंग के अन्य लिंकर फ़्लैग सेक्शन में -ObjC फ़्लैग जोड़ें.
  6. Firebase क्लाउड से मैसेज का बेहतर अनुभव पाने के लिए, हमारा सुझाव है कि आप अपने Firebase प्रोजेक्ट में Google Analytics चालू करें. साथ ही, अपने ऐप्लिकेशन में Google Analytics के लिए Firebase SDK टूल जोड़ें. आपके पास IDFA कलेक्शन के बिना या IDFA कलेक्शन वाली लाइब्रेरी में से किसी एक को चुनने का विकल्प होता है.
  7. यह काम पूरा होने के बाद, Xcode बैकग्राउंड में आपकी डिपेंडेंसी को अपने-आप रिज़ॉल्व और डाउनलोड करना शुरू कर देगा.

अपने एपीएन की पुष्टि करने वाली कुंजी अपलोड करें

अपनी एपीएन की पुष्टि करने वाली कुंजी को Firebase पर अपलोड करें. अगर आपके पास पहले से एपीएन की पुष्टि करने वाली कुंजी नहीं है, तो Apple Developer Member Center में जाकर एक कुंजी बनाएं.

  1. Firebase कंसोल में, अपने प्रोजेक्ट में गियर आइकॉन चुनें, प्रोजेक्ट सेटिंग चुनें, और फिर क्लाउड से मैसेज टैब चुनें.

  2. iOS ऐप्लिकेशन कॉन्फ़िगरेशन में, APNs पुष्टि कुंजी में अपलोड करें बटन पर क्लिक करें.

  3. उस जगह ब्राउज़ करें जहां आपने अपनी कुंजी सेव की है. इसके बाद, उसे चुनें और खोलें पर क्लिक करें. कुंजी के लिए कुंजी आईडी जोड़ें ( Apple Developer के सदस्य केंद्र में उपलब्ध) और अपलोड करें पर क्लिक करें.

अपने ऐप्लिकेशन में Firebase शुरू करें

आपको अपने ऐप्लिकेशन में Firebase शुरू करने वाला कोड जोड़ना होगा. Firebase मॉड्यूल इंपोर्ट करें और शेयर किए गए इंस्टेंस को इस तरह से कॉन्फ़िगर करें:

  1. अपने UIApplicationDelegate में FirebaseCore मॉड्यूल को इंपोर्ट करें. साथ ही, ऐसे सभी Firebase मॉड्यूल को इंपोर्ट करें जिनका इस्तेमाल आपके ऐप्लिकेशन का ऐक्सेस मैनेज करता है. उदाहरण के लिए, Cloud Firestore और पुष्टि करने की सुविधा का इस्तेमाल करने के लिए:

    स्विफ़्टयूआई

    import SwiftUI
    import FirebaseCore
    import FirebaseFirestore
    import FirebaseAuth
    // ...
          

    Swift

    import FirebaseCore
    import FirebaseFirestore
    import FirebaseAuth
    // ...
          

    Objective-C

    @import FirebaseCore;
    @import FirebaseFirestore;
    @import FirebaseAuth;
    // ...
          
  2. अपने ऐप्लिकेशन का ऐक्सेस देने वाले व्यक्ति के application(_:didFinishLaunchingWithOptions:) तरीके में, FirebaseApp शेयर किए गए इंस्टेंस को कॉन्फ़िगर करें:

    स्विफ़्टयूआई

    // Use Firebase library to configure APIs
    FirebaseApp.configure()

    Swift

    // Use Firebase library to configure APIs
    FirebaseApp.configure()

    Objective-C

    // Use Firebase library to configure APIs
    [FIRApp configure];
  3. अगर SwiftUI का इस्तेमाल किया जा रहा है, तो आपको ऐप्लिकेशन का ऐक्सेस देना होगा और उसे UIApplicationDelegateAdaptor या NSApplicationDelegateAdaptor की मदद से अपने App स्ट्रक्चर में अटैच करना होगा. आपको ऐप्लिकेशन सौंपने की सुविधा को स्वाइप करने की सुविधा भी बंद करनी होगी. ज़्यादा जानकारी के लिए, SwiftUI के निर्देश देखें.

    स्विफ़्टयूआई

    @main
    struct YourApp: App {
      // register app delegate for Firebase setup
      @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
    
      var body: some Scene {
        WindowGroup {
          NavigationView {
            ContentView()
          }
        }
      }
    }
          

रिमोट नोटिफ़िकेशन के लिए रजिस्टर करें

रिमोट नोटिफ़िकेशन के लिए अपने ऐप्लिकेशन को रजिस्टर करें. भले ही, ऐप्लिकेशन के चालू होने पर या ऐप्लिकेशन के फ़्लो में अपनी पसंद की जगह पर उसे रजिस्टर किया जा रहा हो. registerForRemoteNotifications को कॉल करें, जैसा कि इमेज में दिखाया गया है:

Swift


UNUserNotificationCenter.current().delegate = self

let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
  options: authOptions,
  completionHandler: { _, _ in }
)

application.registerForRemoteNotifications()

Objective-C


[UNUserNotificationCenter currentNotificationCenter].delegate = self;
UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert |
    UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
[[UNUserNotificationCenter currentNotificationCenter]
    requestAuthorizationWithOptions:authOptions
    completionHandler:^(BOOL granted, NSError * _Nullable error) {
      // ...
    }];

[application registerForRemoteNotifications];

किसी विषय के लिए, क्लाइंट ऐप्लिकेशन की सदस्यता लेना

क्लाइंट ऐप्लिकेशन किसी भी मौजूदा विषय की सदस्यता ले सकते हैं या वे एक नया विषय बना सकते हैं. जब कोई क्लाइंट ऐप्लिकेशन किसी नए विषय नाम (जो आपके Firebase प्रोजेक्ट के लिए पहले से मौजूद नहीं है) की सदस्यता लेता है, तो FCM में उस नाम का एक नया विषय बनाया जाता है और कोई भी क्लाइंट बाद में इसकी सदस्यता ले सकता है.

किसी विषय की सदस्यता लेने के लिए, अपने ऐप्लिकेशन के मुख्य थ्रेड से सदस्यता के तरीके को कॉल करें (FCM, थ्रेड-सुरक्षित नहीं है). अगर सदस्यता का अनुरोध शुरुआत में पूरा नहीं होता, तो FCM अपने-आप फिर से कोशिश करता है. ऐसे मामलों में जहां सदस्यता पूरी नहीं हो सकी, सदस्यता लेने पर गड़बड़ी का मैसेज मिलता है. इस गड़बड़ी को पूरा करने वाले हैंडलर में देखा जा सकता है. इसका उदाहरण नीचे दिया गया है:

Swift

Messaging.messaging().subscribe(toTopic: "weather") { error in
  print("Subscribed to weather topic")
}

Objective-C

[[FIRMessaging messaging] subscribeToTopic:@"weather"
                                completion:^(NSError * _Nullable error) {
  NSLog(@"Subscribed to weather topic");
}];

यह कॉल FCM बैकएंड को एक एसिंक्रोनस अनुरोध करता है और दिए गए विषय की क्लाइंट सदस्यता लेता है. subscribeToTopic:topic को कॉल करने से पहले, पक्का करें कि क्लाइंट के ऐप्लिकेशन इंस्टेंस को कॉलबैक didReceiveRegistrationToken के ज़रिए रजिस्ट्रेशन टोकन पहले ही मिल चुका हो.

हर बार ऐप्लिकेशन के शुरू होने पर, FCM यह पक्का करता है कि अनुरोध किए गए सभी विषयों की सदस्यता ले ली गई हो. सदस्यता छोड़ने के लिए, unsubscribeFromTopic:topic को कॉल करें और FCM बैकग्राउंड में इस विषय की सदस्यता छोड़ता है.

विषय के मैसेज पाएं और मैनेज करें

FCM विषय से जुड़े मैसेज उसी तरह डिलीवर करता है जैसे दूसरे डाउनस्ट्रीम मैसेज डिलीवर करता है.

application(_:didReceiveRemoteNotification:fetchCompletionHandler:) को इस तरह से लागू करें:

Swift

func application(_ application: UIApplication,
                 didReceiveRemoteNotification userInfo: [AnyHashable: Any]) async
  -> UIBackgroundFetchResult {
  // If you are receiving a notification message while your app is in the background,
  // this callback will not be fired till the user taps on the notification launching the application.
  // TODO: Handle data of notification

  // With swizzling disabled you must let Messaging know about the message, for Analytics
  // Messaging.messaging().appDidReceiveMessage(userInfo)

  // Print message ID.
  if let messageID = userInfo[gcmMessageIDKey] {
    print("Message ID: \(messageID)")
  }

  // Print full message.
  print(userInfo)

  return UIBackgroundFetchResult.newData
}

Objective-C

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
  // If you are receiving a notification message while your app is in the background,
  // this callback will not be fired till the user taps on the notification launching the application.
  // TODO: Handle data of notification

  // With swizzling disabled you must let Messaging know about the message, for Analytics
  // [[FIRMessaging messaging] appDidReceiveMessage:userInfo];

  // ...

  // Print full message.
  NSLog(@"%@", userInfo);

  completionHandler(UIBackgroundFetchResultNewData);
}

मैसेज भेजने के अनुरोध बनाएं

विषय बनाने के बाद, क्लाइंट-साइड पर विषय के लिए क्लाइंट ऐप्लिकेशन इंस्टेंस की सदस्यता लेकर या सर्वर एपीआई की मदद से, उस विषय पर मैसेज भेजे जा सकते हैं. अगर आप पहली बार FCM के लिए अनुरोध भेज रहे हैं, तो बैकग्राउंड और सेटअप की ज़रूरी जानकारी के लिए अपने सर्वर एनवायरमेंट और FCM की गाइड देखें.

बैकएंड पर, भेजने के तरीके में, विषय का पसंदीदा नाम बताएं, जैसा कि यहां दिखाया गया है:

Node.js के लिए

// The topic name can be optionally prefixed with "/topics/".
const topic = 'highScores';

const message = {
  data: {
    score: '850',
    time: '2:45'
  },
  topic: topic
};

// Send a message to devices subscribed to the provided topic.
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);
  });

Java

// The topic name can be optionally prefixed with "/topics/".
String topic = "highScores";

// See documentation on defining a message payload.
Message message = Message.builder()
    .putData("score", "850")
    .putData("time", "2:45")
    .setTopic(topic)
    .build();

// Send a message to the devices subscribed to the provided topic.
String response = FirebaseMessaging.getInstance().send(message);
// Response is a message ID string.
System.out.println("Successfully sent message: " + response);

Python

# The topic name can be optionally prefixed with "/topics/".
topic = 'highScores'

# See documentation on defining a message payload.
message = messaging.Message(
    data={
        'score': '850',
        'time': '2:45',
    },
    topic=topic,
)

# Send a message to the devices subscribed to the provided topic.
response = messaging.send(message)
# Response is a message ID string.
print('Successfully sent message:', response)

शुरू करें

// The topic name can be optionally prefixed with "/topics/".
topic := "highScores"

// See documentation on defining a message payload.
message := &messaging.Message{
	Data: map[string]string{
		"score": "850",
		"time":  "2:45",
	},
	Topic: topic,
}

// Send a message to the devices subscribed to the provided topic.
response, err := client.Send(ctx, message)
if err != nil {
	log.Fatalln(err)
}
// Response is a message ID string.
fmt.Println("Successfully sent message:", response)

C#

// The topic name can be optionally prefixed with "/topics/".
var topic = "highScores";

// See documentation on defining a message payload.
var message = new Message()
{
    Data = new Dictionary<string, string>()
    {
        { "score", "850" },
        { "time", "2:45" },
    },
    Topic = topic,
};

// Send a message to the devices subscribed to the provided topic.
string response = await FirebaseMessaging.DefaultInstance.SendAsync(message);
// Response is a message ID string.
Console.WriteLine("Successfully sent message: " + response);

REST

POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send HTTP/1.1

Content-Type: application/json
Authorization: Bearer ya29.ElqKBGN2Ri_Uz...HnS_uNreA
{
  "message":{
    "topic" : "foo-bar",
    "notification" : {
      "body" : "This is a Firebase Cloud Messaging Topic Message!",
      "title" : "FCM Message"
      }
   }
}

cURL निर्देश:

curl -X POST -H "Authorization: Bearer ya29.ElqKBGN2Ri_Uz...HnS_uNreA" -H "Content-Type: application/json" -d '{
  "message": {
    "topic" : "foo-bar",
    "notification": {
      "body": "This is a Firebase Cloud Messaging Topic Message!",
      "title": "FCM Message"
    }
  }
}' https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send HTTP/1.1

विषयों के कॉम्बिनेशन को मैसेज भेजने के लिए, condition की जानकारी दें. यह एक बूलियन एक्सप्रेशन है, जो टारगेट किए गए विषयों के बारे में बताता है. उदाहरण के लिए, इस शर्त से उन डिवाइसों पर मैसेज भेजे जाएंगे जिन्होंने TopicA और TopicB या TopicC की सदस्यता ली है:

"'TopicA' in topics && ('TopicB' in topics || 'TopicC' in topics)"

FCM सबसे पहले ब्रैकेट में मौजूद किसी भी शर्त का आकलन करता है. इसके बाद, बाईं से दाईं ओर एक्सप्रेशन का आकलन करता है. ऊपर दिए गए एक्सप्रेशन में, किसी एक विषय की सदस्यता लेने वाले उपयोगकर्ता को मैसेज नहीं मिलता. इसी तरह, TopicA की सदस्यता न लेने वाले लोगों को भी मैसेज नहीं मिलता. इन कॉम्बिनेशन को यह कॉन्टेंट मिलता है:

  • TopicA और TopicB
  • TopicA और TopicC

कंडिशनल एक्सप्रेशन में ज़्यादा से ज़्यादा पांच विषय शामिल किए जा सकते हैं.

किसी शर्त पर भेजने के लिए:

Node.js के लिए

// Define a condition which will send to devices which are subscribed
// to either the Google stock or the tech industry topics.
const condition = '\'stock-GOOG\' in topics || \'industry-tech\' in topics';

// See documentation on defining a message payload.
const message = {
  notification: {
    title: '$FooCorp up 1.43% on the day',
    body: '$FooCorp gained 11.80 points to close at 835.67, up 1.43% on the day.'
  },
  condition: condition
};

// Send a message to devices subscribed to the combination of topics
// specified by the provided condition.
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);
  });

Java

// Define a condition which will send to devices which are subscribed
// to either the Google stock or the tech industry topics.
String condition = "'stock-GOOG' in topics || 'industry-tech' in topics";

// See documentation on defining a message payload.
Message message = Message.builder()
    .setNotification(Notification.builder()
        .setTitle("$GOOG up 1.43% on the day")
        .setBody("$GOOG gained 11.80 points to close at 835.67, up 1.43% on the day.")
        .build())
    .setCondition(condition)
    .build();

// Send a message to devices subscribed to the combination of topics
// specified by the provided condition.
String response = FirebaseMessaging.getInstance().send(message);
// Response is a message ID string.
System.out.println("Successfully sent message: " + response);

Python

# Define a condition which will send to devices which are subscribed
# to either the Google stock or the tech industry topics.
condition = "'stock-GOOG' in topics || 'industry-tech' in topics"

# See documentation on defining a message payload.
message = messaging.Message(
    notification=messaging.Notification(
        title='$GOOG up 1.43% on the day',
        body='$GOOG gained 11.80 points to close at 835.67, up 1.43% on the day.',
    ),
    condition=condition,
)

# Send a message to devices subscribed to the combination of topics
# specified by the provided condition.
response = messaging.send(message)
# Response is a message ID string.
print('Successfully sent message:', response)

शुरू करें

// Define a condition which will send to devices which are subscribed
// to either the Google stock or the tech industry topics.
condition := "'stock-GOOG' in topics || 'industry-tech' in topics"

// See documentation on defining a message payload.
message := &messaging.Message{
	Data: map[string]string{
		"score": "850",
		"time":  "2:45",
	},
	Condition: condition,
}

// Send a message to devices subscribed to the combination of topics
// specified by the provided condition.
response, err := client.Send(ctx, message)
if err != nil {
	log.Fatalln(err)
}
// Response is a message ID string.
fmt.Println("Successfully sent message:", response)

C#

// Define a condition which will send to devices which are subscribed
// to either the Google stock or the tech industry topics.
var condition = "'stock-GOOG' in topics || 'industry-tech' in topics";

// See documentation on defining a message payload.
var message = new Message()
{
    Notification = new Notification()
    {
        Title = "$GOOG up 1.43% on the day",
        Body = "$GOOG gained 11.80 points to close at 835.67, up 1.43% on the day.",
    },
    Condition = condition,
};

// Send a message to devices subscribed to the combination of topics
// specified by the provided condition.
string response = await FirebaseMessaging.DefaultInstance.SendAsync(message);
// Response is a message ID string.
Console.WriteLine("Successfully sent message: " + response);

REST

POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send HTTP/1.1

Content-Type: application/json
Authorization: Bearer ya29.ElqKBGN2Ri_Uz...HnS_uNreA
{
   "message":{
    "condition": "'dogs' in topics || 'cats' in topics",
    "notification" : {
      "body" : "This is a Firebase Cloud Messaging Topic Message!",
      "title" : "FCM Message",
    }
  }
}

cURL निर्देश:

curl -X POST -H "Authorization: Bearer ya29.ElqKBGN2Ri_Uz...HnS_uNreA" -H "Content-Type: application/json" -d '{
  "notification": {
    "title": "FCM Message",
    "body": "This is a Firebase Cloud Messaging Topic Message!",
  },
  "condition": "'dogs' in topics || 'cats' in topics"
}' https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send HTTP/1.1

अगले चरण