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
Sean Le 6Sean Le 6 

Push Notification Resources (Chatter rest api) does not work.

Hello everyone,

I am developing a native iOS app using Salesforce SDK (connected app). I want to use push notification api to send notification to anyone who is involved in some events (out of Salesforce). But it does not work for me.
https://developer.salesforce.com/docs/atlas.en-us.pushImplGuide.meta/pushImplGuide/connect_resources_notifcations_push.htm

 Here's the uri which I use to send a post method:
/services/data/v31.0/connect/notifications/push

and the server returned an error:
{
        "message": "The requested API is not available to portal users. You may need to specify a community for portal user access.",
        "errorCode": "FUNCTIONALITY_NOT_ENABLED"
}
alouie_sfdcalouie_sfdc
For communities, use this resource:

/services/data/v31.0/connect/communities/communityId/notifications/push

See the information about constructing the community URLs here:
https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_building_url.htm
Sean Le 6Sean Le 6
It's still not working. I used the uri as below:
/services/data/v31.0/connect/communities/0DBq00000008OQdGAM/notifications/push

the server returned an error:
    {
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
Sasha_SFDCSasha_SFDC

@Sean

This resource is only accessible when the session is created with the connected application created in the same organization as the application you're trying to send notifications to. Use /services/data/v31.0/connect/notifications/push URI.
BlueCloudBlueCloud
@Sean Le 6:  Did you get it work?  I have the same issue. Getting a 404 on 
/services/data/v31.0/connect/communities/{communityId}/notifications/push
Sasha_SFDCSasha_SFDC
@BlueCloud You should use /services/data/v31.0/connect/notifications/push, but make sure that you're using the session from the connected application that is created in your org.
BlueCloudBlueCloud
that's not working for communities. Also, it looks like it won't work for a third party app created by a vendor/developer org

So here is the  scenario:-

                1. Vendor/Develoepr ABC Co. creates a remote/connected  app (mobile) in their develoepr org.
                2. John Doe from MNC. Co downloads the app and uses it to login to his Org using his credentials.
                3. Now app wants to send a PUSH notification using the REST API to another user in John Doe's organization. 

According the documentation this won't work because the App is created in a different Org. Is that true?