I want to display Get Started button with banner image as per shown in image.
I know how to show get_started button but facing issue with Banner image with greet text.
Need help for achieving this. I tried with below request but no success.
For displaying get-started I used,
{
"setting_type" : "call_to_actions",
"thread_state" : "new_thread",
"call_to_actions":[
{
"payload":"USER_DEFINED_PAYLOAD"
}
]
}
But not getting how to set banner image with this request. Also I tried with,
{
"message":{
"attachment":{
"type":"image",
"payload":{
"is_reusable": true,
"url":"url"
}
}
}
}
In response getting "attachment_id" but not getting where to use it. Please help on this.
Added the chatbot welcome screen screenshot for reference.
Images seen on the example Get Started page you posted are coming from Facebook Page's profile picture and cover photo.
There doesn't seem to be an option in the API to attach a different image to Get Started today.
To get the "banner" show up, add a cover photo to your Facebook Page.
Related
My application has the following structure:
- InheritedWidget for dependencies
--> Splash Screen Page
--> Login Pages
--> Main Pages
When the app runs for the first time, I can use var link = await getInitialLink(); to get the value for the link that opened the app.
However, I cannot get the same result if I open the app on the background.
I tried to use
getLinksStream().listen((link) => (link) {
try {
var _latestUri;
if (link != null) _latestUri = Uri.parse(link);
print("=== Formated successfully a link!");
} on FormatException {
print("--- A link got here but was invalid");
}
});
For getting the link in the Splash Screen, but if the app is already open in the Login or Main pages, it won't go through the Splash Screen again.
Then, I tried to put it in the InheritedWidget, but alas, didn't get any result whatsoever.
So my question is: Where and how should I set up uni_links so that I can catch all incoming links even if the app is open?
Or better, is there an alternative for App Links/Universal Links that I can use?
Though it's not the best and most elegant way, I got around this.
First, I was not using getLinksStream correctly
Instead of
(link) => (link) {...}
It's
(link) {...}
Then, I need to put this subscription in my Splash Screen and do not dispose of it, so that it can listen to new events.
If anybody has a better solution, please free to add it
For this situation, you need to use both of getInitialUri() and getUriLinksStream(),
If app launchs directly u will get uri from getInitialUri, if app already running on background u will get uri from getUriLinksStream.
This is what I'm doing:
FB.ui({
method: "feed",
link: "https://link-to-site.ninja",
source: "https://url-to-s3-hosted-video.mp4",
caption: "Video caption",
type: "video",
description: "Video desc"
}, function(response){});
(Also tried different combinations, with and without picture, in which case what would end up showing was the picture and not the clickable video)
And I'm getting either no preview whatsoever, or just the preview image if I provide one, not an actual clickable previewable video. What am I doing wrong? How do I can I get this right?
Thanks!
Turns out you need to put the source as link and it will work (as of 05/2016) but you cannot make it link to another place that's not the video itself.
The goal :
I would like to have a share button in my fancybox that share the image I'm looking at with the correct image name in the Facebook sharer. I would like that when a user click on this in Facebook, he arrives on an opened Fancybox with the correct image.
The problem :
I have a gallery with Jquery FancyBox (http://fancyapps.com/fancybox/). I added a share button with the code I find in this fiddle (http://jsfiddle.net/G5TC3/).
My share button works, but get the meta og from the site and I want to have the og:image from the image I'm looking at.
$(".fancybox")
.attr('rel', 'gallery')
.fancybox({
beforeShow: function () {
if (this.title) {
// Add FaceBook like button
this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=' + this.href + '&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px;" allowTransparency="true"></iframe>';
}
},
helpers : {
title : {
type: 'inside'
}
}
});
For the user who clicks on my link and arrives on an opened Facybox with the correct image I have no idea how to do that and if it's possible.
What I know:
I know that I have to have uniques URL for each images and I think I have it. ex from my site:
www.myURL.com/images/gallery/myimages_1.jpg
www.myURL.com/images/gallery/myimages_2.jpg
Is it correct?
I think I have to change the "this.href" in the sharer by the image url. First is it correct? And second (sorry I'm new in javascript) how can I do that?
I hope somebody could help me. Sorry for my English I'm trying to write my best English :)
If you need more information please do not hesitate.
Thanks
[EDIT]:
I add this script on the gallery page
$(function()
{
$('.thumbs').click(function()
{
$tempImgName = $(this).attr('id');
$tempUrl = this.href + '/images/thumbs/' + $tempImgName;
$meta = document.getElementById('facebook');
$meta.setAttribute("content",$tempUrl);
});
});
So when I click on a thumbsnail (with the class .thumbs) I get the image URL and I change the meta (with the facebook Id). It works but I think Facebook check the meta when the page load so how can I force Facebook to recheck my meta to take the good thumbs to share?
og:image cannot change by url. You need to give different share urls for different images.
For example :-
www.myURL.com/?pic=img1
www.myURL.com/?pic=img2 etc.
And a server side language ( like php ) can read the "pic" GET argument and change the og:image.
We are using the following code to generate a Facebook app request dialog in our Facebook canvas app.
var options = {
method : 'apprequests',
message : 'MESSAGE',
title : 'TITLE'};
FB.ui(options, function() {alert("called back");});
When we make this call in mobile Safari on an iPad, the height of the app request dialog extends well beyond the height of the canvas, so that the user scrolls down to see a very long dialog on top of a blank background toward the bottom of the page.
Please note that this does not occur in the Facebook iPad app itself, only when accessing facebook.com through mobile Safari.
I've tried calling FB.ui with the 'touch' option - doesn't help.
I've tried calling FB.ui with the 'iframe' option and an access_token - I get a 191 error which I haven't been able to figure out how to fix.
I've made various attempts to set styles for the DOM elements that I can see make up the app request, but this isn't working.
I've tried to use
FB.Canvas.setSize($('body').height())
to force the size of the canvas in the hopes that the overlaid dialog would respect it, but no such luck.
The other approach I've considered is attempting to manipulate some of these DOM elements in the app request dialog, but this is not looking promising.
Height setting on this canvas app. is "Settable". Changing it to "Fluid" doesn't help.
Any help is appreciated.
Wes
Update - 12/19/11: The following bug is now being worked on by Facebook: https://developers.facebook.com/bugs/255079837889099
How can I show a youtube or bits on the run video full screen on my app? Is there a special link I have to naviate to? Or is there a special API that takes care of that to view it fullscreen?
The idea is to click on a link 'show video', then show the video fullscreen, and get a button play pauze and 'done'. When clicked done it goes back to the previous page.
I don't know how to get started on this one. Can anyone help me out?
I'm creating an iPhone app.
Thanks!
#Muhammad has the first part right but to get it to close when you hit the blue done button you'll need the following code.
replace
win.add(activeMovie);
activeMovie.play();
with
win.add(activeMovie);
activeMovie.fullscreen = 1; // this must be defined after you add to the window!
activeMovie.play();
then add this
activeMovie.addEventListener('fullscreen', function(e) {
if(!e.entering) { // this is run only when exiting fullscreen aka the blue done button
activeMovie.stop();
}
});
Here is a an example code to show video with controlls
var win = Titanium.UI.currentWindow;
var contentURL = 'http://movies.apple.com/media/us/ipad/2010/tours/apple-ipad-video-us-20100127_r848-9cie.mov';
var activeMovie = Titanium.Media.createVideoPlayer({
contentURL: contentURL,
backgroundColor:'#111',
movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
});
win.add(activeMovie);
activeMovie.play();
Hope this will help.