diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/_category_.json b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/_category_.json
new file mode 100644
index 00000000..0353653c
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/_category_.json
@@ -0,0 +1,8 @@
+{
+ "label": "Push Notification Management in Ant Media Server Android SDK",
+ "position": 2,
+ "link": {
+ "type": "generated-index",
+ "description": "Introduction to push notification management in Ant Media Server Android SDK"
+ }
+}
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/configure-ant-media-server.md b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/configure-ant-media-server.md
new file mode 100644
index 00000000..1da93973
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/configure-ant-media-server.md
@@ -0,0 +1,14 @@
+---
+title: Configure Ant Media Server
+description: Sending Notification in Android Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 6
+---
+
+# Configure Ant Media Server:
+
+After you register FCM or APN, you will have the private key. You need to save it into the Ant Media Server. Open the management panel, select an application, and go to the application-level settings. You will see it in the push notification section.
+
+![](@site/static/img/push-notification-settings.jpg)
+
+To protect the send push notification WebSocket message, you need to generate two subscriber authentication tokens with the sender’s Subscriber ID and the receiver’s Subscriber ID. You can call the [getSubscriberAuthenticationToken](https://antmedia.io/rest/#/default/getSubscriberAuthenticationToken) Rest API endpoint. We will call the sender’s token as authToken in the rest of the documentation. We will call the sender’s Subscriber ID as subscriberId and we will call the receiver’s Subscriber ID as sendNotificationToSubscriber.
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/configure-manifest.md b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/configure-manifest.md
new file mode 100644
index 00000000..004d4acf
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/configure-manifest.md
@@ -0,0 +1,21 @@
+---
+title: Configure Manifest
+description: Sending Notification in Android Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 4
+---
+
+# Configure AndroidManifest.xml:
+
+- Open your AndroidManifest.xml file.
+- Add the necessary permissions and service declarations:
+
+```xml
+
+
+
+
+
+```
\ No newline at end of file
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/create-android-project.md b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/create-android-project.md
new file mode 100644
index 00000000..c1d439d0
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/create-android-project.md
@@ -0,0 +1,21 @@
+---
+title: Create an Android App Project in Android Studio
+description: Sending Notification in Android Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 2
+---
+
+## Step 2: Create an Android App Project in Android Studio
+
+- Open Android Studio and create a new project with No Activity.
+
+![](@site/static/img/sdk-integration/android-sdk/android-new-project-page.png)
+
+- Select No Activity and then click Next.
+
+![](@site/static/img/sdk-integration/android-sdk/android-project-naming-screen.png)
+
+- Give your application a name, and then click Finish. We will call it
+ `MyWebRTCStreamingApp`.
+
+Congratulations! You have successfully created your WebRTC Android SDK application project.
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/create-required-classes.md b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/create-required-classes.md
new file mode 100644
index 00000000..933ddb25
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/create-required-classes.md
@@ -0,0 +1,384 @@
+---
+title: Create Required Classes
+description: Sending Notification in Android Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 5
+---
+
+# Create Required Classes:
+
+Create the following classes in your Android project:
+
+## Ant Media Firebase Messaging Service
+
+Create AntMediaFirebaseMessagingService to handle incoming messages and registration token updates using FirebaseMessagingService:
+
+```java
+public class AntMediaFirebaseMessagingService extends FirebaseMessagingService {
+
+ private static final String TAG = "AntMediaFMS";
+
+ public static String fcmToken = "";
+
+ @Override
+ public void onMessageReceived(RemoteMessage remoteMessage) {
+ Log.d(TAG, "From: " + remoteMessage.getFrom());
+
+ // Check if message contains a notification payload.
+ if (remoteMessage.getNotification() != null) {
+ Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
+ }
+
+ // show call notification
+ NotificationHelper.showCallNotification(this);
+ }
+
+ /**
+ * There are two scenarios when onNewToken is called:
+ * 1) When a new token is generated on initial app startup
+ * 2) Whenever an existing token is changed
+ * Under #2, there are three scenarios when the existing token is changed:
+ * A) App is restored to a new device
+ * B) User uninstalls/reinstalls the app
+ * C) User clears app data
+ */
+ @Override
+ public void onNewToken(@NonNull String token) {
+ Log.d(TAG, "Refreshed token: " + token);
+
+ fcmToken = token;
+ }
+}
+
+```
+
+## Accept Call Receiver
+
+The AcceptCallReceiver class extends BroadcastReceiver and is responsible for handling the user’s action when they accept an incoming call from the notification. When the “Accept” button is tapped on the notification, this receiver is triggered to manage the acceptance of the call and transition the user to the appropriate in-call activity.
+
+```java
+public class AcceptCallReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Toast.makeText(context, "Call accepted.", Toast.LENGTH_SHORT).show();
+
+ NotificationHelper.dismissCallNotification(context);
+
+ /*
+ Bundle extras = intent.getExtras();
+ if (extras != null) {
+ startActivityIntent.putExtras(extras);
+ }
+ */
+
+ PeerForNotificationActivity.streamId = "streamId";
+
+ Intent callIntent = new Intent(context, PeerForNotificationActivity.class);
+ callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(callIntent);
+ }
+}
+```
+
+## Decline Call Receiver
+
+The DeclineCallReceiver class extends BroadcastReceiver and is responsible for managing the user’s action when they choose to decline an incoming call from the notification. This class listens for the broadcast triggered by the “Decline” button in the notification and performs the necessary operations to handle the declined call.
+
+```java
+public class DeclineCallReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Toast.makeText(context, "Call declined.", Toast.LENGTH_SHORT).show();
+
+ NotificationHelper.dismissCallNotification(context);
+
+ Intent callIntent = new Intent(context, MainActivity.class);
+ callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(callIntent);
+ }
+}
+```
+
+## Notification Helper
+
+The NotificationHelper class is a utility designed to display and manage incoming call notifications in a WebRTC-based application. It leverages the Android Notification API to create a highly interactive and user-friendly call notification with actions like accepting or declining the call.
+
+```java
+
+public class NotificationHelper {
+
+ private static NotificationManager notificationManager = null;
+
+ private static String callerName = "John Doe";
+
+ private static String roomName = "Room 1";
+
+ public static void setCallerName(String name) {
+ callerName = name;
+ }
+
+ public static void setRoomName(String name) {
+ roomName = name;
+ }
+
+ public static void showCallNotification(Context context) {
+ notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
+ String channelId = "call_notifications";
+ String channelName = "Call Notifications";
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ NotificationChannel channel = new NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_HIGH);
+ notificationManager.createNotificationChannel(channel);
+ }
+
+ // Intent for the accept action
+ Intent acceptIntent = new Intent(context, AcceptCallReceiver.class);
+ PendingIntent acceptPendingIntent = PendingIntent.getBroadcast(context, 0, acceptIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
+
+ // Intent for the decline action
+ Intent declineIntent = new Intent(context, DeclineCallReceiver.class);
+ PendingIntent declinePendingIntent = PendingIntent.getBroadcast(context, 0, declineIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
+
+ NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId)
+ .setSmallIcon(R.drawable.ic_loopback_call)
+ .setContentTitle("Incoming Call")
+ .setContentText(callerName+" is calling...")
+ .setPriority(NotificationCompat.PRIORITY_HIGH)
+ .setCategory(NotificationCompat.CATEGORY_CALL)
+ .addAction(R.drawable.ic_loopback_call, "Answer", acceptPendingIntent)
+ .addAction(R.drawable.disconnect, "Decline", declinePendingIntent);
+
+ notificationManager.notify(1, builder.build());
+ }
+
+ public static void dismissCallNotification(Context context) {
+ if (notificationManager != null) {
+ notificationManager.cancel(1);
+ }
+ }
+}
+```
+
+## Call Notification Activity
+
+The CallNotificationActivity class demonstrates how to integrate WebRTC functionality with push notifications using Firebase Cloud Messaging (FCM). It manages WebRTC calls while ensuring that both the caller and receiver are notified about call events through push notifications. The use of permissions for Android Tiramisu (API level 33) ensures compatibility with newer Android versions, making the application ready for broader device support.
+
+```java
+public class CallNotificationActivity extends ComponentActivity {
+
+ String streamId;
+
+ String subscriberId;
+
+ String receiverSubscriberId;
+
+ String authToken;
+
+ String pushNotificationToken;
+
+ String tokenType;
+
+ JSONObject pushNotificationContent;
+
+ JSONArray receiverSubscriberIdArray;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_simple_publish);
+
+ FirebaseApp.initializeApp(this);
+
+ SharedPreferences sharedPreferences =
+ PreferenceManager.getDefaultSharedPreferences(this);
+
+ //FirebaseMessaging.getInstance().setAutoInitEnabled(true);
+
+ SurfaceViewRenderer fullScreenRenderer = findViewById(R.id.full_screen_renderer);
+ String serverUrl = sharedPreferences.getString(getString(R.string.serverAddress), SettingsActivity.DEFAULT_WEBSOCKET_URL);
+
+ IWebRTCClient webRTCClient = IWebRTCClient.builder()
+ .setActivity(this)
+ .setInitiateBeforeStream(true)
+ .setWebRTCListener(createWebRTCListener())
+ .setLocalVideoRenderer(fullScreenRenderer)
+ .setServerUrl(serverUrl)
+ .build();
+
+ streamId = "streamId" + (int)(Math.random()*9999);
+
+ PeerForNotificationActivity.streamId = streamId;
+
+ //Define the subscriberId and it can be any subscriber Id
+ subscriberId = "test1@antmedia.io";
+
+ //Define the receiverSubscriberId and it can be any subscriber Id
+ receiverSubscriberId = "test2@antmedia.io";
+
+ //Get auth token for Ant Media Server to authenticate the user.
+ //it's JWT token generated with Subscription Authentication Key(subscriptionAuthenticationKey) in Application settings with subscriberId claim and it's value.
+ //PushNotificationRestService can also be used to generate the authToken
+ authToken = "";
+
+ pushNotificationToken = AntMediaFirebaseMessagingService.fcmToken;
+
+ tokenType = "fcm";
+
+ pushNotificationContent = new JSONObject();
+ receiverSubscriberIdArray = new JSONArray();
+
+ try {
+ pushNotificationContent.put("Caller", subscriberId);
+ pushNotificationContent.put("StreamId", streamId);
+ receiverSubscriberIdArray.put(receiverSubscriberId);
+ } catch (JSONException e) {
+ throw new RuntimeException(e);
+ }
+
+
+ askNotificationPermission();
+ }
+
+ private IWebRTCListener createWebRTCListener() {
+ return new DefaultWebRTCListener() {
+ @Override
+ public void onWebSocketConnected() {
+ super.onWebSocketConnected();
+ webRTCClient.registerPushNotificationToken(subscriberId, authToken, pushNotificationToken, tokenType);
+ webRTCClient.sendPushNotification(subscriberId, authToken, pushNotificationContent, receiverSubscriberIdArray
+ );
+ }
+
+ };
+ }
+
+ // [START ask_post_notifications]
+ // Declare the launcher at the top of your Activity/Fragment:
+ private final ActivityResultLauncher requestPermissionLauncher =
+ registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> {
+ if (isGranted) {
+ // FCM SDK (and your app) can post notifications.
+ } else {
+ // TODO: Inform user that that your app will not show notifications.
+ }
+ });
+
+ private void askNotificationPermission() {
+ // This is only necessary for API level >= 33 (TIRAMISU)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) ==
+ PackageManager.PERMISSION_GRANTED) {
+ // FCM SDK (and your app) can post notifications.
+ } else if (shouldShowRequestPermissionRationale(Manifest.permission.POST_NOTIFICATIONS)) {
+ // TODO: display an educational UI explaining to the user the features that will be enabled
+ // by them granting the POST_NOTIFICATION permission. This UI should provide the user
+ // "OK" and "No thanks" buttons. If the user selects "OK," directly request the permission.
+ // If the user selects "No thanks," allow the user to continue without notifications.
+ } else {
+ // Directly ask for the permission
+ requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS);
+ }
+ }
+ }
+}
+```
+
+## Peer For Notification Activity
+
+The PeerForNotificationActivity class handles both video streaming and peer-to-peer communication via WebRTC. It also demonstrates how to manage real-time notifications using data channels, providing a complete solution for WebRTC applications with user interaction.
+
+```java
+public class PeerForNotificationActivity extends TestableActivity {
+
+private TextView broadcastingTextView;
+public static String streamId;
+private IWebRTCClient webRTCClient;
+
+@RequiresApi(api = Build.VERSION_CODES.M)
+@Override
+protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_peer_for_notification);
+
+ SurfaceViewRenderer fullScreenRenderer = findViewById(R.id.full_screen_renderer);
+ SurfaceViewRenderer pipRenderer = findViewById(R.id.pip_view_renderer);
+
+ broadcastingTextView = findViewById(R.id.broadcasting_text_view);
+
+ String serverUrl = sharedPreferences.getString(getString(R.string.serverAddress), SettingsActivity.DEFAULT_WEBSOCKET_URL);
+
+ webRTCClient = IWebRTCClient.builder()
+ .setLocalVideoRenderer(pipRenderer)
+ .addRemoteVideoRenderer(fullScreenRenderer)
+ .setServerUrl(serverUrl)
+ .setActivity(this)
+ .setWebRTCListener(createWebRTCListener())
+ .setDataChannelObserver(createDatachannelObserver())
+ .build();
+
+ Log.i(getClass().getSimpleName(), "Calling play start");
+ webRTCClient.join(streamId);
+}
+
+private IDataChannelObserver createDatachannelObserver() {
+ return new DefaultDataChannelObserver() {
+ @Override
+ public void textMessageReceived(String messageText) {
+ super.textMessageReceived(messageText);
+ Toast.makeText(PeerForNotificationActivity.this, "Message received: " + messageText, Toast.LENGTH_SHORT).show();
+ }
+ };
+}
+
+private IWebRTCListener createWebRTCListener() {
+ return new DefaultWebRTCListener() {
+ @Override
+ public void onPlayStarted(String streamId) {
+ super.onPlayStarted(streamId);
+ broadcastingTextView.setVisibility(View.VISIBLE);
+ decrementIdle();
+ }
+
+ @Override
+ public void onPlayFinished(String streamId) {
+ super.onPlayFinished(streamId);
+ broadcastingTextView.setVisibility(View.GONE);
+ decrementIdle();
+ }
+ };
+}
+
+public void sendTextMessage(String messageToSend) {
+ final ByteBuffer buffer = ByteBuffer.wrap(messageToSend.getBytes(StandardCharsets.UTF_8));
+ DataChannel.Buffer buf = new DataChannel.Buffer(buffer, false);
+ webRTCClient.sendMessageViaDataChannel(streamId, buf);
+}
+
+public void showSendDataChannelMessageDialog(View view) {
+ if (webRTCClient != null && webRTCClient.isDataChannelEnabled()) {
+ // create an alert builder
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle("Send Message via Data Channel");
+ // set the custom layout
+ final View customLayout = getLayoutInflater().inflate(R.layout.send_message_data_channel, null);
+ builder.setView(customLayout);
+ // add a button
+ builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ // send data from the AlertDialog to the Activity
+ EditText editText = customLayout.findViewById(R.id.message_text_input);
+ sendTextMessage(editText.getText().toString());
+ }
+ });
+ // create and show the alert dialog
+ AlertDialog dialog = builder.create();
+ dialog.show();
+ }
+ else {
+ Toast.makeText(this, R.string.data_channel_not_available, Toast.LENGTH_LONG).show();
+ }
+}
+```
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/dependency.md b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/dependency.md
new file mode 100644
index 00000000..1e172ef7
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/dependency.md
@@ -0,0 +1,89 @@
+---
+title: Adding Dependencies
+description: Sending Notification in Android Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 3
+---
+
+## Step 3: Add WebRTC-Android-SDK Dependency
+
+There are two methods for integrating the Android SDK into our Android app project. The first, and simpler, approach involves importing it via the Sonatype Maven repository. The advantage of this method lies in its ease of implementation. However, it's crucial to note that opting for this method means you won't have the flexibility to modify WebRTC Android SDK files to suit your application requirements.
+
+Alternatively, the second method entails importing the Android SDK as a module. Opting for this approach grants you the ability to edit Android SDK class files as per your specific needs.
+
+### Add WebRTC-Android-SDK From Maven Repo (Easy)
+
+- At this point, we should add the dependency on the WebRTC Android SDK module to our newly created project. Since the module is hosted in the Sonatype Maven repository, we will add that repository to the dependency manager. The related setting is in the `settings.gradle` file.
+
+ Add the following lines to the `dependencyResolutionManagement/repositories section`:
+
+ ```java
+ maven {
+ url "https://oss.sonatype.org/content/repositories/snapshots/" }
+ ```
+
+![](@site/static/img/sdk-integration/android-sdk/settings.gradle.png)
+
+- After adding the repository, we will add the following lines to the dependencies session in the app `build.gradle` file.
+
+```java
+ implementation "io.antmedia:webrtc-android-framework:{version}"
+```
+
+- Replace version with the latest android sdk version released on maven. You can see all released versions [here](https://mvnrepository.com/artifact/io.antmedia/webrtc-android-framework).
+
+ For Example:
+
+ ```java
+ implementation "io.antmedia:webrtc-android-framework:2.11.0"
+ ```
+
+![](@site/static/img/sdk-integration/android-sdk/build.gradle.png)
+
+That is all. We have added the dependency and we are ready to create our WebRTC streaming application.
+
+
+### Add WebRTC-Android-SDK As a Module (Advanced)
+
+- Clone WebRTC-Android-SDK repository to your local.
+
+ ```
+ git clone https://github.com/ant-media/WebRTC-Android-SDK.git
+ ```
+
+- Open your android project with Android Studio. From left top corner, click `File > New > Import Module` to import.
+
+- Open WebRTC-Android-SDK and choose `webrtc-android-framework` from your file system.
+
+![](@site/static/img/sdk-integration/android-sdk/android-sdk-as-module-1.png)
+
+- After clicking Finish, you will face with 2 errors as below:
+
+![](@site/static/img/sdk-integration/android-sdk/android-sdk-as-module-2.png)
+
+- To fix those errors, remove `publish-remote.gradle` file from `webrtc-android-framework module`.
+
+ After removing, go to `build.gradle` file of `webrtc-android-framework` module and remove below line.
+
+ ```java
+ apply from: 'publish-remote.gradle'
+ ```
+
+ Then, go to your app project's `build.gradle` file and add below line to the dependencies.
+
+ ```java
+ api project(":webrtc-android-framework")
+ ```
+
+- Finally, sync gradle and it should be all done.
+
+You can now navigate to your application module and begin developing your streaming application. If needed, you can edit any of the Android SDK files within the `webrtc-android-framework`, and your changes will be applied.
+
+### Add Firebase Cloud Messaging Dependency:
+
+- Open your app-level build.gradle file.
+- Add the Firebase Cloud Messaging dependency:
+
+ ```java
+ implementation 'com.google.firebase:firebase-messaging:23.0.0'
+ ```
\ No newline at end of file
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/sending-notification.md b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/sending-notification.md
new file mode 100644
index 00000000..2fcbc194
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/sending-notification.md
@@ -0,0 +1,23 @@
+---
+title: Sending Notifications to Web and Mobile Clients
+description: Sending Notification in Android Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 7
+---
+
+# Sending Notifications to Web and Mobile Clients:
+
+## Send Test Notification from Firebase Console
+
+Once the Android app is set up, you can send a test push notification from the Firebase console to ensure everything is working properly.
+
+- Go to Firebase Console and navigate to the Cloud Messaging tab.
+- Click on "Send your first message."
+- Input the title and body of the notification.
+- Select your Android app and click "Send."
+
+You should receive the notification on your device if everything is correctly configured.
+
+## Send Notification from Ant Media Server
+
+We are ready to send push notifications. You can send your push notifications through the Ant Media Server in a secure way. All you need to do is call the sendPushNotification function.
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/setting-up-firebase.md b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/setting-up-firebase.md
new file mode 100644
index 00000000..ce675df1
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/Android SDK/setting-up-firebase.md
@@ -0,0 +1,18 @@
+---
+title: Setting Up Firebase Project
+description: Sending Notification in Android Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 1
+---
+
+## Step 1: Setting Up Firebase Project
+
+Before integrating Firebase Cloud Messaging (FCM) into your Android app, you need to set up a Firebase project:
+
+### Create a Firebase Project:
+- Go to the Firebase Console.
+- Follow the setup wizard to create a new Firebase project.
+- Once created, download the google-services.json file and place it in the app directory of your Android project.
+- Add Cloud Messaging to your project via Firebase Console.
+
+![](@site/static/img/fcm.jpg)
\ No newline at end of file
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/_category_.json b/docs/guides/developing-antmedia-server/push-notification-management/_category_.json
new file mode 100644
index 00000000..5e9a5efb
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/_category_.json
@@ -0,0 +1,8 @@
+{
+ "label": "Push Notification",
+ "position": 15,
+ "link": {
+ "type": "generated-index",
+ "description": "Introduction to push notification management in Ant Media Server"
+ }
+}
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/_category_.json b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/_category_.json
new file mode 100644
index 00000000..c1b04a01
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/_category_.json
@@ -0,0 +1,8 @@
+{
+ "label": "Push Notification Management in Ant Media Server iOS SDK",
+ "position": 3,
+ "link": {
+ "type": "generated-index",
+ "description": "Introduction to push notification management in Ant Media Server iOS SDK"
+ }
+}
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/configure-ant-media-server.md b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/configure-ant-media-server.md
new file mode 100644
index 00000000..639295d9
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/configure-ant-media-server.md
@@ -0,0 +1,14 @@
+---
+title: Configure Ant Media Server
+description: Sending Notification in iOS Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 4
+---
+
+# Configure Ant Media Server:
+
+After you register FCM or APN, you will have the private key. You need to save it into the Ant Media Server. Open the management panel, select an application, and go to the application-level settings. You will see it in the push notification section.
+
+![](@site/static/img/push-notification-settings.jpg)
+
+To protect the send push notification WebSocket message, you need to generate two subscriber authentication tokens with the sender’s Subscriber ID and the receiver’s Subscriber ID. You can call the [getSubscriberAuthenticationToken](https://antmedia.io/rest/#/default/getSubscriberAuthenticationToken) Rest API endpoint. We will call the sender’s token as authToken in the rest of the documentation. We will call the sender’s Subscriber ID as subscriberId and we will call the receiver’s Subscriber ID as sendNotificationToSubscriber.
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/configure-your-ios-project.md b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/configure-your-ios-project.md
new file mode 100644
index 00000000..6761a708
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/configure-your-ios-project.md
@@ -0,0 +1,83 @@
+---
+title: Configure Your iOS Project in Xcode
+description: Sending Notification in iOS Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 3
+---
+
+# Step 2: Configure Your iOS Project in Xcode
+
+Next, set up your iOS app to handle FCM and APN push notifications.
+
+1) Install Firebase SDK:
+- In your iOS project's Podfile, add the Firebase dependencies:
+
+```ruby
+pod 'Firebase/Messaging'
+```
+
+- Run pod install to integrate Firebase Messaging into your app.
+
+2) Enable Push Notifications:
+
+- In Xcode, select your project in the Project Navigator.
+- Under your app’s target, click on Signing & Capabilities.
+- Add Push Notifications and Background Modes. Under Background Modes, check the "Remote notifications" option.
+
+3) Configure AppDelegate for Firebase: You need to initialize Firebase and handle APN registration within the AppDelegate.
+
+```swift
+import UIKit
+import Firebase
+import FirebaseMessaging
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+
+ var window: UIWindow?
+
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+ FirebaseApp.configure()
+
+ // Register for remote notifications
+ if #available(iOS 10.0, *) {
+ UNUserNotificationCenter.current().delegate = self
+ let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
+ UNUserNotificationCenter.current().requestAuthorization(options: authOptions, completionHandler: { _, _ in })
+ } else {
+ let settings: UIUserNotificationSettings =
+ UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
+ application.registerUserNotificationSettings(settings)
+ }
+
+ application.registerForRemoteNotifications()
+ Messaging.messaging().delegate = self
+
+ return true
+ }
+
+ func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
+ Messaging.messaging().apnsToken = deviceToken
+ }
+}
+```
+
+4) Handle FCM Notifications: Create a delegate method to handle incoming messages from Firebase.
+
+```swift
+extension AppDelegate: UNUserNotificationCenterDelegate, MessagingDelegate {
+
+ // Receive displayed notifications for iOS 10 devices.
+ func userNotificationCenter(_ center: UNUserNotificationCenter,
+ willPresent notification: UNNotification,
+ withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
+ completionHandler([.alert, .badge, .sound])
+ }
+
+ // Handle FCM token refresh.
+ func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
+ print("FCM Token: \(fcmToken ?? "")")
+ // TODO: If necessary, send the token to your server.
+ }
+}
+```
\ No newline at end of file
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/prerequirements.md b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/prerequirements.md
new file mode 100644
index 00000000..9f3ed69b
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/prerequirements.md
@@ -0,0 +1,16 @@
+---
+title: Pre-Requirements
+description: Sending Notification in iOS Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 1
+---
+
+## Pre-Requirements
+
+Before diving into the integration process, make sure you have the following:
+
+- An Apple Developer Account to configure APN.
+- An iOS project created in Xcode.
+- A Firebase account with a project already set up.
+- Xcode 12 or later with Swift 5.0.
+- A real iOS device for testing (simulators do not support push notifications).
\ No newline at end of file
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/sending-notification.md b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/sending-notification.md
new file mode 100644
index 00000000..004fd048
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/sending-notification.md
@@ -0,0 +1,23 @@
+---
+title: Sending Notifications to Web and Mobile Clients
+description: Sending Notification in iOS Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 5
+---
+
+# Sending Notifications to Web and Mobile Clients:
+
+## Send Test Notification from Firebase Console
+
+Once the iOS app is set up, you can send a test push notification from the Firebase console to ensure everything is working properly.
+
+- Go to Firebase Console and navigate to the Cloud Messaging tab.
+- Click on "Send your first message."
+- Input the title and body of the notification.
+- Select your iOS app and click "Send."
+
+You should receive the notification on your device if everything is correctly configured.
+
+## Send Notification from Ant Media Server
+
+We are ready to send push notifications. You can send your push notifications through the Ant Media Server in a secure way. All you need to do is call the sendPushNotification function.
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/setting-up-apn-certificates.md b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/setting-up-apn-certificates.md
new file mode 100644
index 00000000..2b800d6b
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/iOS SDK/setting-up-apn-certificates.md
@@ -0,0 +1,25 @@
+---
+title: Configure APN Certificates
+description: Sending Notification in iOS Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 2
+---
+
+## Step 1: Configure APN Certificates
+
+Before FCM can send notifications to your iOS app, you need to configure the APN certificates.
+
+## Generate an APN key:
+
+- Go to your Apple Developer Account.
+- Select "Keys" and click the plus (+) button to create a new key.
+- Enable Apple Push Notification service (APNs) and download the .p8 file once created.
+
+## Upload the APN key to Firebase:
+
+- Open the Firebase Console and navigate to your project.
+- Go to Project Settings > Cloud Messaging tab.
+- In the "iOS app configuration" section, upload the .p8 file you downloaded from Apple Developer.
+- Provide the Key ID and the Team ID as shown on the Apple Developer account page.
+
+![](@site/static/img/fcm.jpg)
\ No newline at end of file
diff --git a/docs/guides/developing-antmedia-server/push-notification-management/push-notification-management.md b/docs/guides/developing-antmedia-server/push-notification-management/push-notification-management.md
new file mode 100644
index 00000000..65be6419
--- /dev/null
+++ b/docs/guides/developing-antmedia-server/push-notification-management/push-notification-management.md
@@ -0,0 +1,203 @@
+---
+title: Push Notification Management
+description: Push Notification Management Tutorial
+keywords: [Push Notification Management Tutorial, Push Notification Management, Ant Media Server Documentation, Ant Media Server Tutorials]
+sidebar_position: 1
+---
+
+# Push Notification Management
+
+Push notifications enable you to send announcements or video/audio call notifications to all users or specific groups. This page details how to send and configure these notifications.
+
+## Prerequirements
+
+- If you want to use Firebase Cloud Messaging (FCM), you need to create a Firebase account and you need to install the Firebase SDK into your client applications. You can follow [the official documentation](https://firebase.google.com/docs/cloud-messaging).
+- If you want to use Apple Push Notifications (APN), you need to create an Apple Developer account and you need to follow [the official documentation](https://developer.apple.com/documentation/usernotifications).
+
+## Registering Services
+
+After you register FCM or APN, you will have the private key. You need to save it into the Ant Media Server. Open the management panel, select an application, and go to the application-level settings. You will see it in the push notification section.
+
+![](@site/static/img/push-notification-settings.jpg)
+
+## Authorization
+
+To protect the send push notification WebSocket message, you need to generate two subscriber authentication tokens with the sender's Subscriber ID and the receiver's Subscriber ID. You can call the [getSubscriberAuthenticationToken](https://antmedia.io/rest/#/default/getSubscriberAuthenticationToken) Rest API endpoint. We will call the sender's token as authToken in the rest of the documentation. We will call the sender's Subscriber ID as subscriberId and we will call the receiver's Subscriber ID as sendNotificationToSubscriber.
+
+## FCM/APN Device/Registration Token
+
+You need to get a device/registration token for each client and store them in a secure place. We strongly recommend implementing a token timestamp in your code and your servers and updating this timestamp at regular intervals. You can check the [Firebase Cloud Message documentation](https://firebase.google.com/docs/cloud-messaging/manage-tokens#retrieve-and-store-registration-tokens) and [Apple Push Notification](https://developer.apple.com/documentation/usernotifications/registering-your-app-with-apns#Register-your-app-and-retrieve-your-apps-device-token) documentation to see how you can get a device/registration token for each client. We will call this token as pushNotificationToken in the rest of the documentation.
+
+
+ Getting FCM Registration Token Sample
+
+ - Connect your server and go to the /usr/local/antmedia/webapps path.
+
+ - Create fcm.html file and paste the code below
+
+ ```html
+
+
+
+
+ WebRTC Samples > Publish
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```
+
+
+ - Create firebase-messaging-sw.js file and paste the code below
+
+
+ ```js
+ importScripts('https://www.gstatic.com/firebasejs/10.8.0/firebase-app-compat.js');
+importScripts('https://www.gstatic.com/firebasejs/10.8.0/firebase-messaging-compat.js');
+
+
+
+// Retrieve an instance of Firebase Messaging so that it can handle background
+// messages.
+
+const firebaseConfig = {
+ apiKey: "AIzaSyBlWNhAbl1tIDCcWmDyk3yQ0rq0q-h_jrE",
+ authDomain: "push-notification-d0a87.firebaseapp.com",
+ projectId: "push-notification-d0a87",
+ storageBucket: "push-notification-d0a87.appspot.com",
+ messagingSenderId: "790648424032",
+ appId: "1:790648424032:web:2dfe62f14401f80b652505"
+ };
+
+ // Initialize Firebase
+ const app = firebase.initializeApp(firebaseConfig);
+ const messaging = firebase.messaging();
+
+ messaging.onBackgroundMessage((payload) => {
+ console.log('[firebase-messaging-sw.js] Received background message ', payload);
+ // Customize notification here
+ const notificationTitle = 'Background Message Title';
+ const notificationOptions = {
+ body: 'Background Message body.',
+ icon: '/firebase-logo.png'
+ };
+
+ self.registration.showNotification(notificationTitle,
+ notificationOptions);
+ });
+ ```
+
+ - Go to https://domain_name:port/fcm.html url using any browser.
+
+ - Open browser's developer console and you will see your FCM Registration Token
+
+ ![](@site/static/img/getting-fcm-token.jpg)
+
+
+## Register Push Notification Token
+
+We need to register our push notification token into the Ant Media Server. You need to call the registerPushNotificationToken function. You have 2 options for the pushNotificationService which are "apn" or "fcm".
+
+```js
+webRTCAdaptor.registerPushNotificationToken(subscriberId, authToken, pushNotificationToken, pushNotificationService);
+```
+
+## Send a push notification
+
+We are ready to send push notifications. You can send your push notifications through the Ant Media Server in a secure way. All you need to do is call the sendPushNotification function.
+
+```js
+webRTCAdaptor.sendPushNotification(subscriberId, authToken, {"title":"This is a test message", "apn-topic":"io.antmedia.ios.webrtc.sample"}, [sendNotificationToSubscriber]);
+```
+
+![](@site/static/img/push-notification-received.jpg)
diff --git a/static/img/fcm.jpg b/static/img/fcm.jpg
new file mode 100644
index 00000000..93900a30
Binary files /dev/null and b/static/img/fcm.jpg differ
diff --git a/static/img/getting-fcm-token.jpg b/static/img/getting-fcm-token.jpg
new file mode 100644
index 00000000..a8612687
Binary files /dev/null and b/static/img/getting-fcm-token.jpg differ
diff --git a/static/img/push-notification-received.jpg b/static/img/push-notification-received.jpg
new file mode 100644
index 00000000..9cf0fba3
Binary files /dev/null and b/static/img/push-notification-received.jpg differ
diff --git a/static/img/push-notification-settings.jpg b/static/img/push-notification-settings.jpg
new file mode 100644
index 00000000..d9bfccda
Binary files /dev/null and b/static/img/push-notification-settings.jpg differ