ios8 orientation

Monkey Targets Forums/iOS/ios8 orientation

Alex(Posted 2014) [#1]
Hello!

Has anyone had the following problem?

My app is set up to run Landscape right/Landscape left.
When I press home button, the app suspends.
Then I tap icon to launch it again. And the app for a moment appears in Portrait mode with graphics stretched by 90 degrees.

Can anyone, please, help, as I'm using fullscreen ads in my game and they are shown after the app resumes. They appear in Portrait mode and rotated wrong.

Monkey 80c. iPhone 4s. ios 8.1

Thank you.


simonh(Posted 2014) [#2]
What ad service are you using? I'm pretty sure this is an iOS 8 bug/feature, and the ad service will need to update their SDK accordingly.


Alex(Posted 2014) [#3]
Yes, I thought of this. I wrote to support. However, this little issue with screen stretching makes me think its monkey.
I use Revmob by the way. Chartboost is okay!


Alex(Posted 2014) [#4]
This is how game comes back from being suspended.


After a a moment, screen becomes normal (not stretched, landscape) without rotation.

And then the ad is shown incorrect.



Alex(Posted 2014) [#5]
I mean there are lines like this in the beginning of the main.mm:
//ios 4,5
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{

	CFArrayRef array=(CFArrayRef)CFBundleGetValueForInfoDictionaryKey( CFBundleGetMainBundle(),CFSTR("UISupportedInterfaceOrientations") );
	if( !array ) return NO;
	
	CFRange range={ 0,CFArrayGetCount( array ) };

	switch( interfaceOrientation ){
	case UIInterfaceOrientationPortrait:return CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationPortrait") );
	case UIInterfaceOrientationPortraitUpsideDown:return CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationPortraitUpsideDown") );
	case UIInterfaceOrientationLandscapeLeft:return CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationLandscapeLeft") );
	case UIInterfaceOrientationLandscapeRight:return CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationLandscapeRight") );
	}
	return NO;
}

//ios 6
-(BOOL)shouldAutorotate{
	return YES;
}

-(NSUInteger)supportedInterfaceOrientations{
    
	CFArrayRef array=(CFArrayRef)CFBundleGetValueForInfoDictionaryKey( CFBundleGetMainBundle(),CFSTR("UISupportedInterfaceOrientations") );
	if( !array ) return 0;
    
	CFRange range={ 0,CFArrayGetCount( array ) };
    
    NSUInteger mask=0;
    
    if( CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationPortrait") ) ) mask|=UIInterfaceOrientationMaskPortrait;
    if( CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationPortraitUpsideDown") ) ) mask|=UIInterfaceOrientationMaskPortraitUpsideDown;
    if( CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationLandscapeLeft") ) ) mask|=UIInterfaceOrientationMaskLandscapeLeft;
    if( CFArrayContainsValue( array,range,CFSTR("UIInterfaceOrientationLandscapeRight") ) ) mask|=UIInterfaceOrientationMaskLandscapeRight;
    
    return mask;
}


Maybe there should be something like this:
//ios8

...
...
...


to handle orientations properly?