{"id":5583,"date":"2020-07-21T06:46:00","date_gmt":"2020-07-21T06:46:00","guid":{"rendered":"https:\/\/infyblog.zluck.in\/?p=5583"},"modified":"2024-08-13T06:47:37","modified_gmt":"2024-08-13T06:47:37","slug":"send-device-to-device-push-notification-using-firebase-cloud-messaging","status":"publish","type":"post","link":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/","title":{"rendered":"Send Device-to-Device Push Notification using Firebase Cloud Messaging"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"5583\" class=\"elementor elementor-5583\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c214bd1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c214bd1\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2ad0471\" data-id=\"2ad0471\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\n\t\t<div class=\"elementor-element elementor-element-483f3a8 elementor-widget elementor-widget-text-editor\" data-id=\"483f3a8\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you deliver messages for free.<\/p><p>It allows you to send push notifications from the Firebase console or from the application server or some trusted server where logic runs.<\/p><h2>Step 1:- Create a new Android Studio Project<\/h2><p>First, create a new Android Studio project and add the dependencies. First set up Firebase in your project. You can find a good <a href=\"https:\/\/firebase.google.com\/docs\/android\/setup\">tutorial<\/a>.<\/p><p>Add Firebase messaging dependency to your app-level.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5fd53bc elementor-widget elementor-widget-code-highlight\" data-id=\"5fd53bc\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>build.Gradle\r\ndependencies {\r\n  implementation 'com.google.firebase:firebase-messaging:19.0.1'\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-76cb341 elementor-widget elementor-widget-text-editor\" data-id=\"76cb341\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Step 2: Create a Firebase Service<\/h2><p>The next step is to create Firebase Services:- <span style=\"color: #e83e8c;\">MyFirebaseInstanceIDService<\/span> and <span style=\"color: #e83e8c;\">MyFirebaseMessagingService. <\/span>first<span style=\"color: #e83e8c;\"> MyFirebaseInstanceIDService<\/span> service will handle the device registration process and the second <span style=\"color: #e83e8c;\">MyFirebaseInstanceIDService<\/span> will handle the reception and display of notifications. The services have no visual interface and are used for operations that run in the background. To create a service, right-click and select the Applications folder New -&gt; Service -&gt; Service.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-90f54ae elementor-widget elementor-widget-image\" data-id=\"90f54ae\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"700\" height=\"488\" src=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/1-2-1.png\" class=\"attachment-large size-large wp-image-5596\" alt=\"Create a Firebase Service\" srcset=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/1-2-1.png 700w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/1-2-1-300x209.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b198a71 elementor-widget elementor-widget-text-editor\" data-id=\"b198a71\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Type in your service name, and click the Finish button. Repeat the same steps for the second service.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9a9f9da elementor-widget elementor-widget-image\" data-id=\"9a9f9da\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"727\" src=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/2-1-1.png\" class=\"attachment-large size-large wp-image-5597\" alt=\"2 (1)\" srcset=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/2-1-1.png 1003w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/2-1-1-300x272.png 300w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/2-1-1-768x698.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-dc05d65 elementor-widget elementor-widget-text-editor\" data-id=\"dc05d65\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>AndroidManifest.xml file and update your service declarations under the application tag. Also, add <span style=\"color: #e83e8c;\">INTERNET<\/span> and <span style=\"color: #e83e8c;\">CLOUD TO DEVICE MESSAGING<\/span> permissions so your app can interact with the FCM server.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3565d46 elementor-widget elementor-widget-code-highlight\" data-id=\"3565d46\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp><!--?xml version=\"1.0\" encoding=\"utf-8\"?-->\r\n<manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\" package=\"com.exmple.notify\">\r\n\r\n  <uses-permission android:name=\"android.permission.INTERNET\">\r\n  <uses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\">\r\n\r\n<application android:allowbackup=\"true\" \r\nandroid:icon=\"@mipmap\/ic_launcher\" \r\nandroid:label=\"@string\/app_name\" \r\nandroid:roundicon=\"@mipmap\/ic_launcher_round\" \r\nandroid:supportsrtl=\"true\" \r\nandroid:theme=\"@style\/AppTheme\">\r\n    <activity android:name=\".MainActivity\">\r\n      <intent-filter>\r\n        <action android:name=\"android.intent.action.MAIN\">\r\n        <category android:name=\"android.intent.category.LAUNCHER\">\r\n      <\/category><\/action><\/intent-filter>\r\n    <\/activity>\r\n\r\n    <service android:name=\".MyFirebaseInstanceIDService\">\r\n      <intent-filter>\r\n        <action android:name=\"com.google.firebase.INSTANCE_ID_EVENT\">\r\n      <\/action><\/intent-filter>\r\n    <\/service>\r\n\r\n    <service android:name=\".MyFirebaseMessagingService\"\r\n\r\nandroid:permission=\"com.google.android.c2dm.permission.SEND\">\r\n      <intent-filter>\r\n        <action android:name=\"com.google.firebase.MESSAGING_EVENT\">\r\n        <action android:name=\"com.google.android.c2dm.intent.RECEIVE\">\r\n      <\/action><\/action><\/intent-filter>\r\n    <\/service>\r\n  <\/application>\r\n<\/uses-permission>\r\n<\/uses-permission>\r\n<\/manifest><\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b822311 elementor-widget elementor-widget-text-editor\" data-id=\"b822311\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>To handle the device registration process, <span style=\"color: #e83e8c;\">MyFirebaseInstanceIDService<\/span> must increase the FireBaseInstenside service class. Under this service, override the <span style=\"color: #e83e8c;\">tokenrefresh()<\/span> method so that whenever the system decides to refresh the tokens, it will be requested. This usually happens when the user installs\/reinstalls the application or when the user clears the application data.<\/p><p>Since you are sending notifications between devices, each user must subscribe to an issue with a different <span style=\"color: #e83e8c;\">user_id<\/span>. This ensures that users receive notifications sent to topics that match their <span style=\"color: #e83e8c;\">user_id<\/span>. Here is the implementation of <span style=\"color: #e83e8c;\">MyFirebaseInstanceIDSericiclass<\/span>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-12af133 elementor-widget elementor-widget-code-highlight\" data-id=\"12af133\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>public class MyFirebaseMessagingService extends FirebaseMessagingService {\r\n\r\n  private final String ADMIN_CHANNEL_ID = \"admin_channel\";\r\n\r\n  @Override\r\n  public void onMessageReceived(RemoteMessage remoteMessage) {\r\n    final Intent intent = new Intent(this, MainActivity.class);\r\n    NotificationManager notificationManager = (NotificationManager) \r\ngetSystemService(Context.NOTIFICATION_SERVICE);\r\n    int notificationID = new Random().nextInt(3000);\r\n   \/*\r\n    Apps targeting SDK 26 or above (Android O) must implement notification channels and add their notifications to at least one of them. \r\nTherefore, confirm if the version is Oreo or higher, then setup notification channel\r\n   *\/\r\n    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\r\n      setupChannels(notificationManager);\r\n    }\r\n\r\n    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);\r\n    Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.drawable.notify_icon);\r\n    Uri notificationSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIF CATION);\r\n\r\n    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, ADMIN_CHANNEL_ID)\r\n        .setSmallIcon(R.drawable.notify_icon)\r\n        .setLargeIcon(largeIcon)\r\n        .setContentTitle(remoteMessage.getData().get(\"title\"))\r\n        .setContentText(remoteMessage.getData().get(\"message\"))\r\n        .setAutoCancel(true)\r\n        .setSound(notificationSoundUri)\r\n        .setContentIntent(pendingIntent);\r\n\r\n    \/\/ Set notification color to match your app color template\r\n    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\r\n      notificationBuilder.setColor(getResources().getColor(R.color.colorPrimaryDark));\r\n    }\r\n    notificationManager.notify(notificationID, notificationBuilder.build());\r\n  }\r\n\r\n  @RequiresApi(api = Build.VERSION_CODES.O)\r\n  private void setupChannels(NotificationManager notificationManager) {\r\n    CharSequence adminChannelName = \"New notification\";\r\n    String adminChannelDescription = \"Device to device notification \";\r\n\r\n    NotificationChannel adminChannel;\r\n    adminChannel = new NotificationChannel(ADMIN_CHANNEL_ID, \r\n    adminChannelName, \r\n    NotificationManager.IMPORTANCE_HIGH);\r\n\r\n    adminChannel.setDescription(adminChannelDescription);\r\n    adminChannel.enableLights(true);\r\n    adminChannel.setLightColor(Color.RED);\r\n    adminChannel.enableVibration(true);\r\n\r\n    if (notificationManager != null) {\r\n      notificationManager.createNotificationChannel(adminChannel);\r\n    }\r\n  }\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5e61194 elementor-widget elementor-widget-text-editor\" data-id=\"5e61194\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Step 3: Implement the notification sending logic<\/h2><p>This is the most important part of the whole article. This is where you define the content of the instruction and how it will be modeled. However, before you dive into coding, follow these steps to get your server key from the Firebase console.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9d74931 elementor-widget elementor-widget-image\" data-id=\"9d74931\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"413\" src=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/3-2-1024x528.png\" class=\"attachment-large size-large wp-image-5621\" alt=\"Implement the notification sending logic\" srcset=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/3-2-1024x528.png 1024w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/3-2-300x155.png 300w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/3-2-768x396.png 768w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/3-2-1536x791.png 1536w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/3-2.png 1840w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-00a1b97 elementor-widget elementor-widget-text-editor\" data-id=\"00a1b97\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Navigate to the Cloud Messaging tab, and copy your Server key<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9e7a787 elementor-widget elementor-widget-image\" data-id=\"9e7a787\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"396\" src=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/4-1-2-1024x507.png\" class=\"attachment-large size-large wp-image-5622\" alt=\"Navigate to the Cloud Messaging tab, and copy your Server key\" srcset=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/4-1-2-1024x507.png 1024w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/4-1-2-300x149.png 300w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/4-1-2-768x380.png 768w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/4-1-2-1536x760.png 1536w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/4-1-2.png 1840w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5f4572a elementor-widget elementor-widget-text-editor\" data-id=\"5f4572a\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Implement the Sending Logic: An FCM server with the following request properties only needs an HTTP post request to send a push notification:<\/p><p>Method Type: <span style=\"color: #e83e8c;\">POST<\/span><\/p><p>URL: <a href=\"https:\/\/firebase.google.com\/docs\/cloud-messaging\/http-server-ref\">https:\/\/firebase.google.com\/docs\/cloud-messaging\/http-server-ref<\/a><\/p><p>Headers:<\/p><p>Authorization: key=&#8221;Firebase server key&#8221; Content-Type: application\/json<\/p><p>Body:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4504c9d elementor-widget elementor-widget-code-highlight\" data-id=\"4504c9d\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>{\r\n \"to\": \"\/topics\/notification_userId\",\r\n \"data\": {\r\n  \"title\": \"Notification title\",\r\n  \"message\": \"Notification message\",\r\n  \"key1\" : \"value1\",\r\n  \"key2\" : \"value2\" \/\/additional data you want to pass\r\n }\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6ca9c8e elementor-widget elementor-widget-text-editor\" data-id=\"6ca9c8e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>With these concepts in mind, you will first create a JsonObject of Notification body within your activity class. This object budget will contain the subject of the receiver, the title of the notification, the notification message, and the other key\/value pair you want to add.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ac7bc27 elementor-widget elementor-widget-code-highlight\" data-id=\"ac7bc27\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>public class MainActivity extends AppCompatActivity {\r\n  EditText edtTitle;\r\n  EditText edtMessage;\r\n  final private String FCM_API = \"https:\/\/fcm.googleapis.com\/fcm\/send\";\r\n  final private String serverKey = \"key=\" + \"Your Firebase server key\";\r\n  final private String contentType = \"application\/json\";\r\n  final String TAG = \"NOTIFICATION TAG\";\r\n\r\n  String NOTIFICATION_TITLE;\r\n  String NOTIFICATION_MESSAGE;\r\n  String TOPIC;\r\n\r\n  @Override\r\n  protected void onCreate(Bundle savedInstanceState) {\r\n    super.onCreate(savedInstanceState);\r\n    setContentView(R.layout.activity_main);\r\n    edtTitle = findViewById(R.id.edtTitle);\r\n    edtMessage = findViewById(R.id.edtMessage);\r\n    Button btnSend = findViewById(R.id.btnSend);\r\n\r\n    btnSend.setOnClickListener(new View.OnClickListener() {\r\n      @Override\r\n      public void onClick(View v) {\r\n        TOPIC = \"\/topics\/userABC\"; \/\/topic must match with what the receiver subscribed to\r\n        NOTIFICATION_TITLE = edtTitle.getText().toString();\r\n        NOTIFICATION_MESSAGE = edtMessage.getText().toString();\r\n\r\n        JSONObject notification = new JSONObject();\r\n        JSONObject notifcationBody = new JSONObject();\r\n        try {\r\n          notifcationBody.put(\"title\", NOTIFICATION_TITLE);\r\n          notifcationBody.put(\"message\", NOTIFICATION_MESSAGE);\r\n          notification.put(\"to\", TOPIC);\r\n          notification.put(\"data\", notifcationBody);\r\n        } catch (JSONException e) {\r\n          Log.e(TAG, \"onCreate: \" + e.getMessage() );\r\n        }\r\n        sendNotification(notification);\r\n      }\r\n    });\r\n  }\r\n  private void sendNotification(JSONObject notification) {\r\n ...\r\n  }\r\n}\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bf36e0c elementor-widget elementor-widget-text-editor\" data-id=\"bf36e0c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>The next step is to request the network server using the library volley, then use the parameters to the root server will request notification on the target device.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c7f69b7 elementor-widget elementor-widget-code-highlight\" data-id=\"c7f69b7\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>public class MainActivity extends AppCompatActivity {\r\n\r\n  ....\r\n\r\n  private void sendNotification(JSONObject notification) {\r\n    JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(FCM_API, notification,\r\n            new Response.Listener() {\r\n              @Override\r\n              public void onResponse(JSONObject response)\r\n              {\r\n                Log.i(TAG, \"onResponse: \" + response.toString());\r\n                edtTitle.setText(\"\");\r\n                edtMessage.setText(\"\");\r\n              }\r\n            },\r\n            new Response.ErrorListener() {\r\n              @Override\r\n              public void onErrorResponse(VolleyError error) {\r\n                Toast.makeText(MainActivity.this, \"Request error\", Toast.LENGTH_LONG).show();\r\n                Log.i(TAG, \"onErrorResponse: Didn't work\");\r\n              }\r\n            }){\r\n          @Override\r\n          public Map getHeaders() throws AuthFailureError {\r\n            Map params = new HashMap<>();\r\n            params.put(\"Authorization\", serverKey);\r\n            params.put(\"Content-Type\", contentType);\r\n            return params;\r\n          }\r\n        };\r\n    MySingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest);\r\n  }\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-03ad462 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"03ad462\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2390450\" data-id=\"2390450\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5398f72 elementor-widget elementor-widget-text-editor\" data-id=\"5398f72\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Finally, add a MySingleton class that will serve as a request queue for instruction requests.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c0b0f8e elementor-widget elementor-widget-code-highlight\" data-id=\"c0b0f8e\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>public class MySingleton {\r\n  private static MySingleton instance;\r\n  private RequestQueue requestQueue;\r\n  private Context ctx;\r\n\r\n  private MySingleton(Context context) {\r\n    ctx = context;\r\n    requestQueue = getRequestQueue();\r\n  }\r\n  public static synchronized MySingleton getInstance(Context context) {\r\n    if (instance == null) {\r\n      instance = new MySingleton(context);\r\n    }\r\n    return instance;\r\n  }\r\n  public RequestQueue getRequestQueue() {\r\n    if (requestQueue == null) {\r\n      \/\/ getApplicationContext() is key, it keeps you from leaking the\r\n      \/\/ Activity or BroadcastReceiver if someone passes one in.\r\n      requestQueue = Volley.newRequestQueue(ctx.getApplicationContext());\r\n    }\r\n    return requestQueue;\r\n  }\r\n  public  void addToRequestQueue(Request req) {\r\n    getRequestQueue().add(req);\r\n  }\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c7b2132 elementor-widget elementor-widget-text-editor\" data-id=\"c7b2132\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>With it, you&#8217;re done creating your app. You can start sending push notifications between devices without typing any server-side code. Always make sure that the notification will not be delivered to you if the subject of the recipient is correct. If you do everything right, you will get the same result.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6b09271 elementor-widget elementor-widget-image\" data-id=\"6b09271\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"568\" src=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/5-2-1.png\" class=\"attachment-large size-large wp-image-5638\" alt=\"5 (2) (1)\" srcset=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/5-2-1.png 700w, https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/5-2-1-300x243.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you deliver messages for&#8230;<\/p>\n","protected":false},"author":2,"featured_media":5585,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"postBodyCss":"","postBodyMargin":[],"postBodyPadding":[],"postBodyBackground":{"backgroundType":"classic","gradient":""},"two_page_speed":[],"footnotes":""},"categories":[11],"tags":[160,19],"class_list":["post-5583","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-development","tag-firebase","tag-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Send Device-to-Device Push Notification using Firebase Cloud Messaging<\/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:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send Device-to-Device Push Notification using Firebase Cloud Messaging\" \/>\n<meta property=\"og:description\" content=\"Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you deliver messages for...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | InfyOm Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/infyom\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-21T06:46:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-13T06:47:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png\" \/>\n\t<meta property=\"og:image:width\" content=\"772\" \/>\n\t<meta property=\"og:image:height\" content=\"484\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InfyOm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfyOm\" \/>\n<meta name=\"twitter:site\" content=\"@InfyOm\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InfyOm\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/\"},\"author\":{\"name\":\"InfyOm\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754\"},\"headline\":\"Send Device-to-Device Push Notification using Firebase Cloud Messaging\",\"datePublished\":\"2020-07-21T06:46:00+00:00\",\"dateModified\":\"2024-08-13T06:47:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/\"},\"wordCount\":542,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/infyom.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png\",\"keywords\":[\"Firebase\",\"Learning\"],\"articleSection\":[\"Android Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/\",\"url\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/\",\"name\":\"Send Device-to-Device Push Notification using Firebase Cloud Messaging\",\"isPartOf\":{\"@id\":\"https:\/\/infyom.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png\",\"datePublished\":\"2020-07-21T06:46:00+00:00\",\"dateModified\":\"2024-08-13T06:47:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage\",\"url\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png\",\"contentUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png\",\"width\":772,\"height\":484,\"caption\":\"Send Device-to-Device Push Notification using Firebase Cloud Messaging\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/infyom.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send Device-to-Device Push Notification using Firebase Cloud Messaging\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/infyom.com\/blog\/#website\",\"url\":\"https:\/\/infyom.com\/blog\/\",\"name\":\"Blog | InfyOm Technologies\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/infyom.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/infyom.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/infyom.com\/blog\/#organization\",\"name\":\"InfyOm Technologies\",\"url\":\"https:\/\/infyom.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png\",\"contentUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png\",\"width\":88,\"height\":41,\"caption\":\"InfyOm Technologies\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/infyom\",\"https:\/\/x.com\/InfyOm\",\"https:\/\/www.instagram.com\/infyomtechnologies\/\",\"https:\/\/in.linkedin.com\/company\/infyom-technologies\",\"https:\/\/github.com\/infyomlabs\",\"https:\/\/x.com\/infyom\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754\",\"name\":\"InfyOm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g\",\"caption\":\"InfyOm\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Send Device-to-Device Push Notification using Firebase Cloud Messaging","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:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/","og_locale":"en_US","og_type":"article","og_title":"Send Device-to-Device Push Notification using Firebase Cloud Messaging","og_description":"Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you deliver messages for...","og_url":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/","og_site_name":"Blog | InfyOm Technologies","article_publisher":"https:\/\/www.facebook.com\/infyom","article_published_time":"2020-07-21T06:46:00+00:00","article_modified_time":"2024-08-13T06:47:37+00:00","og_image":[{"width":772,"height":484,"url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png","type":"image\/png"}],"author":"InfyOm","twitter_card":"summary_large_image","twitter_creator":"@InfyOm","twitter_site":"@InfyOm","twitter_misc":{"Written by":"InfyOm","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#article","isPartOf":{"@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/"},"author":{"name":"InfyOm","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754"},"headline":"Send Device-to-Device Push Notification using Firebase Cloud Messaging","datePublished":"2020-07-21T06:46:00+00:00","dateModified":"2024-08-13T06:47:37+00:00","mainEntityOfPage":{"@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/"},"wordCount":542,"commentCount":0,"publisher":{"@id":"https:\/\/infyom.com\/blog\/#organization"},"image":{"@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage"},"thumbnailUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png","keywords":["Firebase","Learning"],"articleSection":["Android Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/","url":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/","name":"Send Device-to-Device Push Notification using Firebase Cloud Messaging","isPartOf":{"@id":"https:\/\/infyom.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage"},"image":{"@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage"},"thumbnailUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png","datePublished":"2020-07-21T06:46:00+00:00","dateModified":"2024-08-13T06:47:37+00:00","breadcrumb":{"@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#primaryimage","url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png","contentUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/08\/push-notification-using-firebase-cloud-messaging.png","width":772,"height":484,"caption":"Send Device-to-Device Push Notification using Firebase Cloud Messaging"},{"@type":"BreadcrumbList","@id":"https:\/\/infyom.com\/blog\/send-device-to-device-push-notification-using-firebase-cloud-messaging\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/infyom.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Send Device-to-Device Push Notification using Firebase Cloud Messaging"}]},{"@type":"WebSite","@id":"https:\/\/infyom.com\/blog\/#website","url":"https:\/\/infyom.com\/blog\/","name":"Blog | InfyOm Technologies","description":"","publisher":{"@id":"https:\/\/infyom.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/infyom.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/infyom.com\/blog\/#organization","name":"InfyOm Technologies","url":"https:\/\/infyom.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png","contentUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png","width":88,"height":41,"caption":"InfyOm Technologies"},"image":{"@id":"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/infyom","https:\/\/x.com\/InfyOm","https:\/\/www.instagram.com\/infyomtechnologies\/","https:\/\/in.linkedin.com\/company\/infyom-technologies","https:\/\/github.com\/infyomlabs","https:\/\/x.com\/infyom"]},{"@type":"Person","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754","name":"InfyOm","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g","caption":"InfyOm"}}]}},"_links":{"self":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/5583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/comments?post=5583"}],"version-history":[{"count":58,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/5583\/revisions"}],"predecessor-version":[{"id":5953,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/5583\/revisions\/5953"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/media\/5585"}],"wp:attachment":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/media?parent=5583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/categories?post=5583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/tags?post=5583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}