Community

Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

Open Landing Page later in app

Dhaval Nena

In iOS I need to store all the sent push notifications which user has interacted with in local database and show it in the notifications screen, when user tap on any notification I need to display all the details associated with push like alert body, title, summary, actions etc.

My problem is how can I reopen landing page which was set as action from the UA dashboard. below is my notification payload

 

FOREGROUND NOTIFICATION
{
"^p" = "https://dl.urbanairship.com/binary/public/VX58HvPeSBOnr8fElQAX6g/7585849c-12b7-44e4-b1ec-b1ffd7ab4a8d";
"_" = "24372321-0ff6-4984-a335-cac1bac74332";
aps = {
alert = "Only Push \nAction = DEEP LINK = reward screen\n\n";
};
"com.urbanairship.metadata" = "eyJ2ZXJzaW9uX2lkIjoxLCJ0aW1lIjoxNTUyOTk4OTYwMzM1LCJwdXNoX2lkIjoiYThhMTY5NjctYThkNS00Y2Y4LWFlZDQtMmQ0NWU3NzVmNGJmIn0=";
}

I'm storing value of the field "^p" in database and I need to reopen the same webpage that opened automatically upon interacting with UA push, I can load same link in webview but that is not what I expect, as native webview can't handle deeplink and all that associated with button in landing page, request to guide me in achieving my requirement.

Thanks,

Dhaval

 

 

Please sign in to leave a comment.

0
Avatar

Hi Dhavel,

You should be able to achieve this through the custom actions.

Kind regards,
Chilun Liu
Senior Technical Support Engineer
Urban Airship

25 Lavington Street | London | SE1 0NZ
Portland | San Francisco | London | New York | Gurgaon

 

chilun liu 0 votes
0
Avatar

Hi Chilun,

Thanks for the quick reply.

I tried below code for opening landing page, however still unable to open the Landing Page

 

// REGISTERING LANDING PAGE ACTION

 

let customAction = UAAction(block: { (args, actionHandler) in
print("Action performing with args : \(args)")
actionHandler(UAActionResult.init(value: "test.."))
})
UAirship.shared()?.actionRegistry.register(customAction, name: "landing_page_action")

 

// RUNNING ACTION

let url = "https://dl.urbanairship.com/binary/public/VX58HvPeSBOnr8fElQAX6g/65753117-fd14-4112-85a2-043f9e7c57d4"
UAActionRunner.runAction(withName: name, value: [UALandingPageURLKey:url], situation: UASituation.manualInvocation, metadata: nil) { (actionResult) in
print("ACTION FINISHED \(actionResult.status)")
}

 

Can you please help with code snippet to open landing page, appreciate your help.

Thanks much,

Dhaval

Dhaval Nena 0 votes