How to implement deeplinks in KaiOS - deep-linking

A user should be able to click on a link like app:this/is/some/link?with=information and the desired app opens and does some action.
This question is similar but just the other side to
KaiOS - Share using WhatsApp. Another application should link to my application.
Is this possible in KaiOS?

Deeplinks do exist on KaiOS 2.5.3 or newer, but there is no documentation on them. For example, this is from the KaiStore app manifest:
"deeplinks": {
"regex": "^(app://)(kaios-store|kaios-plus)(.kaiostech.com)($|/$|/\\?(apps|postResult)=)",
"action": "open-deeplink"
},
"activities": {
"open-deeplink": {
"href": "./index.html",
"disposition": "window",
"filters": {
"type": "url",
"url": {
"required": true,
"pattern": "(app|rtsp|data):.{1,16384}"
}
},
"returnValue": true
},
}
The action under deeplinks points to one of the activities, which must accept a required URL parameter. An app can then register using navigator.mozSetMessageHandler to handle this activity (see B2G's Web Activities API).
That said, there is no way to deep-link to arbitrary apps. Apps must expose Web Activities in their manifest in order to be open-able by other apps.

Related

Microsoft Graph api responsible for creating notifications doesn’t work on mobile

I am working with below MS Graph API.
POST https://graph.microsoft.com/beta/teams/7155e3c8-175e-4311-97ef-572edc3aa3db/sendActivityNotification
Content-Type: application/json
{
"topic": {
"source": "text",
"value": "Weekly Virtual Social",
"webUrl": "Teams webUrl"
},
"previewText": {
"content": "It will be fun!"
},
"activityType": "eventCreated",
"recipient": {
"#odata.type": "microsoft.graph.channelMembersNotificationRecipient",
"teamId": "7155e3c8-175e-4311-97ef-572edc3aa3db",
"channelId": "19:0ea5de04de4743bcb4cd20cb99235d99#thread.tacv2"
}
}
Documentation here https://learn.microsoft.com/en-us/graph/teams-send-activityfeednotifications
I am successfully able to run the API for my bot application in Teams Desktop APP - meaning the notifications created by the app are visible in the activity feed in the MS desktop app.
But the same notifications are not seen in the mobile app of MS Teams for both Android and iOS.
To be noted: I can see the push notification on the iOS but if click on the banner it opens up the Teams App but that particular notification is not present there.
Is that the limitation from the API or something else that needed to be configured?
The behaviour is quite strange here, If the payload has a topic like below that is "source": "text" will show the push notifications but not in the feed.
"topic": {
"source": "text",
"value": "Weekly Virtual Social",
"webUrl": "Teams webUrl"
},
But, after updating the topic like below source: 'entityUrl' works and show the notifications in the feed.
topic: {
source: 'entityUrl',
value: `https://graph.microsoft.com/v1.0/teams/...../`,
},
Just a note, if one wants to link the notification to a certain message - meaning if you click the notification it'll take to that particular message. Use the below value.
https://graph.microsoft.com/v1.0/teams/${team_id}/channels/${channel_id}/messages/${reply_to_id}

Can't add Teams bot to a channel

This was originally a support ticket to Microsoft. However they told they don't do dev support without paying for it. They directed me to Stack Overflow, so here goes nothing.
I'm developing a Bot for Microsoft Teams. I have registered my bot with Azure Active Directory, & Bot Framework. I have uploaded my app to Team, without any errors. My bot is currently able to send direct messages to Teams users. However, when I try to add my bot to a Teams channel, I get unhelpful errors.
I click the dropdown under my app in the Apps tab:
I click "Add to a Team", then select a channel:
After clicking the button "Set up a bot", I get the following error message:
I have checked & rechecked my webApplicationInfo.id & webApplicationInfo.applicationPermissions numerous times, and I'm at a loss for what could be amiss. I don't see how either of these fields could be wrong given, I can authenticate with both the Microsoft Graph & Bot Framework apis using these values. Here's a slightly redacted version of my Teams app manifest:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.15",
"id": "<TEAMS_APP_ID>",
"packageName": "ambition",
"developer": {
"name": "Ambition",
"websiteUrl": "https://ambition.com",
"privacyUrl": "https://ambition.com/privacy",
"termsOfUseUrl": "https://ambition.com/pages/terms"
},
"icons": {
"color": "logo_opaque_192x192.png",
"outline": "logo_transparent_32x32.png"
},
"name": {
"short": "Ambition",
"full": ""
},
"description": {
"short": "Motivate & Recognize",
"full": "Ask Marketing"
},
"accentColor": "#FFFFFF",
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"ambition.com"
],
"bots": [
{
"botId": "<AZURE_ACTIVE_DIRECTORY_CLIENT_ID>",
"scopes": [
"team",
"personal",
"groupchat"
],
"isNotificationOnly": true
}
],
"webApplicationInfo": {
"id": "<AZURE_ACTIVE_DIRECTORY_CLIENT_ID>",
"resource": "https://ambition.com",
"applicationPermissions": [
"Channel.ReadBasic.All",
"ChannelMessage.Send",
"Group.Read.All",
"Notifications.ReadWrite.CreatedByApp",
"Team.ReadBasic.All",
"User.Read",
"User.ReadBasic.All"
]
}
}
The webApplicationInfo section is really only for two things: Tab SSO, and Resource-Specific Consent. Are you trying to implement either one of those? If not, removing it is definitely the best option, as you've noted in your answer.
In addition, I see that the resource values you've put in there are Microsoft Graph Scopes, whereas the applicationPermissions section is expecting a different list of options (they look kind of similar, but their not the same thing). See here for more: https://learn.microsoft.com/en-gb/microsoftteams/platform/graph-api/rsc/resource-specific-consent#resource-specific-permissions
Don't really know why this works, but I compared my app manifest to the one generated by going through this tutorial: https://learn.microsoft.com/en-us/microsoftteams/platform/build-your-first-app/build-bot.
Removing the webApplicationInfo property from my manifest fixed the issue. Don't really understand why it was causing a problem in the first place.
https://learn.microsoft.com/en-us/microsoftteams/platform/resources/schema/manifest-schema#webapplicationinfo

