function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
littleGeeklittleGeek 

To Send Push Notification on Salesforce1 App using Apex Code

I know its open ended question but I researched a lot to figure out the solution for the same but I didn't find the any concrete solution. I am stuck with an issue of sending push notification to Salesforce1 App through customization functionality of Salesforce. On the update of a particular field of Case object which defines the severity of Case created, I want to send the push notification to few related users.

I have gone through the documentation "Salesforce Mobile Push Notifications Implementation Guide" but it seems its more related to sending the push notification to Salesforce1 app from other applications. But I am looking for a solution to send push notification from salesforce.com to Salesforce1 app.

Any help??

Thanks in advance!!
Vikrant UpnejaVikrant Upneja
Hi,

I have the same requirement. Were you able to figure out the solution for this? Will be helpful if you could share the same.

Thanks.
PatMcClellan__cPatMcClellan__c
Push Notification to Salesforce1 can be accomplished by posting to the Chatter Profile of the desired recipient. Much easier than all the work of setting up connected app, registering with Apple and Google, etc.

The APEX is pretty simple -- look up FeedItem in the docs. You simply create a new FeedItem record, set the body and ParentId (the recipient's id) and insert the record.

However, the post must originate with an internal user who changes/creates a record or triggers the event that results in the APEX trigger. That means the post can't be generated by a platform event or incoming REST call, because those events don't have a "context user" that has the right to post to Chatter. That's the challenge I'm trying to workaround now...