display the Landing Page when the corresponding push notification is received while the app is in the foreground state

Hi,

By using the landing page action i am able to send the push message in foreground or background state and as mentioned in doc, the message is showing when the user is opening the app for the next time.

But i want to directly display the landing page container (without showing a In-app notification and to wait for user interaction to display it) when the app received it in foreground state and immediately (not to wait until the next launch)

 

In the docs it is mentioned that

If you need to display a Landing Page while the app is in the foreground state, replace the registry predicate associated with that action with one that allows foreground execution.

 

How to achieve this functionality, if possible can i have some sample code

 

Didn't find what you were looking for?

New post

Comments

2 comments

  • Have you figured out how to get this to work?  This is what I think the doc refers to, but I'm still not getting the rich landing page to show:

        UAActionPredicate predicate = ^(UAActionArguments *args) {

     

            return (BOOL)(args.situation == UASituationLaunchedFromPush ||

                          args.situation == UASituationForegroundInteractiveButton ||

                          args.situation == UASituationBackgroundInteractiveButton);

        };

     

        // Update the predicate

        BOOL updated = [[UAirship shared].actionRegistry updatePredicate:predicate forEntryWithName:kUALandingPageActionDefaultRegistryName];

    Comment actions Permalink
    0
  • I got it working with the code above.  The landing page web view is showing behind the main controller so that's why I haven't been seeing it.  

    Comment actions Permalink
    0

Please sign in to leave a comment.