Skip to content

Commit 079792c

Browse files
authored
Merge pull request #287869 from ShawnJackson/two-communication-services-articles
[AQ] edit pass: Two Communication Services articles
2 parents f3d2592 + e384b11 commit 079792c

File tree

9 files changed

+196
-171
lines changed

9 files changed

+196
-171
lines changed

articles/communication-services/how-tos/calling-sdk/includes/install-sdk/install-sdk-android.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: rifox
88

99
## Install the SDK
1010

11-
Locate your project-level *build.gradle* file and add `mavenCentral()` to the list of repositories under `buildscript` and `allprojects`:
11+
Locate your project-level `build.gradle` file and add `mavenCentral()` to the list of repositories under `buildscript` and `allprojects`:
1212

1313
```groovy
1414
buildscript {
@@ -30,7 +30,7 @@ allprojects {
3030
}
3131
```
3232

33-
Then, in your module-level *build.gradle* file, add the following lines to the `dependencies` section:
33+
Then, in your module-level `build.gradle` file, add the following lines to the `dependencies` section:
3434

3535
```groovy
3636
dependencies {
@@ -40,7 +40,7 @@ dependencies {
4040
}
4141
```
4242

43-
### Initialize the required objects
43+
## Initialize the required objects
4444

4545
To create a `CallAgent` instance, you have to call the `createCallAgent` method on a `CallClient` instance. This call asynchronously returns a `CallAgent` instance object.
4646

articles/communication-services/how-tos/calling-sdk/includes/install-sdk/install-sdk-ios.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ ms.author: rifox
1010

1111
### Create the Xcode project
1212

