Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2473] TiAPI: Add support for RequestHeaders for ImageViews

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-11-28T18:58:09.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsModule Development Guide
Labelsdemo_app, imageview
ReporterRene Pot
AssigneeRene Pot
Created2017-02-16T14:38:05.000+0000
Updated2018-11-28T18:58:18.000+0000

Description

A lot of times an image requires requestheaders, like oAuth/basic auth or others before it can be loaded. Right now a workaround is needed to get these images (doing a XHR call to fetch images, then insert it into imageview). However, by adding support for requestheaders to ImageViews a workaround would not be needed anymore. A possible example of implementation:
Ti.UI.createImageView({
    url: 'http://example.com/my_image.png',
    requestHeaders: {
        'Authorization' : 'Bearer myToken'
    }
});

Comments

  1. Sharif AbuDarda 2017-02-16

    Hello, Thanks for submitting the ticket. Our engineers will consider it.
  2. Hans Knöchel 2017-03-15

    PR (iOS, master): https://github.com/appcelerator/titanium_mobile/pull/8888 PR (iOS, 7_1_X): https://github.com/appcelerator/titanium_mobile/pull/9853 Test-Case:
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
       
       var image = Ti.UI.createImageView({
           image: 'http://hans-knoechel.de/test/test.png',
           requestHeaders: {
               'Authorization' : 'Basic ' + Titanium.Utils.base64encode('hans:test')
           }
       });
       
       win.add(image);
       win.open();
       
    Awaiting Android and Windows before reviewing this. Probably rather going into 6.2.0, since Android could take time.
  3. Abir Mukherjee 2017-08-17

    [~gmathews] Is this feature going into 6.2.0 for Android? [~kiguchi] Same question to you for Windows. cc: [~emerriman]
  4. Hans Knöchel 2017-08-21

    Moved out of 6.2.0 as we are close to RC at this point.
  5. Rene Pot 2017-10-20

    Will this get into the 6.3 release?
  6. Hans Knöchel 2017-10-20

    No, it's scheduled for 7.0.0 (see above).
  7. Vijay Singh 2017-11-13

    [~hknoechel] Can you add an image at given url (http://hans-knoechel.de/test/test.png) in test case. Thanks.
  8. Hans Knöchel 2017-11-13

    [~vijaysingh] URL restored. [~lchoudhary] I don't think Android / Windows has been implemented for this feature, yet. I recommend to push it out of 7.0.0 as there were also no community efforts here, which was the initial plan here.
  9. Yordan Banev 2017-12-06

    PR (Android): https://github.com/appcelerator/titanium_mobile/pull/9660
  10. Kota Iguchi 2018-02-09

    I just split out Windows component target to TIMOB-25764; because I'm not yet sure if we can make Windows Ti SDK ready for 7.1.0.
  11. Lokesh Choudhary 2018-02-22

    Found issues commented in the PR's for android.
  12. Hans Knöchel 2018-05-15

    For all watchers: We decided to go with a CommonJS module here that will make sure of the existing Ti.Network.HTTPClient. It will be released via Github and won't require an SDK update.
  13. Rene Pot 2018-09-03

    repository published: https://github.com/appcelerator-modules/ti.imageview http://npmjs.com/package/ti.imageview
  14. Rene Pot 2018-11-28

    Resolving issue after moving it to the MOD project since this was implemented using a commonjs module https://github.com/appcelerator-modules/ti.imageview

JSON Source