使用IB为Xtify添加丰富的通知收件箱

时间:2013-08-29 14:42:32

标签: ios apple-push-notifications xtify

我目前使用Xtify进行简单的推送通知。我没有设置收件箱以便能够存储这些邮件,也没有设置Rich Notifications。设置简单通知的文档非常棒。每个需要添加的代码行的简单分步指南。但是,当您进入高级设置时,它缺乏相当多的功能。它只是让您快速了解您可以做什么,但缺少一个简单的逐步指南来添加收件箱。我使用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做到这一点,但如果你以编程方式完成所有工作,那么所有示例代码都会被写出来

1 个答案:

答案 0 :(得分: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];
}