Static Tab with placeholder values not displayed - json

I am currently getting into Microsoft Team Apps and am trying to create a very simple tool.
All it should be is a static tab, that when visited embeds a certain website, that's given the groupId as a parameter. This is the format, that I have in mind for the contentUrl: https://foo.bar?groupId=\{groupId\}
The app consists only of two images, that are PNGs in 20x20px (transparent) and 96x96px (with background color) and the manifest (version 1.2).
The manifest contains all required fields:
$schema, manifestVersion, version, id, packageName, developer {name, websiteUrl, privacyUrl, termsOfUseUrl}, icons {color, outline}, description {short, full}, accentColor, permissions, validDomains, staticTabs [{entityId, name, contentUrl, scopes}]
An Id for the app has been generated at apps.dev.microsoft.com.
The upload of the custom app as zip file causes no error and I can see the app in the list of the installed applications. If I switch to a channel I can't see the tab which should be there without being explicitly added because it's a static tab. Adding it manually isn't possible because it's not shown in the list of "addable apps".
I tried some of the example apps from GitHub, but they seem outdated and at least partly can't be even read (Error while reading manifest.json).
Is this sufficient information to help me?
Edit: (anonymized manifest.json)
{
"$schema":
"https://statics.teams.microsoft.com/sdk/v1.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.2",
"version": "1.0.0",
"id": "12345678-abcd-efgh-1234-123456789012",
"packageName": "com.microsoft.teams.bar",
"developer": {
"name": "Foo Corp",
"websiteUrl": "https://foo.com",
"privacyUrl": "https://foo.com/privacy",
"termsOfUseUrl": "https://foo.com/termsofuse"
},
"icons": {
"color": "src/images/waldo-96x96.png",
"outline": "src/images/waldo-20x20.png"
},
"name": {
"short": "bar",
"full": "bar"
},
"description": {
"short": "Opens baz and does qux.",
"full": "Opens baz and does qux."
},
"accentColor": "#FFFFFF",
"permissions": ["identity", "messageTeamMembers"],
"validDomains": ["*.baz.com", "*.foo.com"],
"staticTabs": [
{
"entityId": "tabId",
"name": "example tab",
"contentUrl":
"https://foo.com/?teamId={teamId}&teamName={teamName}&channelId={channelId}&channelName={channelName}&locale={locale}&theme={theme}&entityId={entityId}&subEntityId={subEntityId}&upn={upn}&tid={tid}&groupId={groupId}&theme={theme}&isFullScreen={isFullScreen}",
"scopes": ["personal"]
}
]
}

I could see two issues in your manifest code:
Invalid GUID: 12345678-abcd-efgh-1234-123456789012 is not valid GUID.
Icons must be included in the package and referenced via relative paths in the manifest.
ex. waldo-96x96.png - Please place them inside zip file.
Please feel free to use Teams App Studio to create the manifest file. You can also use the existing form the sample code.

Related

Can my bot server retrieve any information in the app manifest?

