0

I have successfully opened the blackberry access from our IOS app using the url scheme access://open? , but it seems to be not working on Android. Our application is not integrated with blackberry sdk .

Rango
  • 71
  • 8

2 Answers2

0

There is a setting the in application configuration policy for BlackBerry Access that enables or disables this feature. It's called "Allow external apps to open HTTP/HTTPS URLs through BlackBerry Access" and is set for the app config for BlackBerry Access within BlackBerry UEM. This setting applies to all non BlackBerry Dynamics methods of opening BlackBerry Access.

If you were to integrate with the BlackBerry Dynamics SDK the recommended method is to use the BlackBerry Dynamics Shared Services framework to call the Open HTTP URL Service. It's available for both iOS and Android. Here's some Android sample code to use it.

Here's a code snippet that does just that:

private static final String SERVICE_ID = "com.good.gdservice.open-url.http";
private static final String SERVICE_VERSION = "1.0.0.0";
private static final String ACCESS_ENTITLEMENT_ID = "com.good.gdgma";
private static final String HTTP_OPEN_URL_SERVICE_METHOD_NAME = "open";

....

//Get the service providers for the Open HTTP URL service.

List<GDServiceProvider> providers = GDAndroid.getInstance().getServiceProvidersFor(SERVICE_ID, SERVICE_VERSION,
        GDServiceType.GD_SERVICE_TYPE_APPLICATION);

//Ensure an provider of the Open HTTP URL service was found.
if(providers == null || providers.size() == 0)
{
    //No providers found.
    showError("No Open HTTP URL were found.");
}
else
{
    boolean foundAccess = false;
    String yourURL = "www.whereEverYouWantToGo.com";
    for (int count = 0; count < providers.size(); count++)
    {
        GDServiceProvider provider = providers.get(count);

        //Ensure BlackBerry Access was found.
        if (provider.getIdentifier().equalsIgnoreCase(ACCESS_ENTITLEMENT_ID))
        {
            foundAccess = true;

            String address = providers.get(count).getAddress();
            Map<String, Object> params = new HashMap<>();
            params.put("url", yourURL);

            try
            {
                //Launch BlackBerry Access.
                GDServiceClient.sendTo(address, SERVICE_ID, SERVICE_VERSION,
                        HTTP_OPEN_URL_SERVICE_METHOD_NAME, params, null,
                        GDICCForegroundOptions.PreferPeerInForeground);
            } catch (GDServiceException e)
            {

                showError(e.toString());
            }
        }
    }

    if (!foundAccess)
    {
        showError("BlackBerry Access not found.");
    }
}
MSohm
  • 815
  • 6
  • 11
  • We are not using Blackberry dynamics sdk . On Android i have got the access open using the access app-id com.good.gdgma – Rango Aug 04 '20 at 16:35
0

For anyone who needs it you can open the blackberry access from your app using the blackberry access appid com.good.gdgma.

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse(urlString));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setPackage("com.good.gdgma");
    try {
        getApplicationContext().startActivity(intent);
    }
    catch(ActivityNotFoundException ex) {
        showNotInstalledDialog(App.BLACKBERRY_ACCESS);
    }
Rango
  • 71
  • 8
  • Note that the code sample above can be blocked if the BlackBerry Access application configuration setting "Allow external apps to open HTTP/HTTPS URLs through BlackBerry Access" is disabled. If this is disabled BlackBerry Access will give the error "External URLs are blocked by policy". The Open HTTP URL Service described in the previous answer will work regardless of that policy setting. Both solutions are valid, just wanted to list the potential error you could get from this depending on the BlackBerry Access configuration. – MSohm Oct 13 '20 at 15:06