Adding Rich Notification Inbox Using IB For Xtify

347 views Asked by At

I currently use Xtify for simple Push Notifications. I have not setup the Inbox to be able to store those messages, nor to view Rich Notifications. The documentation for setting up simple notifications is amazing. A simple step-by-step guide for every line of code that needs to be added. However, when you get to the advanced setup, it is lacking quite a bit. It merely gives you a quick overview of what you can do, but lacks a simple step-by-step guide to get an inbox added in. I am using IB to build my app, and would like to add in rich notifications and the inbox, but am unsure of how to do so. Here is what the guide says:

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:

Some things act as a guide, but others just state what the class can do. All I want is a simple method to add the inbox so that when the notification is clicked on, will take them straight to the details view, or if in the app, a button that I can wire up with an IBAction to push the navigation controller into the view. The guide states you can do this with IB, but all the sample code is written out if you have done everything programatically

1

There are 1 answers

4
Gilad M On

You can try using the following code:

 - (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];
}