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
Justas SerstkovasJustas Serstkovas 

null in the request URL to get Chatter group feed after first login - Salesforce Mobile SDK iOS

Hi All,

I spent quite some time trying figure out this issue, so asking your help please.

I am currently implementing Chatter integration into one of our applications - just after login to Chatter it gets private group feed. We do require ask for login only when user open one of subviews, where data should be displayed (so we don't start login process in AppDelegate as template and examples suggest). Implementation works fine, but when we login for the first time, we get succesful confirmation on login, but begining of url to get the feed generated by SKD has null in the begining of url for the first time we try access it. No matter how many time we will try to call to get a feed, it will be the same invalid url. But If we close the app completely and open it up again, it becomes valid.

So when we try to get the date for the first time after login, we get this:

request:didFailLoadWithError: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x12774760 {NSErrorFailingURLStringKey=https://(null)/services/data/v28.0/chatter/feeds/record/0F9D00000000MYi/feed-items/, NSErrorFailingURLKey=https://(null)/services/data/v28.0/chatter/feeds/record/0F9D00000000MYi/feed-items/, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0xdc44d50 "A server with the specified hostname could not be found."}

As you can see there is missing domain https://(null), but when we close the app, and open it up again, it becomes valid, and is valid every single time after that.

Here's the test call I am making to get the Chatter group feed:

- (void) fetchChatterFeed
    self.requestChatterFeed= [[SFRestAPI sharedInstance] requestForResources];
    self.requestChatterFeed.path = [NSString stringWithFormat:@"%@%@%@%@", self.requestChatterFeed.path, @"/chatter/feeds/record/", CHATTER_GROUP_ID,  @"/feed-items/"];
    [[SFRestAPI sharedInstance] send:self.requestChatterFeed delegate:self];

Am I missing something very obvious here?

Thanks a lot for taking you time to read and understand the question,
Justas SerstkovasJustas Serstkovas
Oh, sorry, the line before output which has null in it below:
ERROR|SFNetworkOperation|callDelegateDidFailWithError A server with the specified hostname could not be found.

could give some additional info to understand the issue.
The Mobile SDK team has a new forum where the team addresses questions. Please post your question here - SalesforceMobileSDK (