on 02-02-2023 5:59 PM
Hi,
I am trying to open SAP Mobile cards application which is installed in my iPhone (followed tutorial https://developers.sap.com/tutorials/cp-mobile-dev-kit-deep-link.html). I am using latest SAM client (MDK 6.3.3) which is available in App Store.
Below is code what I tried. Here when I click on button, I am able to navigate to browser but SAP Mobile Cards application is not opening on button click. What could be the issue?
export default function OpenSAPMobileCard(context)
{
const utilsModule = context.nativescript.utilsModule;
return utilsModule.openUrl("com.sap.content2go://");
//return utilsModule.openUrl("https://www.google.com/");
}
Regards,
Shyam
Apple requires that you need to specify the list of allowed url schemes that your application can call in the info.plist for the client. I would bet the App Store client does not have that listed as a valid url scheme to call. Please try branding your own client and specify the values under App_Resources_Merge in your .mdkproject folder.
The tutorial uses the generic MDK client which includes com.sap.content2go as a valid url scheme to be called which is why you don't have issues there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Thanks for your reply.
When I run the same code in Android device (used latest SAM client which is available in Play store), the navigation is happening only when the SAP Mobile Cards app is running in the background. If not, then the navigation is not happening on button click. Where as in iOS, navigation is not happening in either cases. Is this known limitation with the respective device OS?
Regards,
Shyam
It looks like the Android mobile cards changed to use app links instead. We will be updating the tutorial with the change on how to call Mobile Cards on Android. In the meantime you can use the following.
export default function OpenSAPMobileCards(context) {
// Get the Nativescript Utils Module
const utilsModule = context.nativescript.utilsModule;
// Get the Nativescript Platform Module
const platformModule = context.nativescript.platformModule;
return context.executeAction('/MDKDeepLink/Actions/Confirmation.action').then((result) => {
if (result.data) {
//This will open SAP Mobile Cards app
if (platformModule.isIOS) {
return utilsModule.openUrl("com.sap.content2go://");
} else if (platformModule.isAndroid) {
return utilsModule.openUrl("https://mobileservices.cloud.sap/mobilecards");
}
} else {
return Promise.reject('User Deferred');
}
});
}
abuzar As I mentioned above, on iOS any url schemes you are trying to call must be pre-specified in the Info.plist of the client. If you are using the App Store SSAM client it most likely does not include the scheme you are trying to call. You will need to create your own branded SSAM client so you can specify the schemes you are wanting to use.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.