• Niklas Alvaeus
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 3
    Questions
  • 7
    Replies
Are there any samples or docs for this. I've attempted to create an Apex Trigger on FeedComment, but it's just doesn't seem to work. I would also have to get the user ID of the original post etc.

Essentially all I want to do is send push to a user who's post was commented on. Seems like a pretty standard thing to do. Is there no easy way to do this with the Chatter API?
I've got a native iOS app working fine with SwiftlySalesforce, attempting to set it up with SalesforceMobileSDK I keep getting an oAuth error saying

SFOAuthCoordinator:didFailLoadWithError: error code: -999, description: The operation couldn’t be completed. (NSURLErrorDomain error -999.), URL: https://eu11.salesforce.com/setup/secur/RemoteAccessAuthorizationPage.apexp
I'm succesfully using SwiftlySalesforce to auth a user and load and save custom object from the Salesforce instance.

However, I'm now trying to talk to Chatter API and all it comes back with is The requested resource does not exist.

I presume I'm mean to use the salesforce.apexRest but struggling in how to build the path, or am I missing some setup on the Chatter Admin? Are there any good tutorials on this for iOS?

I'm trying

salesforce.apexRest(method: .get, path: "/services/data/v38.0/chatter/feed-elements", parameters: query, headers: nil).then

But not sure what the app instance is I need to add infront of /services
Are there any samples or docs for this. I've attempted to create an Apex Trigger on FeedComment, but it's just doesn't seem to work. I would also have to get the user ID of the original post etc.

Essentially all I want to do is send push to a user who's post was commented on. Seems like a pretty standard thing to do. Is there no easy way to do this with the Chatter API?
I'm succesfully using SwiftlySalesforce to auth a user and load and save custom object from the Salesforce instance.

However, I'm now trying to talk to Chatter API and all it comes back with is The requested resource does not exist.

I presume I'm mean to use the salesforce.apexRest but struggling in how to build the path, or am I missing some setup on the Chatter Admin? Are there any good tutorials on this for iOS?

I'm trying

salesforce.apexRest(method: .get, path: "/services/data/v38.0/chatter/feed-elements", parameters: query, headers: nil).then

But not sure what the app instance is I need to add infront of /services
Hi, we are using apex trigger to send push notifications to ios device and we followed this tutorial https://developer.salesforce.com/docs/atlas.en-us.pushImplGuide.meta/pushImplGuide/pns_apex_trigger.htm.
well we are able to sending push notifications though salesforce console using devicetoken but while sending from apex trigger we need to send user id,  so here my question is  how device token mapped to user ,who is mapping and when is mapping?

salesforce tutorial doesn't have much information about device token mapping to user. can anyone please help me.

Thanks,
Mallikarjun
 
Hi Team,
               I am a new to the salesforce Integration.I am iOS Developer and wanted to know about the integration of Chatter API of my iOS App. I have seem  https://github.com/cseymourSF/Chatter-API-iOS-Sample  link of github but it is outdated can anyone help me on this Please?
In Objective C, I follow the steps as outlined here and it works fine: https://developer.salesforce.com/docs/atlas.en-us.noversion.mobile_sdk.meta/mobile_sdk/ios_rest_apis_using_methods.htm?search_text=forceios

But when following the same steps translating the code into Swift, I run into an issue with the SFRestRequest initializer, whose signature is below:
 
Public convenience init(method: SFRestMethod, path: String, queryParams: [String : String]?)

As you can see, queryParams takes a Swift Dictionary with a key and value of the String type.  But when you follow the example, it seems you end up with a Dictionary with a key of the String type and value of the Dictionary type; and thus we have a type mismatch.

This doesn't seem to be a problem in Objective C, because upon inspection of the method signature in SFRestRequest.m, queryParams appears to be able to take a generic NSDictionary: 
 
+ (instancetype)requestWithMethod:(SFRestMethod)method path:(NSString *)path queryParams:(NSDictionary *)queryParams

For reference here is the Swift code I'm trying out:
 
