IBM Support

PI17422: TRYING TO OPEN A LOCAL IMAGE USING CORDOVA'S INAPPBROWSER FAILS WITH AN ERROR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Trying to open a local image using Cordova's InAppBrowser,
    fails with an error such as:
    
    InAppBrowser: Error loading url
    file:///storage/sdcard/DCIM/Camera/1398269673199.jpg:android.con
    tent.ActivityNotFoundException: No Activity found to handle
    Intent { act=android.intent.action.VIEW
    dat=file:///storage/sdcard/DCIM/Camera/1398269673199.jpg }
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All App developers of Worklight v6101 on Andorid OS.         *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * First reported in Stackoverflow:                             *
    * http://stackoverflow.com/questions/23499306/ibm-worklight-6- *
    * 1-0-1-unable-to-use-local-file-in-cordovas-inappbrowser-in-a *
    * n                                                            *
    *                                                              *
    * Trying to open a local image using Cordova's InAppBrowser,   *
    * it fails with an error.                                      *
    * Fails for :                                                  *
    * window.open("file:///storage/sdcard/DCIM/Camera/139826967319 *
    * 9.jpg","_system", "location=no");                            *
    *                                                              *
    * The error in Android 4.3's LogCat:                           *
    * 05-05 11:13:14.161: D/InAppBrowser(23539): InAppBrowser:     *
    * Error loading url                                            *
    * file:///storage/sdcard/DCIM/Camera/1398269673199.jpg:android *
    * .content.ActivityNotFoundException: No Activity found to     *
    * handle Intent { act=android.intent.action.VIEW               *
    * dat=file:///storage/sdcard/DCIM/Camera/1398269673199.jpg }   *
    *                                                              *
    * Doing the same, with a URL, works:                           *
    * window.open("www.google.com","_system", "location=no");      *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * None                                                         *
    ****************************************************************
    

Problem conclusion

  • window.open API of InAppBrowser cordova plugin was working with
    URL but not with Images. New Cordova snapshot has been
    integrated to provide the necessary fix.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI17422

  • Reported component name

    WORKLIGHT CONSU

  • Reported component ID

    5725I4301

  • Reported release

    610

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-05-07

  • Closed date

    2014-06-10

  • Last modified date

    2014-06-10

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WORKLIGHT CONSU

  • Fixed component ID

    5725I4301

Applicable component levels

  • R610 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSZH4A","label":"IBM Worklight"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"610","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 October 2021