【问题标题】:Urban AirShip Rich Push Notification inbox Orientation ChangeUrban AirShip 丰富的推送通知收件箱方向更改
【发布时间】:2012-10-15 13:12:48
【问题描述】:

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

这是我正在使用的代码

  [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];

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

【问题讨论】:

    标签: ios cocos2d-iphone urbanairship.com


    【解决方案1】:

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

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

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

    【讨论】:

    • 如果富收件箱消息有按钮动作怎么处理?
    猜你喜欢
    • 2013-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多