Search code examples
iphoneiosmethodspush-notificationxtify

Custom Action For Xtify Push Notification


I use Xtify's web service for push notifications. They have a way to perform custom action on click, but I'm not sure I'm understanding how to do it. Basically, I want the custom action to allow me to choose which tab to open the app to. Their link is http://developer.xtify.com/display/sdk/6.+Other+Implementation+Methods

What all would I need to set up in app to specifiy in push notification which tab to open up?


Solution

  • You would first need to set a delegate with a method that would be called wherever you want it to be called as specified in the documentation -

    [[XLappMgr get] setDeveloperCustomActionSelector:@selector(developerCustomActionMethod:)];
    

    Then you would need to define a method called developerCustomActionMethod which does the actual switching. You could use the following code to select which tab you need to switch to -

    tabBarController.selectedViewController = [tabBarController.viewControllers objectAtIndex:2]; // will select the third tab, as tabs are ranked 0,1,2,3,....