[TIMOB-8969] iOS: TIBlob passed to application level event disappears
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 2.0.1, Release 3.1.0, Release 3.2.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | RTN, api, supportTeam |
Reporter | Nikhil Sharma |
Assignee | Unknown |
Created | 2012-05-02T18:42:27.000+0000 |
Updated | 2020-01-09T22:08:43.000+0000 |
Description
The TIBlob passed to Titanium.Media.openPhotoGallery.success is then passed to an application level event. The issue is that the TIBlob is null when the application level event is received.
Repro Steps
1. Run the below code in the app.js 2. Click the Gallery button and select an image from the phone gallery.
Titanium.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({title: 'Camera Test', exitOnClose: true, fullscreen: true, backgroundColor: '#ffffff'});
var bt = Ti.UI.createButton({'title': 'Gallery', top: 10, width: 200, height: 50});
bt.addEventListener('click', function(e) {
Titanium.Media.openPhotoGallery({
success:function(event) {
if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
alert(event.media);
Ti.App.fireEvent('uploadImage', {image: event.media, source: 'gallery'});
}else {
alert('Image was not uploaded because the type was invalid.');
}
},
cancel:function() {
},
error:function(err) {
alert('Error selecting image from gallery: ' + err);
Ti.API.error(err);
},
allowEditing: false,
autohide: true,
mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
});
});
Ti.App.addEventListener('uploadImage', function(e) {
alert(e.image);
alert(e.source);
});
win.add(bt);
win.open();
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0