Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Master
    • Fix Version/s: 2.1.0
    • Component/s: iOS
    • Labels:

      Description

      From Michael SBCERA:
      Autorotation is changing in iOS 6. In iOS 6, the shouldAutorotateToInterfaceOrientation: method of UIViewController is deprecated. In its place, you should use the supportedInterfaceOrientations and shouldAutorotate methods. Read more at http://9to5mac.com/2012/06/25/apple-pushes-ios-6-0-update-to-devs/#tumhkqaj5kDKYOC3.99

        Activity

        Hide
        Klaus Schmidt added a comment - - edited

        Hi,

        in iOS I've got the problem that, if I run my app with the current state of Cordova 2.1.0, the application window of my app like fullscreen-mode, so on the top of the app, the pixels of the height of the iOS status bar are not existent. It's ok, when I add "[application setStatusBarHidden:YES animated:NO];" in the "didFinishLaunchingWithOptions" in the AppDelegate.m, because then the status bar is hidden and the page is displayed in fullscreen-mode. But we want to have the status bar present. In version 2.0.0 everything is ok.
        The meta-tag in index.html is this:
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" />
        What can we do? We need the version 2.1.0 because of the issue CB-1219 .

        Greetings, Klaus.

        Edit: I've created a new Issue CB-1466 because this issue here is probably the wrong context.

        Show
        Klaus Schmidt added a comment - - edited Hi, in iOS I've got the problem that, if I run my app with the current state of Cordova 2.1.0, the application window of my app like fullscreen-mode, so on the top of the app, the pixels of the height of the iOS status bar are not existent. It's ok, when I add " [application setStatusBarHidden:YES animated:NO] ;" in the "didFinishLaunchingWithOptions" in the AppDelegate.m, because then the status bar is hidden and the page is displayed in fullscreen-mode. But we want to have the status bar present. In version 2.0.0 everything is ok. The meta-tag in index.html is this: <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" /> What can we do? We need the version 2.1.0 because of the issue CB-1219 . Greetings, Klaus. Edit: I've created a new Issue CB-1466 because this issue here is probably the wrong context.
        Show
        Shazron Abdullah added a comment - Fix commit - http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/d8575d7e
        Hide
        Michal Mocny added a comment -

        Fix here: https://github.com/apache/incubator-cordova-ios/pull/45

        (copying comments from the pull request here):

        • The IsIPad macro came from an earlier revision of this patch that needed to use it. Its not used any more so can be removed, but I thought it was worth leaving in.
        • I understand that changes to the AppDelegate template are best avoided, but there is no way around it for this fix. Some of the changes could be avoided by not removing the ViewController::supportedOrientations array, but if we are making changes anyway, I think its best to clean this up right.
        • I didn't make changes to the CordovaTests project's AppDelegate. That app delegate has diverged from the original template already – so, what is the correct process here? (Did I miss any other changes needed when touching AppDelegate? Any other process?)
        • The JS calls we make are not efficient (we make 4-8 js evaluations per rotation). There is also a w3c proposal for screen orientation (http://www.w3.org/TR/screen-orientation/#widl-Screen-onorientationchange) though it is not perfect. I plan to reach out to the mozilla dev who submitted that to raise some missing functionality with the proposal, but perhaps I'll post to ML to discuss what a good spec would have.
        Show
        Michal Mocny added a comment - Fix here: https://github.com/apache/incubator-cordova-ios/pull/45 (copying comments from the pull request here): The IsIPad macro came from an earlier revision of this patch that needed to use it. Its not used any more so can be removed, but I thought it was worth leaving in. I understand that changes to the AppDelegate template are best avoided, but there is no way around it for this fix. Some of the changes could be avoided by not removing the ViewController::supportedOrientations array, but if we are making changes anyway, I think its best to clean this up right. I didn't make changes to the CordovaTests project's AppDelegate. That app delegate has diverged from the original template already – so, what is the correct process here? (Did I miss any other changes needed when touching AppDelegate? Any other process?) The JS calls we make are not efficient (we make 4-8 js evaluations per rotation). There is also a w3c proposal for screen orientation ( http://www.w3.org/TR/screen-orientation/#widl-Screen-onorientationchange ) though it is not perfect. I plan to reach out to the mozilla dev who submitted that to raise some missing functionality with the proposal, but perhaps I'll post to ML to discuss what a good spec would have.
        Hide
        Avidan Chen added a comment - - edited

        This is a major bug for us.

        We have only one screen where the application should change rotation, and after implementing the method shouldRotateToOrientation in JavaScript it works great in iOS <= 5.1. I'm returning true in this method only when the user is viewing a specific page in my app.

        However, when tested in iOS 6 DP3 & DP4, this method does not get called at all and the app is stuck in the initial orientation it started in (which in my case is the portrait orientation, as I've indicated in the .plist file of my app).

        Fixing this for iOS 6 will be greatly appreciated.

        Obviously, the fix should not change the way it works in iOS 5.1 and below.

        Show
        Avidan Chen added a comment - - edited This is a major bug for us. We have only one screen where the application should change rotation, and after implementing the method shouldRotateToOrientation in JavaScript it works great in iOS <= 5.1. I'm returning true in this method only when the user is viewing a specific page in my app. However, when tested in iOS 6 DP3 & DP4, this method does not get called at all and the app is stuck in the initial orientation it started in (which in my case is the portrait orientation, as I've indicated in the .plist file of my app). Fixing this for iOS 6 will be greatly appreciated. Obviously, the fix should not change the way it works in iOS 5.1 and below.

          People

          • Assignee:
            Michal Mocny
            Reporter:
            Shazron Abdullah
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development