[MOD-2473] TiAPI: Add support for RequestHeaders for ImageViews
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-28T18:58:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.5.0 |
Components | Module Development Guide |
Labels | demo_app, imageview |
Reporter | Rene Pot |
Assignee | Rene Pot |
Created | 2017-02-16T14:38:05.000+0000 |
Updated | 2018-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
- Sharif AbuDarda 2017-02-16 Hello, Thanks for submitting the ticket. Our engineers will consider it.
- 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:
Awaiting Android and Windows before reviewing this. Probably rather going into 6.2.0, since Android could take time.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();
- 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]
- Hans Knöchel 2017-08-21 Moved out of 6.2.0 as we are close to RC at this point.
- Rene Pot 2017-10-20 Will this get into the 6.3 release?
- Hans Knöchel 2017-10-20 No, it's scheduled for 7.0.0 (see above).
- 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.
- 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.
- Yordan Banev 2017-12-06 PR (Android): https://github.com/appcelerator/titanium_mobile/pull/9660
- 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.
- Lokesh Choudhary 2018-02-22 Found issues commented in the PR's for android.
- 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.
- Rene Pot 2018-09-03 repository published: https://github.com/appcelerator-modules/ti.imageview http://npmjs.com/package/ti.imageview
- 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