Mobile Push Notifications in Zoho PageSense

Learn how to set up Mobile Push Notification in Android devices

1. Ensure you have enabled Push Notification inside PageSense dashboard.
2. Add Firebase to your Android project.  
3. In the top-left pane, click on the settings icon beside Project Overview.
4. Click Project settings.

5. Inside Project Settings, navigate to Service accounts.
6. Click Generate new private key.

7. This will generate a service account JSON file containing the Private key.
8. Download the JSON file and upload it to your PageSense dashboard.
Info
Learn how to upload JSON file? Under Android setup, refer to points six and below.
9. Ensure the Firebase Cloud Messaging (FCM) API (V1) is enabled under the Cloud Messaging of the FCM console.

10. If it's disabled, click the three-dot icon beside the Firebase Cloud Messaging API (V1), and select Manage API in Google Cloud Console and click Enable.



How to set up a Firebase Cloud Messaging (FCM) on client app for Android:

Once FCM is setup, follow the below steps to begin receiving notifications in the device.
1. Add the below code to the app level manifest file. This enables us to receive notification from Firebase.
  1. <service android:name=".NotificationFCMReceiver" 
     android:exported="false"> 
     <intent-filter> 
            <action android:name="com.google.firebase.MESSAGING_EVENT" /> 
     </intent-filter> 
     </service> 
2. Add the class which extends FirebaseMessagingService to your App’s project. Please refer to the below code based on your preferred language:
For JAVA, use the below code:
  1. import com.google.firebase.messaging.FirebaseMessagingService;
  2. import com.google.firebase.messaging.RemoteMessage;
  3. import com.zoho.pagesense.android.PSNotification;
  4. public class NotificationFCMReceiver extends FirebaseMessagingService {
  5.     @Override
  6.      public void onNewToken(@NonNull String s) {
  7.                  super.onNewToken(s);
  8.                  PSNotification.sendDeviceToken(s);
  9.      }
  10.     @Override
  11.      public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
  12.                  super.onMessageReceived(remoteMessage);
  13. if(PSNotification.isFromPageSensePlatform(remoteMessage.getData())) {
      PSNotification.showNotification(remoteMessage.getData(),
  14.                           com.zoho.pagesense.android.R.drawable.notification_bg);
  15.                  }
  16.        }
  17. }
For KOTLIN, use the below code:
  1. import com.google.firebase.messaging.FirebaseMessagingService
  2. import com.google.firebase.messaging.RemoteMessage
  3. import com.zoho.pagesense.android.PSNotification
  4. class NotificationFCMReceiver : FirebaseMessagingService() {
  5.     override fun onNewToken(s: String) {
  6.                 super.onNewToken(s)
  7.                  PSNotification.sendDeviceToken(s)
  8.      }
  9.     override fun onMessageReceived(remoteMessage: RemoteMessage) {
  10.                super.onMessageReceived(remoteMessage) 
  11.                if (PSNotification.isFromPageSensePlatform(remoteMessage.data)) {
  12.                          PSNotification.showNotification(remoteMessage.data,
  13.                          com.zoho.pagesense.android.R.drawable.notification_bg)
  14.                 }
  15.      }
  16. }
Info
  1. onNewToken will be called when device token is generated. Use the API PSNotification.sendDeviceToken(s) to send the token to Zoho PageSense.
  2. onMessageReceived will be called when a notification is received. Here, you will need to call the PSNotification.isFromPageSensePlatform(remoteMessage.getData()) API to check whether notification is from Pagesense or not. After that, you need to call API PSNotification.showNotification(remoteMessage.getData(), com.zoho.pagesense.android.R.drawable.notification_bg); by sending the data and notification icon.

Permissions required for run-time:

In Android 13 and above, it is mandatory to add POST_NOTIFICATIONS permissions in the AndroidManifest.xml file and request runtime permissions to post notifications. For more information, refer to this Android developer document. 

In Android 12 and above, the below permissions should be enabled to process the call and snooze buttons inside notifications.
  1. <uses-permission android:name="android.permission.CALL_PHONE"/>
  2. <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> 
We hope this documentation helps make the process easy for you. Please feel free to reach out to us anytime by dropping an email to support@zohopagesense.com if you need more explanation or have any questions.

      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit

                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure Forms

                              WCAG



                                        Create. Review. Publish.

                                        Write, edit, collaborate on, and publish documents to different content management platforms.

                                        Get Started Now







                                                          You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                              Manage your brands on social media


                                                                • Desk Community Learning Series


                                                                • Digest


                                                                • Functions


                                                                • Meetups


                                                                • Kbase


                                                                • Resources


                                                                • Glossary


                                                                • Desk Marketplace


                                                                • MVP Corner


                                                                • Word of the Day


                                                                • Ask the Experts


                                                                  Zoho Sheet Resources

                                                                   

                                                                      Zoho Forms Resources


                                                                        Secure your business
                                                                        communication with Zoho Mail


                                                                        Mail on the move with
                                                                        Zoho Mail mobile application

                                                                          Stay on top of your schedule
                                                                          at all times


                                                                          Carry your calendar with you
                                                                          Anytime, anywhere




                                                                                Zoho Sign Resources

                                                                                  Sign, Paperless!

                                                                                  Sign and send business documents on the go!

                                                                                  Get Started Now




                                                                                          Zoho TeamInbox Resources





                                                                                                    Zoho DataPrep Demo

                                                                                                    Get a personalized demo or POC

                                                                                                    REGISTER NOW


                                                                                                      Design. Discuss. Deliver.

                                                                                                      Create visually engaging stories with Zoho Show.

                                                                                                      Get Started Now









                                                                                                                          • Related Articles

                                                                                                                          • Create your first mobile push notifications for Android

                                                                                                                            Mobile push notifications help drive appropriate interactions to boost conversions on Android devices. You will get a complete walkthrough on setting up Mobile Push Notifications for Android in PageSense. You will learn all the configurations needed, ...
                                                                                                                          • Understand your push notification report

                                                                                                                            Track and analyze the impact of your push notification among your subscribers using realtime results. Zoho PageSense allows you to evaluate the success of each notification, with detailed reports based on which notification performed the best, which ...
                                                                                                                          • Get started with your PageSense Mobile Push Notifications

                                                                                                                            Building and maintaining an efficient relationship with your user group is crucial and mobile push notifications are spot-on the most effective way. From interacting with your consumers, boosting conversions, and improving user experience—it’s a ...
                                                                                                                          • Set goals and launch your push notification

                                                                                                                            The primary goal of any notification is to evoke a desired action from the users reaching your website. You can easily track this by creating different types of goals for your targeted audience on PageSense. These can trigger automated ...
                                                                                                                          • Learn how to set up mobile push notification in iOS devices - A Quick Guide

                                                                                                                            Zoho PageSense provides an iOS SDK that enables app developers to track, segment, and engage users. This document shows how to install the PageSense SDK in your application, track your first user event within the PageSense dashboard. How to install ...
                                                                                                                            Wherever you are is as good as
                                                                                                                            your workplace

                                                                                                                              Resources

                                                                                                                              Videos

                                                                                                                              Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                              eBooks

                                                                                                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                              Webinars

                                                                                                                              Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                              CRM Tips

                                                                                                                              Make the most of Zoho CRM with these useful tips.



                                                                                                                                Zoho Show Resources