I am using sharekit with a cocos2d application (app is throughout landscape), I am getting no error, but the share screen that comes up, is in portrait mode, covering roughly 1/3 of the screen. Keyboard which pops up is in Landscape mode (as expected). Only “cancel” button is visible.
The Code:
self.vc =[[ViewController alloc] init];
[[[CCDirector sharedDirector] openGLView] addSubview:self.vc.view];
[[SHK currentHelper] setRootViewController:vc];
[[SHK currentHelper] setCurrentView:vc];
SHKItem *item;
item = [SHKItem text:@"I HATE MOSQUITOS"];
[SHKFacebook shareItem:item];
Library Verison :
ShareKit 2.0
Extra Info :
I tried using SHKMail component too, that too is behaving as SHKFacebook part.
Regards,
Ishan
I guess you are having this problem because you create ViewController in a wrong way.
Your
vcdoesn’t know about your current orientation because you don’t show it as a modal nor you added it to the navigation stack.Probably, there is a much better way like you can use your application root controller.
You can probably get the right controller like this:
or like this:
Depends on what you have in your AppDelegate (because of cocos2d templates)
So then do
[[SHK currentHelper] setRootViewController:vc];and everything will be ok. By the way, i didn’t find the methodsetCurrentViewinSHKmaybe because of versions, but if you have to set some view to SHK just usevc.viewor application’s window. Don’t do anything to your GLView.