0

Using Salesforce SDK I achieved Push notification. To use my own login UI I used Http Get request to get access token. So I need a Http post request to register https://ap1.salesforce.com/services/data/v31.0/sobjects/MobilePushServiceDevicedevice for push notification. I Used as url and added post data like :

HttpPost postMethod=new HttpPost(url);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);                       
nameValuePairs.add(new BasicNameValuePair("ConnectionToken", registrationId));          
nameValuePairs.add(new BasicNameValuePair("ServiceType", "androidGcm"));            
postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));

But response for the post request is

[{"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}]

Please provide necessary advice.

Thanks in advance.

2
  • Did you found a solution? I've the same problem... :(
    – user20809
    May 27, 2015 at 14:05
  • Did you find any solution to this ? When I am requesting to this url, I am getting "Invalid session id" error. I am passing session id in header.
    – Dory
    Jul 22, 2015 at 7:12

2 Answers 2

3

We have to use https://ap1.salesforce.com/services/data/v31.0/sobjects/MobilePushServiceDevice/

instead of

https://ap1.salesforce.com/services/data/v31.0/sobjects/MobilePushServiceDevice

this way I resolved my issue.

1
  • The request is being made by SDK internally, how can I change the url manually? Thank you. Feb 11, 2019 at 10:51
1

MobilePushServiceDevice object is only accessible by the sessions created with the Consumer Key of the push enabled connected application. If you already made push notifications work with Salesforce Mobile SDK, you probably already have your push enabled connected application set up, so use this connected application's consumer key to create Oauth session.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .