I'm having issues creating Ad Creatives using:
gem 'facebookbusiness'
Facebook API version 13.0
I have successfully managed to upload Ad Images and to get the image URL and image hash in return.
The error happens when trying to create the Ad Creatives
creative = #ad_account.adcreatives.create({
title: 'My Page Like Ad',
body: 'Like My Page',
object_url: 'www.facebook.com',
link_url: 'www.facebook.com',
image_url: image[0]['url'],
image_hash: image[0]['hash'],
})
I get this error:
FacebookAds::ClientError in Admins::AdsController
Invalid parameter: Missing Image (fbtrace_id: Ao0FDSCOwt9ss_5W6CmNyhx)
you should special in field object_story_spec,not in image_hash
final AdCreativeObjectStorySpec objectStorySpec = new AdCreativeObjectStorySpec()
.setFieldVideoData(new AdCreativeVideoData()
.setFieldVideoId(video.getFieldId())
.setFieldImageHash(image.getFieldHash())
.setFieldCallToAction(callToAction))
.setFieldPageId(String.valueOf(page.getId()));
account.createAdCreative()
.setObjectStorySpec(objectStorySpec);
Related
I am creating a app for Microsoft Teams. I am trying to create a tab using microsoft graph post api.
/teams/${teamId}/channels/${channelId}/tabs payload is an object with following params:
{
displayName: 'My Tab'
'teamsApp#odata.bind': 'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/com.microsoft.teamspace.tab.web',
configuration: {…},
};
Currently creating Tab with tab name 'My Tab'. How can I prepend a image along with name. e.g. '+image+ My Tab'.
There is no way to add image with displayName in Teams Tab.
This is by design.
Ref Doc : https://learn.microsoft.com/en-us/graph/api/channel-post-tabs?view=graph-rest-1.0
Could you please raise an user voice here:
Microsoft Teams Community
I want to create Ads by using Facebook Published page post. For this process, I'm able to get all Published Posts of a Page through graph API (page_id/posts). Also, I can create ad creative along with the Post_Id. However, When I use this created ad_creative id in the Ad creation process, it through this error "Invalid parameter: Ad Creative Does Not Use Valid Link."
For Doc... references: https://developers.facebook.com/docs/marketing-api/reference/ad-creative#obtaining_pp Also for generating the ad, I used this method.
ad = ad_account.ads.create({
name: ' Ad* via Post',
adset_id: under_adset_id,
creative: {
creative_id: post_creative_id,
},
status: 'PAUSED',
})
Add 'link' field to request
creative: { creative_id: post_creative_id, link: "https://stackoverflow.com/"},
I want to create a simple chat app demo using pusher chat kit.
I am following the pusher provided tutorial .I am following documentation as it is but its not working in my case .
According to pusher documentation Chatmanger class object should be instantiated as follow:
chatManager = ChatManager(
instanceLocator: "YOUR INSTANCE LOCATOR",
tokenProvider: PCTokenProvider(url: "YOUR TEST TOKEN ENDPOINT"),
userId: "YOUR USER ID"
)
but in my case when i follow same code in my demo project there is an error appeared with following parameter correction Error .
I don't know Where i am doing wrong .
What you have to do is create an account in https://pusher.com/, and then create
and a chatkitt instance.
Now you have an account and chatkit instance. To acces The chatkit instance from your .js using:
const chatkit = new Chatkit.default({
instanceLocator: "PUSHER_CHATKIT_INSTANCE_LOCATOR",
key: "PUSHER_CHATKIT_KEY"
})
PUSHER_CHATKIT_INSTANCE_LOCATOR: it's a string that you can see in pusher inside your account, it's a unique.
Additionally, you have the PUSHER_CHATKIT_KEY it's string and unique too.
both them (PUSHER_CHATKIT_INSTANCE_LOCATOR, and key), has to replace in the code above by the strings provided in your account.
i will leave you the tutorial about this step in this link:
https://pusher.com/tutorials/chat-widget-javascript#create-your-chatkit-instance
I am now using fastlane and I can post to slack like this.
version = get_version_number(xcodeproj: "***")
slack(
message: "<!here|here>: New :ios: *#{version}* has been submitted to Dev Hockey :rocket:.",
)
In terminal, I saw something like this after deployment is finished. How can I get get that url and post automatically to slack?
[15:35:04]: Public Download URL:
https://upload.hockeyapp.net/apps/52da8f2b3da60cf8b6d4eaas5f06ae9b
I am reading about their code and they are printing to terminal something like this. But, I don't know how to retrieve and post to slack.
https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/hockey.rb
Khant Thu Linn you found a good snippet.
In the fastlane docs you can see all context variables.
To get the hockey app download link use
lane_context[SharedValues::HOCKEY_DOWNLOAD_LINK]
which will be generated by hockey.
This could be an example Slack call for your fastfile:
slack(
message: "New :ios: version has been submitted to Hockey :rocket:.",
payload: {
"Hockey App Download URL" => lane_context[SharedValues::HOCKEY_DOWNLOAD_LINK]
}
)
I found out how to post hockey download url to slack from this link.
http://rolandleth.com/fastlane-fastfile-3
slack_params = {
message: 'iOS App successfully released to Hockey!',
payload: {
# 'Date' => "#{t.year}-#{t.month}-#{t.day} #{t.hour}:#{t.min} (#{t.zone})",
# Because we increase the version after each build,
# but submit before the increase
'Build' => "#{build_number.to_i - 1}",
'Version' => version_number,
'Type' => type
},
default_payloads: [:git_branch, :git_author, :last_git_commit]
}
if release_lane lane
slack_params[:message] = 'iOS App successfully submitted to the App Store!'
commit_tag_and_update_release_branch
else
slack_params[:payload]['Download Link'] = "#{Actions.lane_context[Actions::SharedValues::HOCKEY_DOWNLOAD_LINK]}"
end
slack slack_params
Does anyone know why the picture attribute is not working in following Facebook UI call?
function postToWallUsingFBUi()
{
var data=
{
method: 'stream.publish',
message: "Posted using FB.ui and picture.",
display: 'iframe',
caption: "Caption",
name: "Name",
//ver 1 picture: 'http://www.somedomain.com/albums/s339/rockaja/fb-520.png',
//ver 2 picture: '#Url.Action("Action", "Controller", new { PageId = Model.PageTabId }, Request.Url.Scheme)',
picture: 'https://localhost/MyVirtualDirectory/Controller/Action/283659015078395',
link: "http://www.mydomain.com/", // Go here if user click the picture
description: "Description field",
actions: [{ name: 'action_links text!', link: 'http://www.mydomain.com' }]
}
FB.ui(data, onPostToWallCompleted);
}
As you can see the picture attribute uses a picture from localhost. If i paste this URL into the browsers's Address field, i get the picture as expected.
I also commented out other two versions:
version 1 is working properly as expected, but
version 2 is not working (this is an ASP.NET MVC call, but that fact does not affect the result).
May be it is due to the fact that i request a localhost-ed picture?!
I have never worked on FB API so take my suggestion with a pinch of salt.
Based on my understanding of how Facebook works, whatever pictures you share on user's wall go into FB's data store first and are always pulled from that store.
Here, The Facebook API may be downloading the picture from the URL you have provided and push it into it's own store before publishing it on user's walls. When you use a localhost url, then the call to download the picture would obviously fail.
There must be another version of the API where you should be able to send the picture content as byte array. If there is, then you can load the picture from disk yourself and send the byte array in the API