1

您好,我在 cocos2d 中为 IOS 使用 Urban AirShip 丰富的推送通知。我正在获取丰富通知的收件箱,但我正在以肖像模式获取它。我想以横向模式获取收件箱。

这是我正在使用的代码

  [UAInbox useCustomUI:[UAInboxUI class]];//sample UI implementation
    [UAInbox shared].pushHandler.delegate = [UAInboxUI shared];

   // If the application gets an UAInbox message id on launch open it up immediately.
    // Only works for the default inbox
    [UAInboxUI shared].inboxParentController=window_.rootViewController;
    [UAInboxPushHandler handleLaunchOptions:launchOptions];

     if ([[UAInbox shared].pushHandler hasLaunchMessage]) {
        [[[UAInbox shared] uiClass] loadLaunchMessage];
    }

    // Create the main window
    window_ = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    [UAInbox displayInbox:window_.rootViewController animated:YES];

任何帮助将不胜感激。提前致谢

4

1 回答 1

0

好的自己解决了这个问题。Urban Airship 已经具备了横向展示的能力。

始终在 viewdidfinishwithlaunchingoptions 中编写方法以在 AppDelegate.mm 中显示 UAInbox(在我的情况下,我需要在启动时显示收件箱)

此外,如果您想在按钮单击时添加 UrbanAirship 收件箱(来自 cocos2d 场景),那么在我的情况下,始终将其添加到 cocos2d 游戏的window_.rootViewControllerrootViewController 中,而不是通过将其添加到 uiviewcontroller 和使用 uiviewcontroller 向 cocos2d 场景显示the [[CCDirector SharedDirector]view]addsubview:uiviewcontroller].

于 2012-10-15T05:12:48.323 回答