Pre-populated data in facebook web dialog

Is there a way that I can fill any line in FBWebDialog? Any workaround would do, I know that facebook has deprecated the post option from its sdk.

My scenario is a user click on the facebook contact FBWebDialog opens, and then the message is filled with some text instead of an empty text field.

any help would be appreciated

thanks

+6
source share
1 answer

Well, from the comments, it looks like what you want to post on the user's wall. Below is a method that is available in the FB SDK that invokes the sharing dialog in your application and supports pre-filled text

[FBDialogs presentOSIntegratedShareDialogModallyFrom:self initialText:@"Initial text" image:nil url:nil handler:nil]; 

Example with pre-filled text:

Screenshot of share with pre filled text


What type of dialogue do you open? (Sounds like a send dialog if you want to send a Facebook message.)

I do not think that you can even send a message directly to a user from iOS. When doing the following, I get the error message "This dialog is not available on this device"

 [FBWebDialogs presentDialogModallyWithSession:nil dialog:@"send" parameters ... 

The iOS FB SDK WebDialog Link shows the following methods:

 + presentRequestsDialogModallyWithSession:message:title:parameters:handler: + presentRequestsDialogModallyWithSession:message:title:parameters:handler:friendCache: 

They seem to support pre-populating a message field. They only support apprequests (not messages) and even the attachment message is a bit unknown (all I saw when testing was β€œUser wants to try the application”, not the actual line I installed).

The javascript API (which could possibly be raised in webview?) Does not have a parameter for setting the message, probably because Send the online documentation :

Facebook messaging is a channel for communication between people, not applications for sending messages or encouraging people to spam friends.

If you just want to post a post / share, you can use a share sheet that looks to support the initial post:

 [FBNativeDialogs presentShareDialogModallyFrom:self initialText:@"My text to share" ... 
0
source

Source: https://habr.com/ru/post/948223/


All Articles