13-
In Xcode, create a new iOS project and select the **Single View App** template. This quickstart uses the [SwiftUI framework](https://developer.apple.com/xcode/swiftui/), so you should set **Language** to **Swift** and set **Interface** to **SwiftUI**.
13+
In Xcode, create a new iOS project and select the **Single View App** template. This article uses the [SwiftUI framework](https://developer.apple.com/xcode/swiftui/), so you should set **Language** to **Swift** and set **Interface** to **SwiftUI**.
1414

15-
You're not going to create tests during this quickstart. Feel free to clear the **Include Tests** checkbox.
15+
You're not going to create tests in this article. Feel free to clear the **Include Tests** checkbox.
1616

1717
:::image type="content" source="../../../../quickstarts/voice-video-calling/media/ios/xcode-new-ios-project.png" alt-text="Screenshot that shows the window for creating a project within Xcode.":::
1818

@@ -27,14 +27,16 @@ You're not going to create tests during this quickstart. Feel free to clear the
2727
pod 'AzureCommunicationCalling', '~> 1.0.0'
2828
end
2929
```
30+
3031
2. Run `pod install`.
32+
3133
3. Open `.xcworkspace` by using Xcode.
3234
3335
### Request access to the microphone
3436
3537
To access the device's microphone, you need to update your app's information property list by using `NSMicrophoneUsageDescription`. You set the associated value to a string that will be included in the dialog that the system uses to request access from the user.
3638
37-
Right-click the *Info.plist* entry of the project tree, and then select **Open As** > **Source Code**. Add the following lines in the top-level `<dict>` section, and then save the file.
39+
Right-click the **Info.plist** entry of the project tree, and then select **Open As** > **Source Code**. Add the following lines in the top-level `<dict>` section, and then save the file.
3840
3941
```xml
4042
<key>NSMicrophoneUsageDescription</key>
@@ -43,14 +45,14 @@ Right-click the *Info.plist* entry of the project tree, and then select **Open A
4345

4446
### Set up the app framework
4547

46-
Open your project's *ContentView.swift* file. Add an `import` declaration to the top of the file to import the `AzureCommunicationCalling` library. In addition, import `AVFoundation`. You'll need it for audio permission requests in the code.
48+
Open your project's `ContentView.swift` file. Add an `import` declaration to the top of the file to import the `AzureCommunicationCalling` library. In addition, import `AVFoundation`. You'll need it for audio permission requests in the code.
4749

4850
```swift
4951
import AzureCommunicationCalling
5052
import AVFoundation
5153
```
5254

53-
## Initialize CallAgent
55+
### Initialize CallAgent
5456

5557
To create a `CallAgent` instance from `CallClient`, you have to use a `callClient.createCallAgent` method that asynchronously returns a `CallAgent` object after it's initialized.
5658

articles/communication-services/how-tos/calling-sdk/includes/install-sdk/install-sdk-windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.author: jowang
99

1010
### Create the Visual Studio project
1111

12-
For a UWP app, in Visual Studio 2022, create a new **Blank App (Universal Windows)** project. After you enter the project name, feel free to choose any Windows SDK later than 10.0.17763.0.
12+
For a Universal Windows Platform (UWP) app, in Visual Studio 2022, create a new **Blank App (Universal Windows)** project. After you enter the project name, feel free to choose any Windows SDK later than 10.0.17763.0.
1313

1414
For a WinUI 3 app, create a new project with the **Blank App, Packaged (WinUI 3 in Desktop)** template to set up a single-page WinUI 3 app. [Windows App SDK version 1.3](/windows/apps/windows-app-sdk/stable-channel#version-13) or later is required.
1515

articles/communication-services/how-tos/calling-sdk/includes/push-notifications/push-notifications-android.md

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,56 @@ ms.topic: include
55
ms.date: 08/06/2024
66
ms.author: sanathr
77
---
8-
> [!IMPORTANT]
9-
> On June 20, 2023, Google announced that it [deprecated sending messages using the FCM legacy APIs](https://firebase.google.com/docs/cloud-messaging). Google is removing the legacy FCM from service in June 2024. Google recommends [migrating from legacy FCM APIs to FCM HTTP v1](https://firebase.google.com/docs/cloud-messaging/migrate-v1).
10-
> Please follow this [migration guide](/azure/communication-services/tutorials/call-chat-migrate-android-push-fcm-v1) if your Communication reosurce is still using the old FCM legacy APIs.
11-
12-
[!INCLUDE [Install SDK](../install-sdk/install-sdk-android.md)]
138

14-
### Additional Prerequisites for Push Notifications
9+
- A Firebase account with Firebase Cloud Messaging (FCM) enabled and with your FCM service connected to an Azure Notification Hubs instance. For more information, see [Communication Services notifications](../../../../concepts/notifications.md).
10+
- Android Studio version 3.6 or later to build your application.
11+
- A set of permissions to enable the Android application to receive notification messages from FCM. In your `AndroidManifest.xml` file, add the following permissions right after `<manifest ...>` or below the `</application>` tag:
1512

16-
A Firebase account set up with Cloud Messaging (FCM) enabled and with your Firebase Cloud Messaging service connected to an Azure Notification Hub instance. See [Communication Services notifications](../../../../concepts/notifications.md) for more information.
17-
Additionally, the tutorial assumes you're using Android Studio version 3.6 or higher to build your application.
13+
```xml
14+
<uses-permission android:name="android.permission.INTERNET"/>
15+
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
16+
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
17+
```
1818

19-
A set of permissions is required for the Android application in order to be able to receive notifications messages from Firebase Cloud Messaging. In your `AndroidManifest.xml` file, add the following set of permissions right after the `<manifest ...>` or below the `</application>` tag.
19+
> [!IMPORTANT]
20+
> On June 20, 2023, Google announced that it [deprecated sending messages by using the FCM legacy APIs](https://firebase.google.com/docs/cloud-messaging) and would start removing the legacy FCM from service in June 2024. Google recommends [migrating from legacy FCM APIs to FCM HTTP v1](https://firebase.google.com/docs/cloud-messaging/migrate-v1).
21+
>
22+
> If your Communication Services resource is still using the FCM legacy APIs, follow [this migration guide](/azure/communication-services/tutorials/call-chat-migrate-android-push-fcm-v1).
2023
21-
```xml
22-
<uses-permission android:name="android.permission.INTERNET"/>
23-
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
24-
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
25-
```
24+
## Considerations for mobile push notifications
2625

27-
## Overview
28-
Mobile push notifications are the pop-up notifications you see on mobile devices. For calling, we'll be focusing on VoIP (Voice over Internet Protocol) push notifications. We register for push notifications, handle push notifications, and then unregister push notifications.
26+
Mobile push notifications are the pop-up notifications that appear on mobile devices. For calling, this article focuses on voice over Internet Protocol (VoIP) push notifications.
2927

3028
> [!NOTE]
31-
> Registering for Push Notifications and handling of the incoming Push Notifications for a Teams user, the APIs are the same. The APIs described here can also be invoked on the `CommonCallAgent` or `TeamsCallAgent` classes.
29+
> When the application registers for push notifications and handles the incoming push notifications for a Teams user, the APIs are the same. The APIs that this article describes can also be invoked on the `CommonCallAgent` or `TeamsCallAgent` class.
30+
31+
[!INCLUDE [Install SDK](../install-sdk/install-sdk-android.md)]
3232

3333
## Register for push notifications
3434

35-
To register for push notifications, the application needs to call `registerPushNotification()` on a `CallAgent` instance with a device registration token.
35+
To register for push notifications, the application needs to call `registerPushNotification()` on a `CallAgent` instance by using a device registration token.
3636

37-
To obtain the device registration token, add the Firebase SDK to your application module's `build.gradle` file by adding the following lines in the `dependencies` section if it's not already there:
37+
To obtain the device registration token, add the Firebase SDK to your application module's `build.gradle` file by adding the following lines in the `dependencies` section (if the lines aren't already there):
3838

3939
```groovy
4040
// Add the SDK for Firebase Cloud Messaging
4141
implementation 'com.google.firebase:firebase-core:16.0.8'
4242
implementation 'com.google.firebase:firebase-messaging:20.2.4'
4343
```
4444

45-
In your project level's *build.gradle* file, add the following line in the `dependencies` section if it's not already there:
45+
In your project level's `build.gradle` file, add the following line in the `dependencies` section if it's not already there:
4646

4747
```groovy
4848
classpath 'com.google.gms:google-services:4.3.3'
4949
```
5050

51-
Add the following plugin to the beginning of the file if it's not already there:
51+
Add the following plug-in to the beginning of the file if it's not already there:
5252

5353
```groovy
5454
apply plugin: 'com.google.gms.google-services'
5555
```
5656

57-
Select *Sync Now* in the toolbar. Add the following code snippet to get the device registration token generated by the Firebase Cloud Messaging SDK for the client application instance. Be sure to add the below imports to the header of the main Activity for the instance to retrieve the token.
57+
On the toolbar, select **Sync Now**. Add the following code snippet to get the device registration token that the Firebase Cloud Messaging SDK generated for the client application instance. Be sure to add the following imports to the header of the main activity for the instance to retrieve the token.
5858

5959
```java
6060
import com.google.android.gms.tasks.OnCompleteListener;
@@ -75,13 +75,14 @@ FirebaseInstanceId.getInstance().getInstanceId()
7575
return;
7676
}
7777

78-
// Get new Instance ID token
78+
// Get the new instance ID token
7979
String deviceToken = task.getResult().getToken();
8080
// Log
8181
Log.d("PushNotification", "Device Registration token retrieved successfully");
8282
}
8383
});
8484
```
85+
8586
Register the device registration token with the Calling Services SDK for incoming call push notifications:
8687

8788
```java
@@ -94,19 +95,19 @@ catch(Exception e) {
9495
}
9596
```
9697

97-
## Push notification handling
98+
## Handle push notifications
9899

99-
To receive incoming call push notifications, call *handlePushNotification()* on a *CallAgent* instance with a payload.
100+
To receive incoming call push notifications, call `handlePushNotification()` on a `CallAgent` instance with a payload.
100101

101-
To obtain the payload from Firebase Cloud Messaging, begin by creating a new Service (File > New > Service > Service) that extends the *FirebaseMessagingService* Firebase SDK class and override the `onMessageReceived` method. This method is the event handler called when Firebase Cloud Messaging delivers the push notification to the application.
102+
To obtain the payload from Firebase Cloud Messaging, begin by creating a new service (select **File** > **New** > **Service** > **Service**) that extends the `FirebaseMessagingService` Firebase SDK class and overrides the `onMessageReceived` method. This method is the event handler that's called when Firebase Cloud Messaging delivers the push notification to the application.
102103

103104
```java
104105
public class MyFirebaseMessagingService extends FirebaseMessagingService {
105106
private java.util.Map<String, String> pushNotificationMessageDataFromFCM;
106107

107108
@Override
108109
public void onMessageReceived(RemoteMessage remoteMessage) {
109-
// Check if message contains a notification payload.
110+
// Check if the message contains a notification payload.
110111
if (remoteMessage.getNotification() != null) {
111112
Log.d("PushNotification", "Message Notification Body: " + remoteMessage.getNotification().getBody());
112113
}
@@ -116,6 +117,7 @@ public class MyFirebaseMessagingService extends FirebaseMessagingService {
116117
}
117118
}
118119
```
120+
119121
Add the following service definition to the `AndroidManifest.xml` file, inside the `<application>` tag:
120122

121123
```xml
@@ -128,7 +130,7 @@ Add the following service definition to the `AndroidManifest.xml` file, inside t
128130
</service>
129131
```
130132

131-
Once the payload is retrieved, it can be passed to the *Communication Services* SDK to be parsed out into an internal *IncomingCallInformation* object that will handle calling the *handlePushNotification* method on a *CallAgent* instance. A `CallAgent` instance is created by calling the `createCallAgent(...)` method on the `CallClient` class.
133+
After you retrieve the payload, you can pass it to the Communication Services SDK to be parsed into an internal `IncomingCallInformation` object. This object handles calling the `handlePushNotification` method on a `CallAgent` instance. You create a `CallAgent` instance by calling the `createCallAgent(...)` method on the `CallClient` class.
132134

133135
```java
134136
try {
@@ -140,11 +142,11 @@ catch(Exception e) {
140142
}
141143
```
142144

143-
When the handling of the Push notification message is successful, and the all events handlers are registered properly, the application rings.
145+
When the handling of the push notification message is successful, and the all event handlers are registered properly, the application rings.
144146

145147
## Unregister push notifications
146148

147-
Applications can unregister push notification at any time. Call the `unregisterPushNotification()` method on callAgent to unregister.
149+
Applications can unregister push notification at any time. To unregister, call the `unregisterPushNotification()` method on `callAgent`:
148150

149151
```java
150152
try {
@@ -155,13 +157,14 @@ catch(Exception e) {
155157
}
156158
```
157159

158-
## Disable internal push for incoming call
160+
## Disable internal push notifications for an incoming call
161+
162+
The push payload of an incoming call can be delivered to the callee in two ways:
159163

160-
There are two ways that a push payload of an incoming call can be delivered to the callee.
161-
- Using FCM and registering the device token with the API mentioned above, `registerPushNotification` on `CallAgent` or `TeamsCallAgent`.
162-
- When a `CallAgent` or `TeamsCallAgent` is created, SDK also registers with an internal service to get the push payload delivered.
164+
- Using FCM and registering the device token with the API mentioned earlier, `registerPushNotification` on `CallAgent` or `TeamsCallAgent`
165+
- Registering the SDK with an internal service upon creation of `CallAgent` or `TeamsCallAgent` to get the push payload delivered
163166

164-
Using the property `setDisableInternalPushForIncomingCall` in `CallAgentOptions` or `TeamsCallAgentOptions` it's possible to instruct the SDK to disable the delivery of the push payload using the internal push service.
167+
By using the property `setDisableInternalPushForIncomingCall` in `CallAgentOptions` or `TeamsCallAgentOptions`, it's possible to instruct the SDK to disable the delivery of the push payload via the internal push service:
165168

166169
```java
167170
CallAgentOptions callAgentOptions = new CallAgentOptions();

0 commit comments

Comments
 (0)