Push Notification that triggers data sync and displays specific view

I enabled push notifications in my whitelabel app and wish to send a push notification that when clicked opens the app to a specific view with the latest data available. The view in question is called Top Picks. The deep link expression I was planning to use when broadcasting the notification is below. Is it correct?

CONCATENATE("#view=Top Picks#at=", ENCODEURL(NOW()))

Thanks.

Solved Solved
1 27 2,235
1 ACCEPTED SOLUTION

First, you are correct, the Workflow option is not available in the Publisher Pro public app.

Referring to your comment above, I too see that the Deep Link is not saved after entering the expression. This is a bug. Please open a bug post for it.

View solution in original post

27 REPLIES 27

No. When a Push Notification is sent and presented, it has no context of WHICH app it is for. it is just presenting information. However, you can build your Deep Link expression to specify the specific app.

You should be using the LINKTOโ€ฆ() navigation Deep Links. These have internal functionality used in building the navigation URL and they all provide a parameter to specify the app to go to.

Support for LINKTOโ€ฆ() functions
https://www.appsheet.com/Support?q=LINKTO&hPP=10&idx=help&p=0&is_v=1

Thank you for your response. I was following the guide here -> https://help.appsheet.com/en/articles/1023058-app-column-type-deep-link

And it says that the โ€œatโ€ parameter can used with a push notification to force a sync. The example they give is โ€œCONCATENATE(โ€œMyApp-123#at=โ€, ENCODEURL(NOW())) will navigate to app โ€œMyApp-123โ€, force a sync, and display its default starting view.โ€

So I donโ€™t understand why this canโ€™t be manipulated to go to view and force a sync instead of to an app.

You didnโ€™t specify your complete end goal in the original post.

Using the CONCATENATE() method was the pre-cursor to the LINKTOโ€ฆ() functions. You can still use that method to manually create the URL.

When using the LINKTOโ€ฆ() functions, AppSheet will be maintaining how those URLโ€™s are constructed and returned with no additional attention needed on the developer side - meaning if something critical changes that affects the URLโ€™s, a developer would need to re-enter the app and change every location they created the Deep Links manually.

So, I would advise to use the LINKTOโ€ฆ() functions whenever possible.

You can still add parameters to the URLโ€™s constructed with the LINKTOโ€ฆ() functions. In your case, I believe you can construct the link used in your Push Notification as:

CONCATENATE(LINKTOVIEW("view name", "app id"),"#at=", ENCODEURL(NOW()) )

I hope this helps!

Steve
Platinum 4
Platinum 4

#at= should be &at= (&, not #).

Good to know. Just for my education, when is the โ€œ#โ€ symbol used in the URL? Is it only at the START of the parameter list?

The format of a (mostly) full URL:

https://{site}/{path}?{options}#{special}

at is an option. Options are formatted like this:

{option1}={value1}&{option2}={value2}&...&{optionN}={valueN}

So just to confirm that this:

CONCATENATE("#view=Top Picks&at=", ENCODEURL(NOW()))

will work where I have replaced the #at= with &at=

Or do I need to apply the correction to what WillowMobileSystems suggested i.e.:

CONCATENATE(LINKTOVIEW("view name", "app id"),"&at=", ENCODEURL(NOW()))

I recommend using LINKTOVIEW() as @WillowMobileSystems suggested.

CONCATENATE(LINKTOVIEW("view name", "app id"), "&at=", ENCODEURL(NOW()))

@Dilanjan_Fernando Is this working for you?
Because I always have to add an +1 at the end, as mentioned here:

So this would be:
CONCATENATE(LINKTOVIEW("view name", "app id"), "&at=", ENCODEURL(NOW()+1))

@Fabian Iโ€™m still yet to test it because Iโ€™m trying to avoid sending notifications more than once every 2 weeks to my users. Iโ€™ll probably test your method first since it is working you because I donโ€™t want to risk sending a notification that leads users to old data.

@Fabian I entered CONCATENATE(LINKTOVIEW("Top Picks", "QLDSeniorsDiscounts-1222696"), "&at=", ENCODEURL(NOW())+1) but got the error โ€œArithmetic expression โ€˜(ENCODEURL(NOW())+1)โ€™ has inputs of an invalid type โ€˜Unknownโ€™โ€

So I sent a push notification with CONCATENATE(LINKTOVIEW("Top Picks", "QLDSeniorsDiscounts-1222696"), "&at=", ENCODEURL(NOW()+1)) instead and I received the notification but it didnโ€™t take me to the Top Picks view nor did it force a sync.

You used:

(ENCODEURL(NOW())+1)

It should be:

(ENCODEURL(NOW()+1))

Notice where the parentheses are.

I used (ENCODEURL(NOW()+1)) when I sent out the notification but that hadnโ€™t forced an app sync or taken the user to the specified app view.

The "&at=" & ENCODEURL(NOW() + 1) trick only works to force a sync when used to navigate to a view within the app. Used with a link external to the app really has little or no effect. A user who is not in the app and clicks on a link into the app will automatically get the latest data available.

Please post a screenshot of your notification workflow configuration that includes the entire Notification Content section.

Based on this post, I played around with some Push Notifications I have in my app. I eventually want the capability described here anyway.


Using the Deep Link property in the Notify Workflow, I was able to navigate to another app AND I was also able to force a Sync in that app. Forcing a Sync is important for use cases were a new record has been added and the recipient might already have the app open.

I first applied an expression below to test navigating to another app (and actually tried a couple views to be certain I wasnโ€™t just getting a default view):

LINKTOVIEW("Log Table", "IssueSample-526414")

Obviously you will need to update with your view name and your app-id.

Next I was able to force a Sync by applying @Steve 's suggested trick by updating the Deep Link expression to this:

โ€˜CONCATENATE(LINKTOVIEW(โ€œLog Tableโ€, โ€œIssueSample-526414โ€), โ€œ&at=โ€,ENCODEURL(NOW() + 1))โ€™

I also played with opening a specific row in the current app, etc. All seem to work very well.

I hope this helps someone!!!

Outstanding!

@WillowMobileSystems Thank you very much John. Posts like this have to be bookmarked

Hello! Could you show me what is the function to open the specific row

Thanks!

Sorry, I should have clarified my previous posts. My app is one that is available in the app stores and is under a Publisher Pro license. I suspect Iโ€™ve given the impression that my app was under one of the per user licences.

My process to send push notifications with the intention of triggering a sync when clicked is as follows:

  1. Enter in a title and body in the fields under Broadcast Notifications

  2. Enter the deep link expression (the expression shown was one I used recently that didnโ€™t go to the view specified or force a sync when clicked) and click save

  3. Click send notification (the deep link expression didnโ€™t show up after pressing save on the deep link pop up in step 2)

I noticed everyone here is using the notification functionality under โ€œBehavior > Workflowโ€ which I donโ€™t think works for my license right?

First, you are correct, the Workflow option is not available in the Publisher Pro public app.

Referring to your comment above, I too see that the Deep Link is not saved after entering the expression. This is a bug. Please open a bug post for it.

I opened a bug post now, thanks

@Dilanjan_Fernando I took a look on my App and I saw, that Iโ€™m Manually Constructing Deep Links as you can read at the end of this article:

This Deep Link should work for you:
CONCATENATE(โ€œQLDSeniorsDiscounts-1222696#view=Top Picks&at=โ€,ENCODEURL(NOW() + 1))

Thank you, I will try the new deep link in a couple of weeks time.

But am I right in thinking that broadcast notifications are still available for the publisher pro version?

They were last I checked but that was a month ago

Top Labels in this Space