I am adding a new static tab to an existing teams app.
One of the new features is that the chat will publish a deep link to the static tab. This is creating a dilemna when I am contemplating deployment.
Obviously I can’t put my entire application up here, but we can assume a situation like this:
The manifest I have in production that is in the App Store looks like this:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.9/MicrosoftTeams.schema.json",
"manifestVersion": "1.9",
"version": "2.0.1",
"id": "23232322-7676-4848-5555-44444444444",
"packageName": "xxxxx",
"developer": {
"name": "xxxxx",
"websiteUrl": "https://www.xxxx.com/",
"privacyUrl": "https://www.xxxx.com/legal/privacy",
"termsOfUseUrl": "https://www.xxxxx.com/legal/privacy"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "abra",
"full": "abra cadabra"
},
"description": {
"short": "short",
"full": "full"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "11111111-2222-3333-4444-555555555555",
"scopes": [
"personal"
],
"commandLists": [
{
"scopes": [
"personal"
],
"commands": [
{
"title": "Test",
"description": "Test"
}
]
}
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"token.botframework.com",
"teams.microsoft.com",
"*.ngroc.io"
]
}
And in my bot in response to the “Test” command I return a simple text message, i.e.
return await step.prompt('textPrompt', { prompt: 'In the next version we will have a test tab' })
Now in development, I have added the following section to the manifest (after “bots”)
"staticTabs": [
{
"entityId": "conversations",
"scopes": [
"personal"
]
},
{
"entityId": "testtab”,
"contentBotId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"name": “Go To Test Tab",
"scopes": [ "personal" ]
},
{
"entityId": "about",
"scopes": [
"personal"
]
}
],
And I have updated the value of the version from 2.0.1 to 2.1.0
Now, in response to the “Test” message I am returning an adaptiveCard that looks like this:
{
type: 'AdaptiveCard',
version: '1.3',
body: [],
actions: [
{
type: 'Action.OpenUrl',
title: 'Go To Test Tab',
url: ‘https://teams.microsoft.com/l/entity/23232322-7676-4848-5555-44444444444/testtab’
}
]
}
This works very nicely and when I press the “go to Test Tab” it opens up the test tab as desired.
My problem is with deploying.
If I submit my new manifest to the App Store, without updating my production server, those testing the new version will continue to get the message “In the next version we will have a test tab” and be missing the link to the new tab.
If I update my production server now, before the update in the App Store, my current users will get the adaptive card with the button that will fail if they press it.
Clearly, neither of these options are good.
Ideally, my response should be something like:
If tabExists() {
Return {… the adaptive card }
Else {
return await step.prompt('textPrompt', { prompt: 'In the next version we will have a ‘test tab })
}
However, I don't know how to write "tabExists()" - I was thinking maybe there was some way to access the version number from the bot manifest, or the list of static tabs, and use that information, but I am happy for alternative suggestions.
We can get the manifest version using below Graph API or using SDK method:
https://learn.microsoft.com/en-us/graph/api/appcatalogs-list-teamsapps?view=graph-rest-1.0&tabs=http#example-4-list-applications-with-a-given-id-and-return-the-submission-review-state
So, before sending the Adaptive Card or message, you can put a custom condition to check the manifest version and send the message accordingly.
You can check the manifest version as explained by Chetan, i tried the same and figured its actually not the best idea.
It always should be best practice to have a "production" and "test" server or something like that.
Having different manifest versions point to the same server and running checks which version you're on will more than likely lead to issues sooner or later.
I sometimes even have 3 different instances running (prod, staging, test) to try various builds and things.
You can check that in your code but imo its not advisable to do so.

"crbug/1173575, non-JS module files deprecated" Error in flutter

i created a json file with all the data required for my app, it was working fine but one image was showing error saying that it is from another domain, so i changed the image address to another image, and now it says
crbug/1173575, non-JS module files deprecated
i tried changing it back to the previous image and restarted the application it still shows the error.
{
"id": 1,
"name": "92.7",
"tagline": "on the ground by Rose",
"color": "blue",
"url": "https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png" ,
"img": "https://preview.redd.it/ls2yuc4501l61.jpg?width=512&auto=webp&s=be785e98bf288f69c0b0105fb2bce6ab807b20f4",
"category": "blackpink",
"disliked": false,
"order": 1
},
{
"id": 2,
"name": "92.7",
"tagline": "blood sweat and tears by BTS",
"color": "blue",
"url":"https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png",
"img":"https://m.media-amazon.com/images/M/MV5BZTQ3YmU4MjAtYzQ0NC00NjRjLThmMzYtMTE4MzgzMWJkNjliXkEyXkFqcGdeQXVyNDY5MjMyNTg#._V1_.jpg",
"category": "BTS",
"disliked": false,
"order": 2
}
Error was in the first pic, the second was showing fine but after changing it , now it doesnt start the application and shows the error i mentioned above. I'm using google chrome to run the application.
Delete your launch.json file as it is causing your app to not launch with the default configuration of flutter
I encounter the same error in one of my flutter web projects. you have to delete the launch.json file.
Here is path of file
.vscode -> launch.json
just delete launch.json and your project will run.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Launch Chrome against localhost",
"type": "dart"
}
]
}

How to designate Article Directory when publishing to Apple News using Terminal?

