How to also include my app's name while sharing content? - c#

user can share a link from inside my app:
ShareLinkTask linkTask = new ShareLinkTask();
linkTask.Title = "I like it";
linkTask.Message = "I love this movie";
linkTask.LinkUri = new Uri(link, UriKind.Absolute);
linkTask.Show();
problem: I want to include my app's name too something like this sent by my awesome app!. If I append this to Message user can remove it. How can I add my app name without user be able to remove it? thanks.

This is not possible with the built in share tasks, probably to protect the user from an app posting text without permission. To get this functionality you will have to implement it by working directly with the Facebook, Twitter, etc. APIs.

Related

DSharpPlus send an embed to a specific channel?

I'm new to working with discord bots and I was wondering if anybody knew a way to send embedded messages to specific channels. The only way I've found so far to send one is to use RespondAsync which just directly replies to whoever issues the command in the same channel. The purpose of my bot is to create automated link directories in read only channels and the command will just refresh them. Having trouble finding much Dsharpplus c# examples, and I'm terrible at making sense of documentation. Any help would be appreciated.
await ctx.RespondAsync(embed);
this is what I've been using to send my embeds for testing purposes, but like I said I'd like to send it in a way that it posts to a specified channel
You just need to get the DiscordChannel object of the channel(s) you want to send the embed. You can get the ID of the channel via right-click in Discord and "Copy ID"
DiscordChannel channel = await _client.GetChannelAsync(ID_OF_CHANNEL);
DiscordEmbedBuilder embed = new DiscordEmbedBuilder
{
Color = DiscordColor.SpringGreen,
Description = "Good to see you!",
Title = "Hello World"
};
await channel.SendMessageAsync(embed: embed);
The DiscordGuild class also has GetChannelAsync you can use.

AWS Cognito - User pool xxxx does not exist

var client = new AmazonCognitoIdentityProviderClient("MYKEY", "MYSECRET", RegionEndpoint.USEast1);
var request = new AdminGetUserRequest();
request.Username = "USERNAME";
request.UserPoolId = "POOLID";
var user = client.AdminGetUserAsync(request).Result;
The key/secret are authenticating as a user with Administrator Access. For good measure, I've also given it the AmazonCognitoPowerUser policy.
The region endpoint is correct and the same as the one my user pool is in. The user pool Id is correct. The first part of the user pool ID matches the region.
I'm at a loss for where else this could possibly be going wrong. Any ideas?
Update 8/2/19
Manual CLI command:
PM> aws cognito-idp list-user-pools --region us-east-1 --max-results 10
{
"UserPools": []
}
The region is correct, so there must be some issue with permissions. Is there anything I could try tweaking on the pool, or other policies I may need to add to the user?
So, it looks like this is some sort of AWS glitch with the existing IAM user.
Having created a new user with exactly the same permissions, access works as intended both from CLI and the code in the original question.
Actually your configuration can be wrong , you downloaded awsconfiguration.json and it looks like same I know.. but this configuration can be wrong. When you examine the json you will see a field.. "CognitoUserPool": {PoolId, appclient id ..}
You need to open your user pool and create new client or control existing client information. Check your awsconfiguration.json again with this webpage's pool id, appclient id etc. Update your json... it will solve the problem.
I ran into this problem with the AWS CLI and it puzzled me too, but I learned that I needed to provide the profile name in the parameter list to get it to work. So it looked like this:
aws cognito-idp admin-get-user --profile dev-account ....
My profiles are stored on my Mac at cat ~/.aws/config| grep profile
The config file is created by an in-house custom script. This is the contents of what that file looks like.
[profile dev-account]
sso_start_url = https://yourcompanyname.awsapps.com/start#/
sso_region = us-east-1
sso_account_id = 1234567890
sso_role_name = PowerUserAccess
region = us-east-1
output = json
Also, in this folder is a "credentials" file that has some JSON for these variables: profile name, aws_access_key_id, aws_secret_access_key, aws_session_token, aws_expiration

post for specific group in Facebook for new changes?

it is been few days that I can not post a message from my app to specific groups of friends in Facebook, I am using asp.net MVC, before that I was using following code to post for only one list of friends " for example: close friend" but now it always post to all friends even when I specify target group.
FacebookClient fpost1 = new FacebookClient(context.AccessToken.ToString());
fpost1.Post("/me/feed", new { message = "test message", to = "xxxxxxxxxxxxxx" });
what should be changed to post for only specific list. consider xxxxxxxxxxxx as a close friend list id.
Assuming your app is a website, the easiest way to do this is to just use the share button and let the user pick the group he wants to post to.
https://developers.facebook.com/docs/plugins/share-button/
If your app is mobile, you can use the Share Dialog
https://developers.facebook.com/docs/ios/share
https://developers.facebook.com/docs/android/share

Redirect user to own Marketplace page

I'd like to let my users go straight to my own dev page on the WP7-Marketplace.
Is there a way to do so?
I assume you want to show all your apps rather than just one particular one. In that case, you could use MarketplaceSearchTask and use your publisher name as the search term. I haven't tested this code, but should work.
MarketplaceSearchTask mst = new MarketplaceSearchTask();
mst.ContentType = MarketplaceContentType.Applications;
mst.SearchTerms = "your publisher name"
mst.Show();

Is there anything out there that will make it easy for me to allow my users to share their Facebook photos (and videos) on my site?

I see a bunch of .NET open source projects out there that look to be able to get at the users information, but I just want a user to be able to "post" media that's already on Facebook on my site as well. Other websites seem to allow you to do embedding of their media (I'm really liking oEmbed) but FB seems a bit of a mystery to me. I have no experience using their API, but I'm guessing it has something to do with the "social graph" part. Anyone else done this before? Did you use something or is this easy enough to do without these OS projects? Any examples anywhere of how someone already did this? I wouldn't think that I'm the first person to want to do this but have searched Google and didn't come up with anything.
Have you tried FQL? Using this I was able to get users display pictures on any site I wanted by simply constructing a simple SQL like query.
The Facebook .NET SDK makes this very easy for you. You can download it here: http://facebooksdk.codeplex.com
Here is an example of how you would publish a photo using that SDK:
string photoPath = #"..\..\..\Facebook.Tests\bin\Release\monkey.jpg";
byte[] photo = File.ReadAllBytes(photoPath);
FacebookApp app = new FacebookApp();
dynamic parameters = new ExpandoObject();
parameters.message = "The message you want to go with the photo...";
var mediaObject = new FacebookMediaObject {
FileName = "monkey.jpg",
ContentType = "image/jpeg",
};
mediaObject.SetValue(photo);
parameters.source = mediaObject;
dynamic result = app.Api("/the_album_id/photos", parameters, HttpMethod.Post);
string photoId = result.id;

Categories