Slack API - how to send multiple images so they are shown in a gallery

When I send multiple images via api using blocks like this:
{
"blocks": [
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Please enjoy this photo of a kitten"
},
"image_url": "http://placekitten.com/500/500",
"alt_text": "An incredibly cute kitten."
},
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Please enjoy this photo of a kitten"
},
"image_url": "http://placekitten.com/500/500",
"alt_text": "An incredibly cute kitten."
},
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Please enjoy this photo of a kitten"
},
"image_url": "http://placekitten.com/500/500",
"alt_text": "An incredibly cute kitten."
}
]
}
Slack shows them like a separate blocks and doesn't combine them into a gallery:
slack screenshot - API
When I upload them using Slack app in one message - it combines them into a gallery:
slack screenshot - with gallery
I've tried blocks, attachments, third-party urls, permalinks after file.upload - the result is the same, Slack doesn't combine them into gallery.
So, the question is - how do I make it that Slack shows several images in a gallery?
UPD:
Just got an answer from Slack developers support:
slack dev support answer screenshot
Unfortunately, horizontal/gallery formatting of images is not possible
using the block kit builder. However, I'm going to go ahead and pass
your email on to our product team so that they can take this into
consideration for future updates.
Based on your comment,
[...] permalinks after file.upload [...]
this related answer might help (I also added this clarification there).
When uploading files and collecting their permalinks, you must link them in the text param in the message payload (putting them in a mrkdwn block in the blocks param will not work).
In javascript, this looks like:
const result1 = await web.files.upload({...})
const result2 = await web.files.upload({...})
await web.chat.postMessage({
text: `Here are files in a gallery view <${result1.file.permalink| ><${result2.file.permalink| >`,
...
})

Open URL in browser from Message Button using Slack API

I am sending the users a slack message with a button through a Slack App. On every click of the button, I generate a new URL.
At the moment, I am able to return the URL back as a message. The user clicks on the message to open the URL in the browser.
Instead of the sending a message back, I want to open the URL directly in the browser using slack API.
How can I accomplish it? I can't seem to find anything in the documentation that does that.
Thanks
PS: Google Drive integration does that already.
It appears Slack introduced this feature recently.
As documented in https://api.slack.com/docs/message-attachments#link_buttons
"actions": [
{
"type": "button",
"text": "Book flights 🛫",
"url": "https://flights.example.com/book/r123456"
}
It's possible to preview in Slack's interactive message builder
Unfortunately slack does not support opening urls from message buttons.
You can monitor what slack is planning on releasing here though: https://trello.com/b/ZnTQyumQ/slack-platform-roadmap-for-developers :)
According to Slack, message attachments is the "old way" of composing messages, which will be deprecated in favour of the new Block Kit API.
I found this example on how to do button links on their docs, using the actions object in the message payload.
I haven't implemented it yet, but you can send the message to a channel in your workspace straight from the docs and try it, and it does open the link in the browser as expected.
Update 04/2022
{
"blocks": [
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View",
"emoji": true
},
"style": "primary",
"url": "https://flights.example.com/book/r123456"
}
]
}
]
}
Test on Slack Blockit Builder: Link

iOS Content Blocker Whitelist Website

In my content blocker, is there a way to prevent ad-blocking on a certain website? For example, if I want to block ads on all websites besides The Verge, is there a way to prevent the blocking rules I provided from affecting this page?
The above answer is unfortunately incorrect for two reasons, the url-filter attribute is required in the trigger and the if-domain attribute must be an array of domain(s), not a single value. After a lot of trial and error I have found a working solution to whitelist a website.
{
"trigger": {
"url-filter": ".*",
"if-domain": ["the verge.com"]
},
"action": {
"type": "ignore-previous-rules"
}
}
The only documentation I was able to find on what was causing various errors using the above answer was scouring the source code here: https://github.com/WebKit/webkit/tree/67985c34ffc405f69995e8a35f9c38618625c403/Source/WebCore/contentextensions
this article tells the solution http://comments.gmane.org/gmane.os.opendarwin.webkit.user/3971
{
"action": {
"type": "ignore-previous-rules"
},
"trigger": {
"url-filter": ".*",
"if-domain": ["*apple.com"]
}
}
I think you would do something like this.
"action": {
"type": “ignore-previous-rules”
},
"trigger": {
“if-domain”: “theverge.com”
}
Some good links to check out.
Safari Extensibility: Content Blocking and Shared Links
Safari Content Blocking in iOS 9: a tutorial by example

Resources