Send iOS Notifications

Description

This API is used to send push notifications to the user devices for your iOS app. Before you send push notifications for your iOS app, you must register your app and obtain an APNs certificate. You can learn more from this help section.

Note: Catalyst Push Notifications feature is not available to Catalyst users accessing from the EU and IN data centers.

Request URL

https://api.catalyst.zoho.com/baas/v1/project/{project_id}/push-notification/{app_id}/project-user/notify

project_id - The unique ID of the project

app_id - The unique ID of the app. You can obtain this after registering your app with Apple.

Request Method

POST

Scope

scope= ZohoCatalyst.notifications.mobile

Request Body

AttributesData TypeMandatoryDescription
recipientsStringYesDenotes the email address or the user ID of the user that the push notification must be sent to
push_detailsShow propertiesJSON ObjectYesThis JSON contains the details of the push notification's message.

push_details Properties

AttributeData TypeMandatoryMax SizeDescription
messagestringYes100Denotes the content of the push notification
additional_infoJSON ObjectNo100Denotes any additional information that you need to send
badge_countIntegerNo Denotes the count to be displayed over the app's icon
reference_idStringNo Denotes the ID for reference
expiry_timeIntegerNo Denotes the time of expiry of the notification in hours

Request


				curl -X POST \
  https://api.catalyst.zoho.com/baas/v1/project/204000000024010/push-notification/204000000036005/project-user/notify \
  -H 'Content-Type: application/json' \
  -d '{
   "recipients":["amanda.boyle@zylker.com","henry.mj@zylker.com"],
   "push_details":{
   "message":"Welcome to Zylker App!",
   "badge_count":10,
   "expiry_time":12,
   "additional_info":{
         "sample_key" : "sample_value"
   }
   }
}'			

Response


				{
    "status": "success",
    "data": {
        "recipients": ["amanda.boyle@zylker.com","henry.mj@zylker.com"],
        "push_details": {
            "message": "Welcome to Zylker App!",
            "additional_info": {
                "sample_key": "sample_value"
            },
            "badge_count": 10,
            "reference_id": null,
            "expiry_time": 12
        }
    }
}			

SDK code snippet


				ZCMobileNotification mobNotification = ZCMobileNotification.getInstance().registerApp(appId); //appId will be obtained after registering the app for notification
ZCPush push = ZCPush.getInstance();
push.setBadgeCount(10);
push.setMessage("Welcome to Zylker App!");
push = mobNotification.sendNotification(push, id); //id can be user ID or user's email address			

SDK code snippet


				app.pushNotification().mobile(123123123213) // app is the object instance generated from initialisation of sdk
 	.sendNotification({ message: 'Welcome to Zylker App!' }, 'joanna.munroe@zylker.com')
 	.then((result) => {

 	})
 	.catch((err) => {});