I have an article.json file (named as such) below that I want to connect to Apple News and test:
{
"version": "1.4",
"identifier": "TestArticle",
"title": "My First Article",
"language": "en",
"layout": { "columns": 1},
"components": [
{
"role": "title",
"text": "My First Article"
},
{
"role": "body",
"text": "This is just over the minimum amount of JSON required to create a valid article in Apple News Format. If you were to delete the dictionary enclosing this text, you'd be there."
}
],
"componentTextStyles": {
"fontName": "Lato",
"textColor": "#000",
"linkStyle": {
"highlight": {
"color": "#358fd4"
}
}
}
I downloaded XCode and the necessary Ruby gems, to enter relevant command lines. As specified in the documentation, my .papi file is formatted correctly as it fetched my channel information successfully. According to Apple's ReadMe, this is the command I have to enter to publish an article:
papi-client article publish <Article Directory>
The problem is, I'm not sure exactly what this article directory is, or how to locate it. As far as I knew, I would create something like the above "article.json" file and potentially use that as the directory. I've even tried using the file path for said file, with no success. What could be my next steps to get this off the ground?
Place the article along with any locally linked, i.e. bundle://, content in a folder then use this folder as the article directory.

How do you make manifest.json for Microsoft Teams bot?

I followed the online tutorial for constructing a bot in Visual Studio and deploying it Azure, and so far that seems to have worked. Now I want to add this bot to Microsoft Teams via the "Sideload a bot or tab" method. The online tutorial has NO explanation for what I need to do so I need some help. Here is the manifest.json I was currently trying to upload in a zip folder. Please help, I don't know how this process works.
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.0",
"version": "1.0.0",
"id": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"packageName": "com.testbot20170525114049",
"developer": {
"name": "Megan",
"websiteUrl": "https://website.com/",
"privacyUrl": "https://website.com/privacy",
"termsOfUseUrl": "https://website.com/app-tos"
},
"name": {
"short": "Botty"
}
"description": {
"short": "A sample bot to test the bot upload process"
}
"bots": [
{
"botId": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"needsChannelSelector": "true",
"scopes": [ "team", "personal" ]
}
]
}
Enable Public Developer Preview. The v1.0 manifest is fully supported in that mode, and while it may work in the public version, for now I'd switch to developer preview mode.
Make sure your manifest follows the v1.0 format. While your schema is close, there are a few required fields missing:
description.full
icons.outline
icons.color (note currently there is a 2k limit on file size)
accentColor
Zip the manifest and icons into a sideloadable package. Make sure the manifest.json is at the top level.
Follow the sideload instructions.

Chrome extension placeholder value for manifest field

I was wondering if it was possible to set a 'placeholder' value for a field in the manifest.json file of a Chrome extension. For example, I just started a new extension and my manifest looks like this :
{
"manifest_version": 2,
"author" : "My Name",
"name": "Extension Name",
"version": "0.0.1",
"description": "Desc",
"icons": { "16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png" },
"browser_action" : {
"default_title" : "Extension",
"default_icon" : {
"16": "icon32.png",
"48": "icon48.png",
"128": "icon128.png"
},
"default_popup" : "dropdown.html",
"js" : ["dropdown.js"]
},
"content_scripts" : [ {
"matches" : ["http://*/*, https://*/*"],
"js" : ["some_script.js"]
} ]
}
However, I have not yet made the icno*.png files so, obviously, whenever trying to load the extension, chrome says that it can't find the icon files.
Can I do something like :
//[...]
"default_icon" : {
//Will be added later
},
//[...]
or do I have to just delete the "browser_icon" and "icons" fields and add them later?
I found nothing in the Official Google Documentation.
In general, placeholder values are not permitted in the manifest.json. Many of the fields are checked for validity and/or that the resource is available when the manifest.json is loaded. This is necessary because these values are immediately used. Thus, they must be valid. The checking includes verifying the icon files for the browser_action and page_action keys. These files must exist for the extension to be loaded. Overall, what is required to be resolved, in order for the manifest.json to load, is explicitly stated in the error displayed when you attempt to load the unpacked extension from chrome://extensions/. You will need to resolve all errors in order for the extension to be loaded.
For icon files, you can usually delete the reference, or provide a placeholder icon file that contains an actual graphic. Personally, I just copy one of an assortment of icons I generally use, which are in the public domain, into a generically named icon file (e.g. icon.png, or myIcon.png, etc.). If you want, you could do a search for public domain icons which you could use for this purpose. There are a lot of choices.