Forum Discussion
localTimezone missing from Activity in iOS
vannyconoza -
We have tested this using below code and In android we are getting localtimezonevalue.
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var localetimezone = turnContext.Activity.Entities[0].Properties.ToString(); ;
var reply = MessageFactory.Text(localetimezone);
await turnContext.SendActivityAsync(reply, cancellationToken);
}
Ref Doc: Get context for your Microsoft Teams bot - Teams | Microsoft Learn
Could you please share the code snippet which you are trying? Are you getting localtimezone in Teams web and desktop client?
Nivedipa-MSFT The localTimezone is missing from
The value is present when message extension is used in Desktop/Web Client, but is missing on mobile.
- Nivedipa-MSFTNov 16, 2022
Microsoft
vannyconoza
We have tested this using TeamsActivityHandler.handleTeamsMessagingExtensionSubmitAction
method but still in android we are getting localtimezone value.
Could you please update the Teams version and check again?- vannyconozaNov 16, 2022Copper Contributor
Nivedipa-MSFT Just tested on ios, Teams version is updated (version 4.19.0), running on iOS 16.1.
Below is the context. No localTimezone in context.activity, no timezone in context.activity.entities[0]{ "_respondedRef": { "responded": false }, "_turnState": { "turn": { "locale": "en-US" } }, "_onSendActivities": [], "_onUpdateActivity": [], "_onDeleteActivity": [], "_turn": "turn", "_locale": "locale", "bufferedReplyActivities": [], "_adapter": { "middleware": { "middleware": [ null ] }, "settings": { "appId": "<appId>", "appPassword": "<appPassword>" }, "credentials": { "name": "MicrosoftAppCredentials", "appId": "<appId>", "tenant": "botframework.com", "oAuthEndpoint": "https://login.microsoftonline.com/botframework.com", "oAuthScope": "https://api.botframework.com" }, "credentialsProvider": { "name": "SimpleCredentialProvider", "appId": "<appId>" }, "isEmulatingOAuthCards": false, "authConfiguration": { "requiredEndorsements": [] } }, "_activity": { "name": "composeExtension/submitAction", "type": "invoke", "timestamp": "2022-11-16T18:10:52.806Z", "localTimestamp": "2022-11-16T18:10:52.806Z", "id": "f:783fa7b6-c86b-55f5-0ffc-d9c5dc2abd1e", "channelId": "msteams", "serviceUrl": "https://smba.trafficmanager.net/apac/", "from": { "id": "29:1h_HSr4azCfMbIlf7mWvY3-ot-GEgd9WefL2wGDwg24mR1n1NcRkzqxAVFW5SdoMpaGm_JGeZczJ-EIqfmLur4Q", "name": "Vanny Conoza", "aadObjectId": "4e1a9e1d-017f-4585-897b-c53f5c056efb" }, "conversation": { "isGroup": true, "conversationType": "channel", "tenantId": "d19780c8-d5df-4eee-84b0-dcac4f1fbfde", "id": "19:7ixebHp2E-koa1L8rn-dizrPLcqL6kROYvU1Nsivvu41@thread.tacv2" }, "recipient": { "id": "28:9dd5378d-4419-48cf-933a-dcaa161083a6", "name": "Pigeonhole Live Bot" }, "entities": [ { "locale": "en-US", "country": "SG", "platform": "iOS", "type": "clientInfo" } ], "channelData": { "channel": { "id": "19:7ixebHp2E-koa1L8rn-dizrPLcqL6kROYvU1Nsivvu41@thread.tacv2" }, "team": { "id": "19:7ixebHp2E-koa1L8rn-dizrPLcqL6kROYvU1Nsivvu41@thread.tacv2" }, "tenant": { "id": "d19780c8-d5df-4eee-84b0-dcac4f1fbfde" }, "source": { "name": "compose" }, "legacy": { "replyToId": "1:1zJr2iwmQ-o2PHY1__YULWWz4xJSGZm_ibZjGx51c2vk" } }, "replyToId": "0", "value": { "commandId": "createQuestionAnswer", "data": { "type": "workspaceSelection", "workspace": "<appRelatedData>" }, "state": "", "tabContext": {}, "context": { "theme": "dark" } }, "locale": "en-US", "rawTimestamp": "2022-11-16T18:10:52.806Z", "rawLocalTimestamp": "2022-11-17T02:10:52.806+08:00", "callerId": "urn:botframework:azure" } }
- vannyconozaNov 16, 2022Copper ContributorSeems to be a raised issue even before here: https://stackoverflow.com/questions/53282405/microsoft-teams-get-timezone-of-user