
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-30-2020 05:54 PM
Hi All,
This is my first article, so constructive feedback would be valuable - this is both an example of troubleshooting this issue with mobile deep links in New York, and a simple extensible format for use to generate deep links.
Issue:
I recently encountered an issue with generating mobile push notifications and deep links while supporting a customer in configuring these.
What I found was the LayoutFieldGenerator and MobileDeepLinkGenerator functions were running into issues with the sys_ids and sys_class_name values, which are reached by dot-walking for existing examples of Push Notification Message Content.
After troubleshooting this with regard to the custom table this customer was using, I identified that the dot-walking format is where our issue is occurring.
Resolution:
Two scoped functions of GlideRecord, 'getTableName()' and 'getUniqueValue()' should be used instead of dot-walking where possible. An example is below for your use:
(function buildJSON( /*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {
// Establish the layout field generator
var layoutFieldGenerator = new global.NotificationLayoutFieldGenerator();
// Below is your popular reference, for a lot of task tables it is 'number'
var identifier = layoutFieldGenerator.layoutField(current.getTableName(), current.getUniqueValue(), "number");
// Below is your substance of the notification which goes below the message (generally)
var description = layoutFieldGenerator.layoutField(current.getTableName(), current.getUniqueValue(), "short_description");
// Establish the deep link generator, use "agent" for Now Agent, "request" for Now Mobile, and "onboarding" for the HR Onboarding app
var deepLinkGenerator = new global.MobileDeepLinkGenerator("agent");
// There is also a general Screen Link function, but this is a sample for a Form Screen Link
var link = deepLinkGenerator.getFormScreenLink('your_form_screen_sys_id', current.getTableName(), current.getUniqueValue());
var json = {};
json = {
"aps": {
"sound": "default"
},
"Link": link,
"Layout": {
"Identifier": identifier,
"Description": description
}
};
return json;
})(current, message, attributes);
With the 'push' (pun intended) towards the use of these new Mobile applications, it is very valuable to understand just how extensible Push Notifications can be.
Kind Regards,
Astrid Sapphire
- 1,762 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Astrid,
Thanks for sharing your knowledge!
Best,
David
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you so much for sharing Astrid.
I was having this issue and updating the json as you suggested was the only solution that worked for me.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you SO MUCH for this!!!! I have been banging my head against the wall trying to get a push notification just to show a single knowledge article and this was exactly what I needed.