//build the queryParams dictionary from a JSON String
let body: String = "{ \"body\" :{\"messageSegments\" :[{ \"type\" : \"Text\",\"text\" : \"My Comment\"}]}}"
        let queryParams = SFJsonUtils.objectFromJSONString(body) as! [String:AnyObject] 
//construct and send the request
        let request = SFRestRequest(method: SFRestMethod.POST, path: "/services/data/v36.0/connect/communities/my_community_ID/chatter/feed-elements/my_element_ID/capabilities/comments/items", queryParams: queryParams as? [String:String])
        SFRestAPI.sharedInstance().send(request, delegate: self)

But unwrapping queryParams fails and resolves to nil.  Trying to forcefully cast queryParams to [String:String] does not work either, and just causes a crash.

How might I get around this?
 

hi,

 i'm trying to access salesforce.com and obtain details from my account (querying information) programmatically. the authorization is successful and i'm able to get my user details but the search pattern i give is not returning any matches.

this is the id it returns on successful login:

id = https://login.salesforce.com/id/00D90000000fon0EAA/005900000014ZuzAAE

the url i'm using to query is :

https://ap1.salesforce.com/services/services/data/v25.0/search/?q=FIND+%7Bfrank%7D

the error message i get in response to this is :

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

do i need any additional previlages in order to make such a request and access the data? i currently have a developer account.

or is there any other way to make such a request?

please reply , thanks in advance.

 

I currently have a developer working on an iOS app that would benefit from having chatter inside it. I am wondering how difficult is it to create a chatter view and post like seesmic? I am actually surprised there is no pre built code for this...or is there someplace? If not, how manymhours would it take to develop this within my current app and where should I point the developer to get them started?
Hi, we are using apex trigger to send push notifications to ios device and we followed this tutorial https://developer.salesforce.com/docs/atlas.en-us.pushImplGuide.meta/pushImplGuide/pns_apex_trigger.htm.
well we are able to sending push notifications though salesforce console using devicetoken but while sending from apex trigger we need to send user id,  so here my question is  how device token mapped to user ,who is mapping and when is mapping?

salesforce tutorial doesn't have much information about device token mapping to user. can anyone please help me.

Thanks,
Mallikarjun
 
In Objective C, I follow the steps as outlined here and it works fine: https://developer.salesforce.com/docs/atlas.en-us.noversion.mobile_sdk.meta/mobile_sdk/ios_rest_apis_using_methods.htm?search_text=forceios

But when following the same steps translating the code into Swift, I run into an issue with the SFRestRequest initializer, whose signature is below:
 
Public convenience init(method: SFRestMethod, path: String, queryParams: [String : String]?)

As you can see, queryParams takes a Swift Dictionary with a key and value of the String type.  But when you follow the example, it seems you end up with a Dictionary with a key of the String type and value of the Dictionary type; and thus we have a type mismatch.

This doesn't seem to be a problem in Objective C, because upon inspection of the method signature in SFRestRequest.m, queryParams appears to be able to take a generic NSDictionary: 
 
+ (instancetype)requestWithMethod:(SFRestMethod)method path:(NSString *)path queryParams:(NSDictionary *)queryParams

For reference here is the Swift code I'm trying out:
 
//build the queryParams dictionary from a JSON String
let body: String = "{ \"body\" :{\"messageSegments\" :[{ \"type\" : \"Text\",\"text\" : \"My Comment\"}]}}"
        let queryParams = SFJsonUtils.objectFromJSONString(body) as! [String:AnyObject] 
//construct and send the request
        let request = SFRestRequest(method: SFRestMethod.POST, path: "/services/data/v36.0/connect/communities/my_community_ID/chatter/feed-elements/my_element_ID/capabilities/comments/items", queryParams: queryParams as? [String:String])
        SFRestAPI.sharedInstance().send(request, delegate: self)

But unwrapping queryParams fails and resolves to nil.  Trying to forcefully cast queryParams to [String:String] does not work either, and just causes a crash.

How might I get around this?