I have some code that triggers a Chatter Mention to a specific user. I want the user to be able to click this link on their phone and be taken to a visualforce page. This works exactly as intended when on a desktop but when using the Salesforce1 app, it only takes me to the contact record and not the VF page. Any ideas as to why this would be happening? My VF page is "Available for Salesforce Mobile Apps", so I can't figure out why this would be happening!
Chatter Utils Method:
public static void mentionLinkPost(Id userId, Id userToMentionId, String url, String urlName) {
ConnectApi.FeedItemInput feedInput = new ConnectApi.FeedItemInput();
feedInput.body = new ConnectApi.MessageBodyInput();
// add some text before the mention
ConnectApi.TextSegmentInput textSegment = new ConnectApi.TextSegmentInput();
feedInput.body.messageSegments = new List<ConnectApi.MessageSegmentInput>();
textSegment.text = '';
feedInput.body.messageSegments.add(textSegment);
// add the mention
ConnectApi.MentionSegmentInput mentionSegment = new ConnectApi.MentionSegmentInput();
mentionSegment.id = userToMentionId;
feedInput.body.messageSegments.add(mentionSegment);
/*// add the text that was passed
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = postText;
messageInput.messageSegments.add(textSegment);*/
ConnectApi.LinkAttachmentInput linkIn = new ConnectApi.LinkAttachmentInput();
linkIn.urlName = urlName;
linkIn.url = url;
feedInput.attachment = linkIn;
/*ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
input.body = feedInput;*/
// post it
ConnectApi.ChatterFeeds.postFeedItem(null, ConnectApi.FeedType.UserProfile, userId, feedinput, null);
}
Part of the class that calls the Method:
ChatterUtils.mentionLinkPost(UserInfo.getUserId(),userList[0].id,'/apex/directConfirm?id='+contItem.id,'Accept Lead for '+contItem.Name);
Visualforce Page:
<apex:page controller="ConfirmationController" tabstyle="Contact" showHeader="false" sidebar="false" action="{!accept}">
</apex:page>
In this case, the userList[0].id is the user I'm mentioning, which works just fine. The "contItem.id" is the Contact Id that I am passing to my VF page, which once again, works perfectly well on a desktop but not at all on the SF1 app. Instead of taking me to the VF page in the app, I'm taken directly to the contact record instead. The VF page is calling an action which basically changes the ownerId of the contact to that of the running user.
Any ideas or insight would be greatly appreciated!