Questions » Recent Q&A » Redirect URL to Blackberry Access

Redirect URL to Blackberry Access

Posted Oct 10 2018, 11:42 AM
  • The recommended approach is to use a BlackBerry Dynamics Shared Service call to open a URL in BlackBerry Access.  Here is a code snippet that shows how this can be done:

     

    public static final String SERVICE_PROVIDER = "com.good.gdgma";;
    public static final String SERVICE_NAME = "com.good.gdservice.open-url.http";;
    public static final String SERVICE_VERSION = "1.0.0.0";
    public static final String SERVICE_METHOD = "open";

    private Map<String,Object> parameters = new HashMap<String,Object>();      //create new Map<String,Object> called parameters
    parameters.put("url", "Some_URL_value");      // e.g. "https://mydomain.com/myPath/myFile.html"

    GDServiceClient.sendTo(SERVICE_PROVIDER,      // ID of the Shared Service provider
                        SERVICE_NAME,      // ID of the Shared Service (see Shared Service documentation for com.good.gdservice.open-url.http)
                        SERVICE_VERSION,     // Version of the Shared Service
                        SERVICE_METHOD,     // Name of the Shared Service's method
                        parameters,     // The Shared Service's parameters object
                        null,     // No file attachments so the array is null
                        GDICCForegroundOptions.PreferPeerInForeground);

  • Thanks Mark.

    I tried your solution but nothing happened. The method didn't even throw an exception. The code was executed,  but the url wasn't send. We tried running BBAccess afterwards as well, to check whether it is an app opening issue or data sending one. It appears to be later. Can you throw some light on the possible reasons for this.

    Regards

  • Has your Activity making this call initialized BlackBerry Dynamics before making this call by calling GDAndroid.getInstance().activityInit(this);?
  • We have called this in the main Activity:

    GDAndroid.getInstance().activityInit(this);
    GDAndroid.getInstance().authorize(new GDEventListener() );
  • Has BlackBerry Access been activated with the same user on the same BlackBerry UEM server?  If so, please enable BlackBerry Dynamics debug logging (in your application's settings.json file) and post logs captured after your application makes that call.
  • Hi, I am also working on similar stuff. I too cannot see BB Access popping up and displaying my supplied url. BB Access is configured with the same user.

    I use below code to check if BB Access is installed

    public final String SERVICE_NAME = "com.good.gdservice.open-url.http"; 

    public final String SERVICE_VERSION = "1.0.0.0";

    public final String SERVICE_METHOD = "open";

    java.util.List<GDServiceProvider> SERVICES = GDAndroid.getInstance().getServiceProvidersFor(SERVICE_NAME, SERVICE_VERSION, GDServiceType.GD_SERVICE_TYPE_APPLICATION);

    For me SERVICES always returns empty due to which my further below code flow stops.

    // SendTo implementation

    java.util.Map<String, Object> parameters = new java.util.HashMap<>(); 

    parameters.put("url", url);

    try { 

    GDServiceClient.sendTo(SERVICE_PROVIDER, SERVICE_NAME, SERVICE_VERSION, SERVICE_METHOD, parameters, null,             GDICCForegroundOptions.PreferPeerInForeground); 

    } catch (final Exception gdServiceException) { 

    Logger.log(gdServiceException.getMessage()); 

    }

     

    settings.json

    { "GDLibraryMode": "GDEnterprise", "GDApplicationID": "com.xyz.abc", "GDApplicationVersion": "1.17.2", "GDConsoleLogger": [ "GDFilterAll" ] }

    Please help me on this.

  • This capability can be enabled and disabled by your BlackBerry UEM administrator.  It's possible this feature is disabled.  To verify, log into BlackBerry UEM and...

    1. Click on the Apps menu on the left.
    2. Select BlackBerry Access.
    3. Click on the policy link under "App configuration".
    4. Select the General tab.
    5. Verify if "Allow external apps to open HTTP/HTTPS URLs through BlackBerry Access" is checked.

     

  • @Mark Sohm, Thanks for your support. BlackBerry Access is popping up and url is loading as expected after changing the settings you mentioned.
Back