{"id":3444,"date":"2025-02-25T05:46:27","date_gmt":"2025-02-25T05:46:27","guid":{"rendered":"http:\/\/52.200.67.122\/blog\/?p=3444"},"modified":"2026-03-03T12:28:44","modified_gmt":"2026-03-03T12:28:44","slug":"sending-push-notifications-from-salesforce","status":"publish","type":"post","link":"https:\/\/www.differenzsystem.com\/blog\/sending-push-notifications-from-salesforce\/","title":{"rendered":"Send Push Notifications from Salesforce via AWS"},"content":{"rendered":"\n<p>Sending push notifications from Salesforce to mobile applications can be challenging due to Salesforce\u2019s limitations. By default, Salesforce requires a Connected App to send notifications, but this only allows notifications to be sent to Salesforce users, not to external contacts or leads.<\/p>\n\n\n\n<p>To address this limitation, we use AWS Pinpoint as an intermediary service between Salesforce and mobile apps. AWS Pinpoint provides scalable, secure, and efficient push notifications to Android (FCM) and iOS (APNs) devices.<\/p>\n\n\n\n<p>This guide outlines the step-by-step process for integrating Salesforce with AWS Pinpoint and sending push notifications successfully.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Use AWS Pinpoint for Salesforce Push Notifications?<\/h2>\n\n\n\n<p><span style=\"text-decoration: underline;\">Salesforce\u2019s built-in push notification feature has several limitations:<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It requires a Connected App, limiting notifications to Salesforce users only.<\/li>\n\n\n\n<li>It does not support push notifications for external contacts, leads, or customers.<\/li>\n\n\n\n<li>It lacks flexibility in segmentation, automation, and targeting.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Key Benefits of AWS Pinpoint<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>No Connected App Required<\/strong>: Send push notifications to external contacts, leads, and customers.<\/li>\n\n\n\n<li><strong>Multi-Platform Support<\/strong>: Compatible with Android (FCM) and iOS (APNs).<\/li>\n\n\n\n<li><strong>Scalable and Cost-Effective<\/strong>: Efficiently handle millions of notifications.<\/li>\n\n\n\n<li><strong>Custom Targeting<\/strong>: Personalize notifications based on customer preferences and behavior.<\/li>\n\n\n\n<li><strong>Real-Time Analytics<\/strong>: Track delivery rates, open rates, and engagement.<\/li>\n\n\n\n<li><strong>Seamless API Integration<\/strong>: Salesforce triggers notifications programmatically without complex configurations.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step-by-Step Guide: Sending Push Notifications from Salesforce to Mobile Apps via AWS Pinpoint<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.differenzsystem.com\/blog\/wp-content\/uploads\/2024\/09\/Push-Notification-Inner-Image--1024x576.jpg\" alt=\"\" class=\"wp-image-3466\" title=\"\" srcset=\"https:\/\/www.differenzsystem.com\/blog\/wp-content\/uploads\/2024\/09\/Push-Notification-Inner-Image--1024x576.jpg 1024w, https:\/\/www.differenzsystem.com\/blog\/wp-content\/uploads\/2024\/09\/Push-Notification-Inner-Image--300x169.jpg 300w, https:\/\/www.differenzsystem.com\/blog\/wp-content\/uploads\/2024\/09\/Push-Notification-Inner-Image--768x432.jpg 768w, https:\/\/www.differenzsystem.com\/blog\/wp-content\/uploads\/2024\/09\/Push-Notification-Inner-Image--1536x864.jpg 1536w, https:\/\/www.differenzsystem.com\/blog\/wp-content\/uploads\/2024\/09\/Push-Notification-Inner-Image--2048x1152.jpg 2048w, https:\/\/www.differenzsystem.com\/blog\/wp-content\/uploads\/2024\/09\/Push-Notification-Inner-Image--30x17.jpg 30w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Set Up AWS Pinpoint for Push Notifications<\/h3>\n\n\n\n<p>1. <strong>Log in to AWS Console<\/strong> and navigate to <strong>Amazon Pinpoint<\/strong>.<\/p>\n\n\n\n<p>2. Create a New Project (or select an existing one).<\/p>\n\n\n\n<p>3. <strong>Enable Push Notification Channels<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Configure <strong>Firebase Cloud Messaging (FCM)<\/strong> for <strong>Android<\/strong>.<\/li>\n\n\n\n<li>Configure <strong>Apple Push Notification Service (APNs)<\/strong> for <strong>iOS<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>4. <strong>Set Up Firebase for Android<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Go to Firebase Console \u2192 Select your project \u2192 Project Settings \u2192 Service Accounts<\/strong>.<\/li>\n\n\n\n<li><strong>Generate and download the JSON private key file<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>5. <strong>Set Up APNs for iOS<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Obtain <strong>Team ID, Auth Key, Bundle ID, and .p8 Certificate<\/strong> from <strong>Apple Developer Console<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>6. <strong>Retrieve AWS Pinpoint Application ID<\/strong> \u2013 This ID will be used for API calls in <strong>Salesforce<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Configure Salesforce to Call AWS Pinpoint API<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>Enable External API Calls in Salesforce<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Go to Salesforce Setup \u2192 Remote Site Settings<\/strong>.<\/li>\n\n\n\n<li><strong>Add AWS Pinpoint API URL<\/strong> as a <strong>trusted remote site<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Create an Apex Class to Send Push Notifications<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Salesforce will use <strong>Apex Code<\/strong> to call the <strong>AWS Pinpoint API<\/strong> and send push notifications.<\/li>\n<\/ul>\n\n\n\n<p><strong>AWS Pinpoint API Endpoint.<\/strong><\/p>\n\n\n\n<p>https:\/\/pinpoint.{aws_region}.amazonaws.com\/v1\/apps\/{pinpoint_project_id}\/messages<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>{aws_region} \u2192 Your AWS region (e.g., us-east-1).<\/li>\n\n\n\n<li>{pinpoint_project_id} \u2192 Your AWS Pinpoint application ID.<\/li>\n<\/ul>\n\n\n\n<p><strong>API Payload Structure<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \n    \"MessageConfiguration\": { \n        \"GCMMessage\": { \n            \"Body\": \"Hello, this is a push notification!\", \n            \"Title\": \"Notification Title\", \n            \"Action\": \"OPEN_APP\",\n            \"Data\": { \"key\": \"value\" }\n        }, \n        \"APNSMessage\": { \n            \"Body\": \"Hello, this is a push notification!\", \n            \"Title\": \"Notification Title\", \n            \"Action\": \"OPEN_APP\", \n            \"Data\": { \"key\": \"value\" }\n        }\n    }, \n\n    \"Addresses\": { \n        \"deviceToken\": { \"ChannelType\": \"APNS\" }\n    }\n}\n<\/code><\/pre>\n\n\n\n<p><strong>Apex Code for Sending Push Notifications<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class AWSNotificationService {\n    \n    public static String generateSignature(String method, String service, String host, String region, \n                                           String endpoint, String requestParameters, String payload) { \n\n        String amzDate = Datetime.now().formatGMT('yyyyMMdd\\'T\\'HHmmss\\'Z\\''); \n        String dateStamp = Datetime.now().formatGMT('yyyyMMdd'); \n        String canonicalUri = endpoint; \n        String canonicalQueryString = requestParameters; \n        String canonicalHeaders = 'host:' + host + '\\n' + 'x-amz-date:' + amzDate + '\\n'; \n        String signedHeaders = 'host;x-amz-date'; \n        String payloadHash = hash(payload); \n\n        String canonicalRequest = method + '\\n' + canonicalUri + '\\n' + canonicalQueryString + '\\n' +\n                                  canonicalHeaders + '\\n' + signedHeaders + '\\n' + payloadHash; \n\n        String algorithm = 'AWS4-HMAC-SHA256'; \n        String credentialScope = dateStamp + '\/' + region + '\/' + service + '\/aws4_request'; \n        String stringToSign = algorithm + '\\n' + amzDate + '\\n' + credentialScope + '\\n' + hash(canonicalRequest); \n\n        Blob signingKey = getSignatureKey(SECRET_KEY, dateStamp, region, service); \n        String signature = hmacSHA256(stringToSign, signingKey); \n\n        String authorizationHeader = algorithm + ' ' + 'Credential=' + ACCESS_KEY + '\/' + credentialScope + \n                                     ', SignedHeaders=' + signedHeaders + ', Signature=' + signature; \n        return authorizationHeader; \n    }\n\n    @future(callout = true)\n    public static void sendPushNotification(String message) { \n\n        try { \n            String method = 'POST';\n            String service = 'mobiletargeting';\n            String host = 'pinpoint.us-east-1.amazonaws.com';\n            String region = 'us-east-1';\n            String endpoint = '\/v1\/apps\/YOUR_APP_ID\/messages';\n            String requestParameters = '';\n            String payload = message;     \n\n            String authorizationHeader = generateSignature(method, service, host, region, endpoint, requestParameters, payload); \n\n            HttpRequest req = new HttpRequest();\n            req.setEndpoint('https:\/\/' + host + endpoint);\n            req.setMethod(method);\n            req.setHeader('Authorization', authorizationHeader);\n            req.setHeader('x-amz-date', Datetime.now().formatGMT('yyyyMMdd\\'T\\'HHmmss\\'Z\\'')); \n            req.setHeader('Content-Type', 'application\/json'); \n            req.setBody(payload);\n\n            Http http = new Http();\n            HttpResponse res = http.send(req);\n\n            System.debug(res.getStatusCode()); \n            System.debug(res.getStatus()); \n            System.debug(res.getBody()); \n\n        } catch (Exception e) { \n            System.debug(e.getMessage()); \n        } \n    }\n}\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Configure Mobile Apps to Receive Push Notifications<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>For Android<\/strong>: Follow <a href=\"https:\/\/docs.amplify.aws\/gen1\/android\/build-a-backend\/push-notifications\/set-up-push-notifications\/\" target=\"_blank\" rel=\"noopener\">AWS Amplify Android Push Notification Guide<\/a>.<\/li>\n\n\n\n<li><strong>For iOS<\/strong>: Follow <a href=\"https:\/\/docs.amplify.aws\/gen1\/swift\/build-a-backend\/push-notifications\/set-up-push-notifications\/\" target=\"_blank\" rel=\"noopener\">AWS Amplify iOS Push Notification Guide<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>By integrating AWS Pinpoint, businesses can overcome Salesforce\u2019s limitations and send push notifications to contacts, leads, and customers. This scalable, automated approach improves user engagement and communication.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Salesforce cannot send push notifications directly to external users.<\/li>\n\n\n\n<li>AWS Pinpoint acts as a bridge to deliver notifications to mobile apps.<\/li>\n\n\n\n<li>Multi-platform support enables seamless push notifications for both Android and iOS.<\/li>\n\n\n\n<li>Real-time tracking and analytics enhance campaign effectiveness.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<div class=\"wp-block-rank-math-faq-block\"><div class=\"rank-math-faq-item\"><h3 class=\"rank-math-question\">1. Can I send push notifications from Salesforce without AWS Pinpoint?<\/h3><div class=\"rank-math-answer\">Salesforce supports push notifications only for users within the Salesforce platform, while AWS Pinpoint enables notifications to be sent to external users, such as customers or leads.<\/div><\/div><div class=\"rank-math-faq-item\"><h3 class=\"rank-math-question\">2. How secure is AWS Pinpoint for sending push notifications?<\/h3><div class=\"rank-math-answer\">AWS Pinpoint uses secure authentication, encryption, and access control to ensure safe communication between Salesforce and mobile applications.<\/div><\/div><div class=\"rank-math-faq-item\"><h3 class=\"rank-math-question\">3. What happens if a push notification fails to deliver?<\/h3><div class=\"rank-math-answer\">AWS Pinpoint provides real-time analytics and logs errors for failed notifications, allowing you to monitor metrics and troubleshoot delivery issues.<\/div><\/div><div class=\"rank-math-faq-item\"><h3 class=\"rank-math-question\">4. Is AWS Pinpoint cost effective for businesses?<\/h3><div class=\"rank-math-answer\">Yes, AWS Pinpoint offers reliable usage-based pricing. It is a more affordable solution than building an in-house notification system.<\/div><\/div><div class=\"rank-math-faq-item\"><h3 class=\"rank-math-question\">5. How do I integrate AWS Pinpoint with a mobile app?<\/h3><div class=\"rank-math-answer\">You need to configure Firebase Cloud Messaging (FCM) for Android and Apple Push Notification Service (APNs) for iOS. AWS Pinpoint then connects to these services to send push notifications.<\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Sending push notifications from Salesforce to mobile applications can be challenging due to Salesforce\u2019s limitations. By default, Salesforce requires a Connected App to send notifications, but this only allows notifications to be sent to Salesforce users, not to external contacts or leads. To address this limitation, we use AWS Pinpoint as an intermediary service between [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5079,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[109,107,108,106,99],"class_list":["post-3444","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-salesforce-development","tag-apex-class","tag-aws-pinpoint","tag-mobile-app","tag-push-notifications","tag-salesforce"],"rank_math_description":"Learn how to Sending Push Notifications from Salesforce to mobile apps using AWS Pinpoint. Overcome Salesforce's limitations and engage contacts, leads","category_names":["Salesforce Development"],"author_name":"Differenz System","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/posts\/3444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/comments?post=3444"}],"version-history":[{"count":23,"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/posts\/3444\/revisions"}],"predecessor-version":[{"id":6491,"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/posts\/3444\/revisions\/6491"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/media\/5079"}],"wp:attachment":[{"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/media?parent=3444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/categories?post=3444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.differenzsystem.com\/blog\/wp-json\/wp\/v2\/tags?post=3444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}