Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11187] iOS : Opening iAD in landscape orientation & closing it crashes the app.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-27T23:13:52.000+0000
Affected Version/sRelease 2.1.3
Fix Version/sRelease 2.1.3, Release 3.0.0, Sprint 2012-20 API, 2012 Sprint 20
ComponentsiOS
Labelsapi, qe-ios090112, qe-ios6
ReporterLokesh Choudhary
AssigneeVishal Duggal
Created2012-09-27T00:40:18.000+0000
Updated2012-10-03T20:09:06.000+0000

Description

Building the app using iOS 6 & running it on Iphone running iOS 6 causes it to crash. Whereas, building the app using iOS 6 & running it on iphone running iOS 5.1 does not cause the crash. Building the app using iOS 5.1 sdk & running it on iphone running iOS 5.1 & 6.0 does not crash the app. Description: 1.Replace your code in app.js with the code below.
var win1 = Ti.UI.createWindow();
 
win1.orientationModes = [
    Titanium.UI.LANDSCAPE_RIGHT,
    Titanium.UI.LANDSCAPE_LEFT,
    Titanium.UI.PORTRAIT
];
 
var adView = Ti.UI.iOS.createAdView({
    width: 'auto',
    height: 'auto',
    bottom:-100,
    zIndex:100
});
adView.addEventListener('load', function(){
    adView.animate({bottom:0, duration:750});
});
win1.add(adView);
adView.show();
 
win1.open();
2.Run the app on Iphone 5. 3.You will see the iAd in portrait mode. 4.Change the orientation to landscape. 5.Tap on the IAd. 6.You will see the test advertisement come up in portrait mode. 7.Now keeping the device in landscape mode close the iAd. Expected Result: 1.The app should not crash & we should get back to the previous screen . Actual Results: 1.The app crashes.

Attachments

FileDateSize
iads_log.crash2012-09-27T00:44:52.000+000033181

Comments

  1. Sabil Rahim 2012-09-27

    The test case code is wrong . Please use the either of the codes below: //With Animation
       var win1 = Ti.UI.createWindow();
       var focused = false;  
       win1.orientationModes = [
           Titanium.UI.LANDSCAPE_RIGHT,
           Titanium.UI.LANDSCAPE_LEFT,
           Titanium.UI.PORTRAIT
       ];
         
       var adView = Ti.UI.iOS.createAdView({
           width: 'auto',
           height: 'auto',
           bottom:-100,
           zIndex:100
       });
       adView.addEventListener('load', function(){
           if(focused){
       		adView.animate({bottom:0, duration:750});
       	}
       	else
       	{
       		setTimeout(adView.fireEvent('load'), 100);
       	}
       	
       });
       win1.add(adView);
       win1.addEventListener('focus',function(){
       	focused = true;
       });
         
       win1.open();
       
       adView.show();
       
    //Without animation
       var win1 = Ti.UI.createWindow();
       win1.orientationModes = [
           Titanium.UI.LANDSCAPE_RIGHT,
           Titanium.UI.LANDSCAPE_LEFT,
           Titanium.UI.PORTRAIT
       ];
         
       var adView = Ti.UI.iOS.createAdView({
           width: 'auto',
           height: 'auto',
           bottom:0,
           zIndex:100
       });
       
       win1.add(adView);
       
       win1.open();
       
       adView.show();
       
  2. Sabil Rahim 2012-09-27

    MASTER PR https://github.com/appcelerator/titanium_mobile/pull/3064 2_1_X PR https://github.com/appcelerator/titanium_mobile/pull/3065
  3. Lokesh Choudhary 2012-09-28

    Verified the fix with: Titanium studio : 2.1.2.201208301612 SDK version : 2.1.3.v20120927151612 Iphone 5 iOS 6 Iphone 4 (5.1.1) xcode 4.5 Mac OSX 10.8.2
  4. Lokesh Choudhary 2012-09-28

    forgot to add master branch version. Verified the fix with: Titanium studio : 2.1.2.201208301612 SDK version : 2.1.3.v20120927151612 , 3.0.0.v20120927164913 Iphone 5 iOS 6 Iphone 4 (5.1.1) xcode 4.5 Mac OSX 10.8.2

JSON Source