You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/viva/get-started/actions/geolocation/GeolocationDocumentation.md
+49-31Lines changed: 49 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,17 @@
1
1
---
2
2
title: Location capabilities in Adaptive Card Extension
3
3
description: Geolocation is a new action that the SharePoint Adaptive Card Extension framework supports, which enables third party developers to come up with their ___location specific scenarios.
4
-
ms.date: 04/06/2022
4
+
ms.date: 03/08/2023
5
5
ms.localizationpriority: high
6
6
---
7
7
# Location capabilities in Adaptive Card Extension
8
8
9
-
> [!NOTE]
10
-
> The geolocation capability in Adaptive Card Extension will be available in SPFx v1.15.
11
-
>
12
-
> So make sure that you have installed it before proceeding further.
13
-
>
14
-
> For more information on installing the SPFx v1.15 Preview, see [SharePoint Framework v1.15 release notes](../../../../release-1.15.md).
15
-
>
16
-
> This tutorial also assumes that you have already built a SharePoint Adaptive Card Extension.
9
+
Microsoft added support for two geolocation actions, unique to Viva Connections, in the [SharePoint Framework (SPFx) v1.15 release](../../../../release-1.15.md).
10
+
11
+
> [!IMPORTANT]
12
+
> This tutorial also assumes that you've already built an SPFx Adaptive Card Extension.
17
13
>
18
-
> To learn how to create your first SharePoint Adaptive Card Extension, try out [this tutorial](../../../get-started/build-first-sharepoint-adaptive-card-extension.md).
14
+
> To learn how to create your first an SPFx Adaptive Card Extension, try out [this tutorial](../../../get-started/build-first-sharepoint-adaptive-card-extension.md).
19
15
20
16
### New action types for geolocation
21
17
@@ -24,25 +20,44 @@ There are 2 Location actions:
24
20
1. Get Location
25
21
1. Show Location
26
22
27
-
### Get Location:
23
+
### Get Location
28
24
29
-
Gives user’s current device ___location or opens a ___location picker and returns the ___location chosen by the user. In the browser it uses Bing Maps as the mapping interface.
25
+
The `VivaAction.GetLocation` action takes user’s current device ___location or opens a ___location picker and returns the ___location chosen by the user. The Viva Connections browser client uses Bing Maps for the mapping experience:
30
26
31
-
The ACE action for Get Location is: `VivaAction.GetLocation`.
32
-
33
-
It takes an optional boolean parameter: `ChooseLocationOnMap`.
27
+
```json
28
+
{
29
+
"id": "originLocation",
30
+
"type": "VivaAction.GetLocation",
31
+
"title": "Select ___location on the map",
32
+
"parameters": {
33
+
"chooseLocationOnMap": true
34
+
}
35
+
}
36
+
```
34
37
35
-
If the property `ChooseLocationOnMap` is set to `true`, then the action will open a map, and user will get to choose a ___location on the map, otherwise, it will fetch user's current device ___location.
38
+
When the optional parameter property `ChooseLocationOnMap` is set to `true`, the action will open a map, and user will get to choose a ___location on the map. If set to `false` (*the default setting*), it will fetch user's current device ___location.
36
39
37
-
### Show Location:
40
+
### Show Location
38
41
39
-
With this action, a map shows up on the screen on which you can either show the user's current ___location on the map or you can show your specified coordinates on the map.
42
+
The `VivaAction.ShowLocation` action displays a map that displays the user's current ___location on the map or a specified ___location:
40
43
41
-
The ACE action for Show Location is: `VivaAction.ShowLocation`.
44
+
```json
45
+
{
46
+
action: {
47
+
type: 'VivaAction.ShowLocation',
48
+
parameters: {
49
+
locationCoordinates: {
50
+
latitude: 28.6132039578389,
51
+
longitude: 77.229488240066
52
+
}
53
+
}
54
+
}
55
+
}
56
+
```
42
57
43
58
It takes an optional ___location parameter: `locationCoordinates`.
44
59
45
-
To show a specific ___location, you should pass the ___location coordinates (latitude and longitude) via the `locationCoordinates` parameter.
60
+
To show a specific ___location, set the optional `locationCoordinates` property the ___location coordinates (*latitude and longitude*).
46
61
47
62
The `locationCoordinates` object consists of the following properties:
48
63
@@ -143,36 +158,39 @@ The following examples describe the geolocation action and their purpose.
143
158
If you don't want to write code, but still wish to see how the geolocation actions work, then you can explore [this tutorial](./GeolocationPropertyPane.md) which lets you create cards with geolocation actions via property pane.
144
159
145
160
> [!NOTE]
146
-
> Theses geolocation actions can be added on the card view or the buttons of the card view or inside the quick view.
161
+
> Theses geolocation actions can be added on the CardView or the buttons of the CardView or inside the QuickView.
147
162
148
163
### Permission and error codes
149
164
150
-
For the ___location APIs to work, the user has to grant the permission to access device's ___location.
151
-
165
+
For the ___location APIs to work, the user must grant the browser permission to access device's ___location.
152
166
153
167
Error Code | Error Description
154
168
----------------- | -----------------
155
169
PermissionDenied | User has denied the permission to access ___location
156
170
InternalError | An unexpected error happened while invoking the ___location APIs
157
171
HostNotSupported | The ___location action is being used in an unsupported environment
158
172
159
-
160
173
### Callbacks for Card Developers
161
174
162
175
When the action `VivaAction.GetLocation` is invoked, we pass the fetched ___location coordinates via the onAction callback.
163
176
164
177
> [!NOTE]
165
-
> onAction callback is not invoked for `VivaAction.ShowLocation`.
178
+
> `onAction` callback is not invoked for `VivaAction.ShowLocation`.
166
179
167
-
For actions: `VivaAction.GetLocation` and `VivaAction.ShowLocation`, if the user lands into an error state, then an onError callback will get invoked, to which we pass the action name and the error code.
180
+
For actions: `VivaAction.GetLocation` and `VivaAction.ShowLocation`, if the user lands into an error state, then an `onError` callback will get invoked, to which we pass the action name and the error code.
168
181
169
182
### Availability of geolocation actions
170
183
171
184
> [!NOTE]
172
-
> These new actions are **only available in the browser** currently. Viva Connections desktop and Viva Connections mobile support will be enabled later.
185
+
> These new actions are currently **only available in the browser**. Viva Connections desktop and Viva Connections mobile support will be enabled later.
186
+
173
187
After General Availability the support matrix for actions will look like:
Copy file name to clipboardExpand all lines: docs/spfx/viva/get-started/actions/geolocation/GeolocationPropertyPane.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Explore Geolocation capability via property pane of card-desinger card in Adaptive Card Extension
3
3
description: Geolocation is a new action that the SharePoint Adaptive Card Extension framework supports, and in this tutorial we see how we can explore this capability via the property pane of the card-designer card.
4
-
ms.date: 04/06/2022
4
+
ms.date: 03/08/2023
5
5
ms.localizationpriority: high
6
6
---
7
7
@@ -68,3 +68,7 @@ You can now check out the three geolocation actions that you introduced via the
68
68
69
69
> [!NOTE]
70
70
> This property-pane experience doesn't allow you to introduce onAction callback, and hence the action `Select ___location from a map` is actually a no-op.
71
+
72
+
## See Also
73
+
74
+
-[Microsoft Learning: Create Adaptive Card Extensions (ACE) for Microsoft Viva Connections](/training/modules/sharepoint-spfx-adaptive-card-extension-card-types)
Copy file name to clipboardExpand all lines: docs/spfx/viva/get-started/actions/geolocation/GeolocationTutorial.md
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Create an Adaptive Card Extension with geolocation action
3
3
description: Step by step guide on creating Adaptive Card Extension for Geolocation action.
4
-
ms.date: 04/06/2022
4
+
ms.date: 03/08/2023
5
5
ms.localizationpriority: high
6
6
---
7
7
# Create an Adaptive Card Extension with geolocation action
@@ -100,7 +100,6 @@ to the `IGeoLocationAdaptiveCardExtensionStrings` interface.
100
100
101
101
As mentioned earlier, on the Card View, we will add a button, which will show user their current ___location and on clicking the Card View, we will show the Quick View experience.
102
102
103
-
104
103
We will first add the functionality for the button on the Card View. For this, locate and open the following file in your project: **./src/adaptiveCardExtensions/geoLocation/cardView/CardView.ts**
105
104
106
105
Here, replace the definition of `cardButtons` function with the following:
@@ -274,3 +273,7 @@ So now, whenever the `VivaAction.GetLocation` action is triggered from your Quic
274
273
At this point, you can run **gulp serve** again and see how all the changes you made so far came together.
275
274
276
275
This is it! Congratulations on successfully creating you Adaptive Card Extension with geolocation actions.
276
+
277
+
## See Also
278
+
279
+
-[Microsoft Learning: Create Adaptive Card Extensions (ACE) for Microsoft Viva Connections](/training/modules/sharepoint-spfx-adaptive-card-extension-card-types)
description: Media upload is a new action that the SharePoint Adaptive Card Extension framework supports, which enables third party developers to upload data content to sharepoint.
4
-
ms.date: 01/09/2023
4
+
ms.date: 03/08/2023
5
5
---
6
6
# Media upload in Adaptive Card Extension
7
7
8
+
Microsoft added support for an action to upload media, unique to Viva Connections, in the [SharePoint Framework (SPFx) v1.15.2](../../../../release-1.15.2.md) release.
9
+
8
10
> [!NOTE]
9
-
> The media upload capability in Adaptive Card Extension is available in SPFx v1.15.2.
10
-
>
11
-
> For more information on installing the SPFx v1.15.2, see [SharePoint Framework v1.15.2 release notes](../../../../release-1.15.2.md).
12
-
>
13
-
> This tutorial also assumes that you have already built a SharePoint Adaptive Card Extension.
11
+
> This tutorial also assumes that you've already built an SPFx Adaptive Card Extension.
14
12
>
15
-
> To learn how to create your first SharePoint Adaptive Card Extension, try out [this tutorial](../../../get-started/build-first-sharepoint-adaptive-card-extension.md).
13
+
> To learn how to create your first SPFx Adaptive Card Extension, try out [this tutorial](../../../get-started/build-first-sharepoint-adaptive-card-extension.md).
16
14
17
15
## Action type for media upload
18
16
19
17
### Select Media
20
18
21
-
Allows users to upload media content via an Adaptive Card Extension (ACE). The current size limitation is 1 MB per image. A user may specify any image type to be uploaded. **Note**: _If an image type isn't specified, then an error indicating only images can be uploaded will show up._
19
+
Allows users to upload media content via an Adaptive Card Extension (ACE). The current size limitation is 1 MB per image. A user may specify any image type to be uploaded.
20
+
21
+
> [!WARNING]
22
+
> If an image type isn't specified, then an error indicating only images can be uploaded is displayed.
22
23
23
24
The ACE action for Select Media is: `VivaAction.SelectMedia`.
24
25
26
+
```json
27
+
{
28
+
"type": "VivaAction.SelectMedia",
29
+
"id": "Select Media",
30
+
"title": "Select Files",
31
+
"parameters": {
32
+
"mediaType": "MediaType.Image"
33
+
}
34
+
}
35
+
```
36
+
25
37
The parameters that it takes are as follows:
26
38
27
39
-`mediaType`: Currently set as image by default. Audio and documents, such as PDFs, are supported as well.
@@ -52,80 +64,81 @@ The parameters that it takes are as follows:
52
64
}
53
65
```
54
66
55
-
_Note: If a user uploads a file that is not supported in the format parameters, an error code of **InCorrectFileFormat** will be raised_
67
+
> [!WARNING]
68
+
> If a user uploads a file that is not supported in the format parameters, an error code of **InCorrectFileFormat** is thrown.
56
69
57
70
## Tutorial and Examples
58
71
59
72
You can take a look at [this tutorial](./MediaUploadTutorial.md) which goes over a step by step guide on how to create a card with the available media upload action.
60
73
61
74
1.**Upload an image**
62
-
75
+
63
76
In your template json file, add the following action:
64
-
77
+
65
78
```json
66
79
"actions": [
67
-
{
68
-
"type": "VivaAction.SelectMedia",
69
-
"id": "Select Media",
70
-
"title": "Upload Image",
71
-
"parameters": {
72
-
"mediaType": MediaType.Image
73
-
}
80
+
{
81
+
"type": "VivaAction.SelectMedia",
82
+
"id": "Select Media",
83
+
"title": "Upload Image",
84
+
"parameters": {
85
+
"mediaType": MediaType.Image
74
86
}
87
+
}
75
88
]
76
89
```
77
90
78
91
1. **Upload multiple images**
79
-
92
+
80
93
In your template json file, add the following action:
81
-
94
+
82
95
```json
83
96
"actions": [
84
-
{
85
-
"type": "VivaAction.SelectMedia",
86
-
"id": "Select Media",
87
-
"title": "Upload Image",
88
-
"parameters": {
89
-
"mediaType": MediaType.Image,
90
-
"allowMultipleCapture": true
91
-
}
97
+
{
98
+
"type": "VivaAction.SelectMedia",
99
+
"id": "Select Media",
100
+
"title": "Upload Image",
101
+
"parameters": {
102
+
"mediaType": MediaType.Image,
103
+
"allowMultipleCapture": true
92
104
}
105
+
}
93
106
]
94
107
```
95
108
96
109
1. **Upload only JPG images**
97
-
110
+
98
111
In your template json file, add the following action:
99
-
112
+
100
113
```json
101
114
"actions": [
102
-
{
103
-
"type": "VivaAction.SelectMedia",
104
-
"id": "Select Media",
105
-
"title": "Upload Image",
106
-
"parameters": {
107
-
"mediaType": MediaType.Image,
108
-
"supportedFileFormats": "jpg"
109
-
}
115
+
{
116
+
"type": "VivaAction.SelectMedia",
117
+
"id": "Select Media",
118
+
"title": "Upload Image",
119
+
"parameters": {
120
+
"mediaType": MediaType.Image,
121
+
"supportedFileFormats": "jpg"
110
122
}
123
+
}
111
124
]
112
125
```
113
126
114
127
1. **Upload allow only small images to be uploaded**
115
128
116
129
In your template json file, add the following action:
117
-
130
+
118
131
```json
119
132
"actions": [
120
-
{
121
-
"type": "VivaAction.SelectMedia",
122
-
"id": "Select Media",
123
-
"title": "Upload Image",
124
-
"parameters": {
125
-
"mediaType": MediaType.Image,
126
-
"supportedFilemaxSizePerFileFormats": 1000
127
-
}
133
+
{
134
+
"type": "VivaAction.SelectMedia",
135
+
"id": "Select Media",
136
+
"title": "Upload Image",
137
+
"parameters": {
138
+
"mediaType": MediaType.Image,
139
+
"supportedFilemaxSizePerFileFormats": 1000
128
140
}
141
+
}
129
142
]
130
143
```
131
144
@@ -141,6 +154,10 @@ If you don't want to write up a new ACE but still want to see the media upload i
141
154
> [!NOTE]
142
155
> Currently this feature is not supported in teams mobile and will throw an error indicating that this.
Copy file name to clipboardExpand all lines: docs/spfx/viva/get-started/actions/media-upload/MediaUploadPropertyPane.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,14 @@
1
1
---
2
2
title: Explore Media Upload capability via property pane of card-designer card in Adaptive Card Extension
3
3
description: Media Upload is a new action that the SharePoint Adaptive Card Extension framework supports. In this tutorial we'll see how we can explore this capability via the property pane of the card-designer card.
4
-
ms.date: 08/09/2022
4
+
ms.date: 03/08/2023
5
5
ms.localizationpriority: high
6
6
---
7
7
8
8
# Explore Media Upload capability via property pane of card-designer card in Adaptive Card Extension
9
9
10
10
In this tutorial we'll see how we can explore this capability via the property pane of the card-designer card.
11
11
12
-
we'll:
13
-
14
12
- Update the card strings
15
13
- Introduce media upload actions on the card view, primary button, and secondary button.
16
14
@@ -59,7 +57,11 @@ Finally, for the `Secondary Button`, set the `Title` to `Select multiple media`
59
57
Now close the property pane and click `Preview` from the top right hand corner of the page:
60
58
61
59
- Click on the card to open up media upload and exit
62
-
- Clicking `Select single media` will pull open the same modal
60
+
- Clicking `Select single media` will pull open the same modal
63
61
- Clicking `Select multiple media` will open up the same modal but will allow the user to upload several files at once
64
62
65
-

63
+

64
+
65
+
## See Also
66
+
67
+
-[Microsoft Learning: Create Adaptive Card Extensions (ACE) for Microsoft Viva Connections](/training/modules/sharepoint-spfx-adaptive-card-extension-card-types)
0 commit comments