- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2021 09:41 AM
Hi guys,
In the NOW Mobile, I am trying to create a push notification, that will take me to the /mesp portal and display a ticket, e.g. an incident.
With a formscreen it is easy, and you do the deepLinkGenerator.getFormScreenLink. No problems, but if I want a custom url I can't get it to work. In the Classic app it supported "web_path", and it could be configured something like this:
var json = {};
json = {
"aps" : {
"sound" : "default"
},
"web_path" : "/mesp?id=mobile_ticket&table="+current.getTableName()+"&sys_id="+current.getValue("sys_id")
};
return json;
But I can't get that to work in the NowMobile. Honestly the documentation on the properties in the JSON object is... lacking. And you can link to screens in different ways, by using the property "Redirection" (using documentId as formscreen) or "Link" (Having the link generator).
Do any of you know a way to configure the push notification to redirect the user to a portal page, instead of a form screen? Just as it is possible in the app clicking on a list item, and then have a function instance to redirect the user?
Best regards,
Sebastian Laursen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 06:01 AM
Webpath is not supported in NOW Mobile.
In Rome there will come an option to do the same as webpath in the NOW Mobile.
So to do this now, you need to be on the Quebec version and you can use the deepLinkGenerator.getFormScreenLink. Make sure the sys_id in the parameter is a browser screen and it will auto translate e.g. {{sys_id}} from the push notification.
This does NOT work on the Paris release, where it can't translate the {{sys_id}} for some reason. I've tested this out on several instances, and also with the same records. When upgrading to Quebec this works, but on a Paris instance it can't get the value. Configuration of push notification message content. You can replace the "Agent" with "request" if you wish to have the NOW Mobile.
(function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {
var layoutFieldGenerator = new global.NotificationLayoutFieldGenerator();
var identifier = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "number");
var description = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "short_description");
var status = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "priority");
var json = {};
var deepLinkGenerator = new global.MobileDeepLinkGenerator("Agent");
//var link = deepLinkGenerator.getFormScreenLink('9f045535532033002d96ddeeff7b127b', current.getTableName(), current.getValue("sys_id"));
var link = deepLinkGenerator.getFormScreenLink('5d035caf2f3320103eb45e492799b6f3', current.getTableName(), current.getValue("sys_id"));
json = {
"aps" : {
"sound" : "default"
},
"Link": link,
"Layout" : {
"Status": status,
"Identifier" : identifier,
"Description" : description
}
};
return json;
})(current, message, attributes);
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 03:35 AM
Hello,
Create a web URL applet and add the applet ID in the deeplink. It will redirect you to the URL page.
I see that you're generating dynamic link and passing multiple parameters. You can add that functionality on the widget itself. Pass the parameters from here and the widget will fetch the value according to the parameters.
Thank you,
Pankaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 04:37 AM
Hi Pankaj,
Thanks for responding.
So the Browser screen (URL applet) is using a {{sys_id}} as dynamic content, so that is why it was failing. It used to be: /mesp?id=mobile_ticket&table=incident&sys_id={{sys_id}} and if I remove the {{sys_id}} it is working. How can I add these parameters in the deeplink? Since it is a notification I would need to know which sys_id.
So the deeplink being generated is rewritten as base64, or at least the direction to the form/list screen.
which translates to:
{"ScreenId":"7afb83d6db9b2c50f3af29da4b9619ba","TableName":"incident"}.
If I add to the deeplink string, then it says on the widget it can't read the parameters. Do you have an example of this?
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 06:01 AM
Webpath is not supported in NOW Mobile.
In Rome there will come an option to do the same as webpath in the NOW Mobile.
So to do this now, you need to be on the Quebec version and you can use the deepLinkGenerator.getFormScreenLink. Make sure the sys_id in the parameter is a browser screen and it will auto translate e.g. {{sys_id}} from the push notification.
This does NOT work on the Paris release, where it can't translate the {{sys_id}} for some reason. I've tested this out on several instances, and also with the same records. When upgrading to Quebec this works, but on a Paris instance it can't get the value. Configuration of push notification message content. You can replace the "Agent" with "request" if you wish to have the NOW Mobile.
(function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {
var layoutFieldGenerator = new global.NotificationLayoutFieldGenerator();
var identifier = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "number");
var description = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "short_description");
var status = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "priority");
var json = {};
var deepLinkGenerator = new global.MobileDeepLinkGenerator("Agent");
//var link = deepLinkGenerator.getFormScreenLink('9f045535532033002d96ddeeff7b127b', current.getTableName(), current.getValue("sys_id"));
var link = deepLinkGenerator.getFormScreenLink('5d035caf2f3320103eb45e492799b6f3', current.getTableName(), current.getValue("sys_id"));
json = {
"aps" : {
"sound" : "default"
},
"Link": link,
"Layout" : {
"Status": status,
"Identifier" : identifier,
"Description" : description
}
};
return json;
})(current, message, attributes);
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2021 06:27 AM
By any chance did you get this to work at all in Paris?