on 11-28-2022 1:26 PM
Hi,
I would like to be able to open my Mobile Service built application using some android link such as the one below
mdkclient://sap.com?ProductId=123
I found the doc explaining how to consume it using the OnLinkDataReceived
event (https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/features/fiori-ui/mdk/deep-link.html)
My question is: How to I "enable/register" this mdkclient scheme using the SAP MDK SDK?
i.e. How do I "Create an Intent Filter in the Manifest" using SAP MDK as explained below
Thanks
hi, maybe anyone of you guys that can answer my question? Launch MDK native app in Fiori web app | SAP Community
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ran a test using the following rule (which is essentially the same a yours)
export default function LinkDataReceived(context) {
let linkData = context.getAppEventData();
console.log("OnLinkDataReceived Event! " + linkData);
return context.executeAction({
"Name": "/DeepLink/Actions/Generic/MessageBox.action",
"Properties": {
"Message": "OnLinkDataReceived Event! " + linkData,
"Title": "Deep Link Received"
}
});
}
on an emulator and sent the deep link via adb using the following command
adb shell am start -a android.intent.action.VIEW -d deep1://Products?id=123
The client launches (if not running) and the OnLinkDataReceived event is fired resulting in the following output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bill, somehow I can't make it work...
Here is what I have done:
- updated my MDKProject.json with "UrlScheme": "myTestApp"
- deployed new version with updated code:
Application.app update:
- "OnLinkDataReceived": "/eMobilityPOC/Rules/Application/OnLinkDataReceivedHandler.js"
- OnLinkDataReceivedHandler.js code:
export default function OnLinkDataReceivedHandler(clientAPI) {- rebuilt my app using Mobile Cloub Build feature (Customized Mobile Development Kit Client and updated with my new zipped .mdkProject folder)
- installed the built .apk on my phone
Now when i generate a QRCode with content: myTestApp://?ProductId=123 then read it (using google lens for instance) I expect this link to open my newly installed app
I may be missing something obvious though (never worked with deep link and mobile app before)
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The second link is not specific to MDK. The url scheme used for receiving deep links in MDK is the URLScheme defined in the MDKProject.json used to create your client. If you are running the App/Play store client then they are using sapmobilesvcs as the URL scheme. The MDK client handles the registration for the scheme automatically. You simply need to specify the OnLinkDataReceived action to get triggered when the link is sent and act accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.