-
Notifications
You must be signed in to change notification settings - Fork 127
Using Messenger on Desktop
Murhaf Sousli edited this page May 31, 2024
·
4 revisions
While the Messenger share button works without issues on Mobile, it won't work out of the box on desktop like the rest of the share buttons, FB requires setting special parameters in the sharer URL.
To make Messenger button work on desktop, you will need to set the appId
and the redirectUrl
.
You can either add the meta tag in your index.html
, for example:
<head>
<meta property="fb:app_id" content="YOUR_FB_APP_ID"/>
</head>
Or using the global config:
import { provideShareButtonsOptions, withConfig } from 'ngx-sharebuttons';
export const appConfig: ApplicationConfig = {
providers: [
provideShareButtonsOptions(
withConfig({
messengerAppId: 'YOUR_FB_APP_ID'
})
)
]
};
The redirectUrl
should be set using the component input [redirectUrl]
:
<share-buttons [redirectUrl]="messengerRedirectUrl"/>