Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27839] Orientationchange Stops Firing on iPadOS

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-05-07T11:57:13.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.0.2
Componentsn/a
Labelsios, ipad
ReporterDonovan Lewis
AssigneeVijay Singh
Created2020-04-09T19:16:40.000+0000
Updated2020-05-07T11:57:44.000+0000

Description

When using Titanium SDK, 8.3.0, 8.3.1 or 9.0.0 Orientationchange will stop firing on iPadOS after a short time. Using the example code below you can open the app in the simulator or on device and rotate after a few rotations the event will stop firing, the label and console log will stop changing. Going home, and reopening the app often makes the issue happen right away. A screen recording of the issue can be found here: https://streamable.com/j7m95u
var win = Ti.UI.createWindow({
    backgroundColor: 'white',
});
var label = Ti.UI.createLabel({
    text: 'Height: 0, Count: 0',
    textAlign: 'center'
})
var rotateCount = 0;
Ti.Gesture.addEventListener('orientationchange', function (e) {
      console.log('Height: ' + Ti.Platform.displayCaps.platformHeight);
      rotateCount++;
      label.text = 'Height: ' + Ti.Platform.displayCaps.platformHeight + ', Count: ' + rotateCount;
});
win.add(label);
win.open();

Comments

  1. Donovan Lewis 2020-04-09

    Someone noticed this issue many versions ago but didn't seem to create an issue here in Jira. https://stackoverflow.com/questions/58167424/titanium-orientationchange-event-does-not-fire Seemed to break after 8.1.0.
  2. Vijay Singh 2020-04-13

    "location" event of Ti.Geolocation is also not firing in iOS 13.x . In iOS < 13.0 it is working fine. See the test case -
       var win = Ti.UI.createWindow({ backgroundColor: 'white' });
       
       Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH;
       
       function getLocation() {
           Ti.Geolocation.addEventListener('location', function(e) {
               alert(JSON.stringify(e, null, 2));
           });
       }
       
       win.addEventListener('open', function() {
           if (Ti.Geolocation.hasLocationPermissions()) {
               getLocation();
            } else {
               Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {
                   if (e.success) {
                       getLocation();
                   } else {
                       alert('could not obtain location permissions');
                   }
               });
           }
       });
       
       win.open();
       
  3. Donovan Lewis 2020-04-14

    Thats a great one to be missing also. I had not noticed it but I will double check in my app as well.
  4. Vijay Singh 2020-04-17

    PR(master) - https://github.com/appcelerator/titanium_mobile/pull/11643 PR (9_0_X) - https://github.com/appcelerator/titanium_mobile/pull/11648
  5. Samir Mohammed 2020-05-06

    FR passed, Waiting on Jenkins build for Master and 9_0_X.
  6. Christopher Williams 2020-05-06

    merged to master for 9.1.0 target and 9_0_X for 9.0.2 target
  7. Samir Mohammed 2020-05-07

JSON Source