cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Asset Manager - deep linking to other application on iPhone

former_member831473
Discoverer
0 Kudos

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

muhammad_rafay
Advisor
Advisor
0 Kudos

Did you verify that SAP Mobile Card has a URL schema defined as com.sap.content2go?

muhammad_rafay
Advisor
Advisor
0 Kudos

You can also verify by just going to your browser and type com.sap.content2go:// and it should open the SAP Mobile Card application. If it doesn't then the URL schema for SAP Mobile card is not com.sap.content2go

Accepted Solutions (0)

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

former_member831473
Discoverer
0 Kudos

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

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

As I mentioned, Apple (iOS) requires the listing of allowed url schemes be built into the client. I suspect the Asset Manager application does not include the Mobile Cards url scheme by default.

former_member831473
Discoverer
0 Kudos

Thank you Bill,

In Android device, 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. Is this expected behavior?

Regards,

Shyam

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

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');
        }
    });
}
abuzar1
Discoverer
0 Kudos

Hi Bill,

I'm also facing the same issue, i'm trying to call another application from SSAM with the valid url schema, but no luck with ios, it's working fine with android

Regards
Abuzar Baig

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.