0

我目前使用 Xtify 进行简单的推送通知。我没有设置收件箱来存储这些消息,也没有查看丰富的通知。设置简单通知的文档非常棒。需要添加的每一行代码的简单分步指南。但是,当您进入高级设置时,它缺少很多。它只是让您快速了解您可以做什么,但缺少一个简单的分步指南来添加收件箱。我正在使用 IB 构建我的应用程序,并希望添加丰富的通知和收件箱,但我不确定该怎么做。以下是指南所说的:

Follow these steps to integrate option 1 above. 
The XtifyLib folder now includes sample code to create Custom Inbox. Classes are included in the Sample project file in  XtifyLib > CustomInbox > AppInclude

Use the classes provided in AppInclude as your starting point

Classes overview:
CompanyCustomInbox - a wrapper around Xtify rich notification retrieval calls. i.e. getting a single rich notification and getting pending notifications. You will need to modify these methods if you choose a different behavior.
- (void) handleRichPush:(NSString *)msgId;
- (void) getPending:(id)notifyObject;
AppDelegate
Add the following to your init method:
[[CompanyCustomInboxget] setCallbackSelectors:@selector(successfullyGotRichMessage:) failSelector:@selector(failedToGetRichMessage:) andDelegate:self];
Implement in your AppDelegate the following methods:
- (void) successfullyGotRichMessage:(XLRichJsonMessage *)inputMsg // Get notified on success 
- (void) failedToGetRichMessage:(CiErrorType )errorType - // Get notified on failure
XRInboxDbInterface - Internal Xtify SDK class to handle the following functions: access to Xtify payload, unread messages, data storage access. Some of the methods provided by the XRInboxDbInterface class:

有些事情可以作为指导,但其他事情只是说明班级可以做什么。我想要的只是添加收件箱的简单方法,以便在单击通知时将它们直接带到详细信息视图,或者如果在应用程序中,我可以与 IBAction 连接以推动导航控制器的按钮进入视野。该指南指出您可以使用 IB 执行此操作,但如果您以编程方式完成所有操作,所有示例代码都会被写出

4

1 回答 1

0

您可以尝试使用以下代码:

 - (IBAction)myInboxButtonPressed:(id)sender
{
    NSLog(@"Button was tapped, display Inbox");

    CompanyInboxVC *inboxVC = [[CompanyInboxVC alloc] initWithNibName:@"CompanyInboxVC" bundle:nil];
    UINavigationController      *inboxNavController = [[UINavigationController alloc] initWithRootViewController:inboxVC];
    [[XRInboxDbInterface get]updateParentVCandDB:inboxVC];

    [inboxNavController presentViewController:inboxVC animated:YES completion:nil];
    [inboxVC release];
}
于 2013-09-04T12:17:00.893 回答