See for more details about the following standard intents.
Intent action | Description |
---|---|
pay | Send a payment to a user or to purchase an item. |
didtransaction | Record a DID request on the DID sidechain (ex: publish/update a DID). |
esctransaction | Execute a smart contract transaction on the ETH sidechain. |
dposvotetransaction | Record a vote for a list of supernodes on the ELA mainchain. |
credaccess | Get user information (name, email, …) from his DID profile. |
walletaccess | Get information about user’s wallet (Ex: ELA address). |
sign | Sign some binary content using a DID signature. |
Opens a given capsule.
Parameter | Description | Format |
---|---|---|
id | The application package id (ex: org.company.app) | string |
None
Raw Http GET request
http://scheme.elastos.org/app?id=org.company.app |
elastOS
appManager.sendIntent("app", {
id: "org.company.app"
}, ...)
Register user as using a given capsule, on his DID profile. After publishing this information to the DID sidechain, other users / friends can view that this user has a profile in the given app, and easily reach him there.
For example, if a developer creates CoolCapsule and CoolCapsule let users add friends and friends can write and read posts (similar to Facebook), Then CoolCapsule can ask its users to register their application profile. That profile will include a CoolCapsule-specific id in a VerifiableCredential. This way, when friends view this user’s profile from the DID sidechain, they can reach others through a connectapplicationprofile intent that will receive all the regiter custom information and therefore be able to immediatelly connect inside CoolCapsule.
Parameter | Description | Required | Format |
---|---|---|---|
identifier | Unique identifier for this profile inside the given app | Yes | string |
connectactiontitle | Description string to explain users viewing this profile (after registration on ID chain) what action they can expect if opening the target app | Yes | string or array of {lang:"", value:""} |
customcredentialtypes | Custom credential types to register with the app profile (as the application profile is a Verifiable Credential) | No | Array of strings |
sharedclaims | Claims to register to user’s DID document as basic profile credential, independencly from the generated ApplicationProfileCredential | No | Array of key->value |
[Any field] | Any custom field passed to the intent will be saved in the ApplicationprofileCredential | No | key->value |
None
elastOS
appManager.sendIntent("registerapplicationprofile", {
identifier: "did-demo-app-profile",
connectactiontitle: "Reach out in DID Demo capsule",
sharedclaims: [
{
diddemoid: "abcdef"
}
],
diddemoid:"abcdef"
}, ...)
Opens a target app using a ApplicationProfileCredential information registered using a registerapplicationprofile intent. The target app (usually the one that also called registerapplicationprofile) must register the connectapplicationprofile application in its manifest.
When opening, the app receives the original fields registered by registerapplicationprofile (ex: “diddemoid”).
Usually, as a capsule developer you don’t need to emit this intent. Instead, you will most likely listen to this intent emitted by the elastOS runtime.
All fields included in the ApplicationProfileCredential.
None
elastOS
appManager.sendIntent("connectapplicationprofile", {
identifier: "did-demo-app-profile",
diddemoid: "abcedf",
...
}, ...)
Received by the appManager.setIntentListener() callback.
{
identifier: "did-demo-app-profile",
diddemoid: "abcedf"
}
Intent emitted by the scanner capsule after scanning a QR code.
This intent is sent only if the scanner capsule was started manually by the user. Otherwise if the scanner app is started by scanqrcode intent, the scanned data will be received in the sendIntent() callback.
Parameter | Description | Format |
---|---|---|
data | The scanned content | string |
None
elastOS
appManager.sendIntent("handlescannedcontent", {data: "ABCDEF"}, ...)
Received by the appManager.setIntentListener() callback.
{
data: "ABCDEF"
}
Similar to handlescannedcontent, but the passed data is a DID string (ex: did:elastos:abcdef).
Requests the scanner capsule to scan a QR code and return the scanned data.
None
{
data: "ABCDEF"
}
elastOS
appManager.sendIntent("scanqrcode", {}, ...)
Received by the appManager.sendIntent() onSuccess callback.
{
data: "ABCDEF"
}
Shares some content either inside another elastOS capsule, or thr ough the native OS share feature.Shared content includes a title and a (optional) url.
It’s up to the receiving app to share the content in a suitable way. A chat application would show a new clickable message to a user, and when clicked, the “url” is activated. The built-in friends app would instead let the user pick a friend and send a remote notification to that friend with the embedded shared content.
Parameter | Description | Format |
---|---|---|
title | Title describing the share action. Visible by everyone | string |
url | Action url related to this shared content. For example, a link to open the target app in elastOS. Usually, this should be a elastos scheme link such as https://scheme.elastos.org/* | string |
None
elastOS
appManager.sendIntent("share", {
title: "Add me as a friend in elastOS",
url: "https://scheme.elastos.org/addfriend?did=did:elastos:abcdef"
}, ...)
None
Allows the user to add a given friend (by DID) to his friends list.
For example, the built-in friends app simply saved the target DID as a friends in the friends list, in order to be able to reach that friend later.
Adding a friend is not directly reciprocal, friends are not notified that a user is adding them. It’s up to the handling application to notify the friend if relevant.
Parameter | Description | Format |
---|---|---|
did | DID of the friend to be added | string |
None
elastOS
appManager.sendIntent("addfriend", {
did: "did:elastos:abcdef"
}, ...)
None
Allows an application to pick a friend from another application. This works between any apps, but the most standard use case is for an application to pick a friend from the global built-in friends app that contains lots of contacts.
Pick friend requests can be filtered to look for a specific credential type.
Parameter | Description | Format |
---|---|---|
singleSelection | Pick only one friend at a time if true, or multiple ones at the same time if false. Default: true | boolean |
filter | An optional “Filter” object | Filter |
Filter object:
Parameter | Description | Format |
---|---|---|
credentialType | An optional string to pick only friends that have a specific credential type in their public DID document | string |
Parameter | Description | Format |
---|---|---|
friends | A list of selected friends | Array |
Friend object:
Parameter | Description | Format |
---|---|---|
did | DID string of the friend (ex: “did:elastos:abc”). Mandatory. | DID string |
document | Full DID document of the friend. Optional | DID Document |
elastOS
appManager.sendIntent("pickfriend", {
singleSelection: true,
filter: {
credentialType: "ApplicationProfileCredential"
}
}, ...)
{
friends: [
{
did: "did:elastos:abcdef"
},
{
did: "did:elastos:123456"
}
]
}
Opens an external url on the native platform, using a native browser.
Parameter | Description | Format |
---|---|---|
url | Url to open | string |
None.
elastOS
appManager.sendIntent("openurl", {
url: "https://www.any.web.page.com"
}, ...)
Opens an app that can verify user information (name, email, …) and generate a verifiable credential(Eg. Vouch app).
Parameter | Description | Format |
---|---|---|
did | DID to use | string |
*fieldtype | Type of field to verify | string |
*fieldtype can be anything such as “email”, “name”, “age”, etc. It would be up to the application how to handle each type of field.
None
elastOS
appManager.sendIntent("credverify", {
did: "did:elastos:hjasdfYasdfhjlwHIUOasdHIOHASDasdF",
email: "[email protected]",
...
}, ...)