我正在写一款iPhone游戏,并希望将用户的分数发布到他们的Facebook Feed中.
我已经成功地将用户同意授权的示例拼凑在一起,然后出现一个对话框,他们可以确认在他们的墙上发布,或者不发布.这几乎是理想的,除了文本是可编辑的字段 - 因此用户可以修改他们的分数然后发布.理想情况下,我想要完全相同的机制,但没有能力修改消息.
我假设这样做,我需要询问publish_stream权限,然后使用Graph api调用来发布消息.我采购了这个,但收到错误'必须使用活动访问令牌来查询有关当前用户的信息.'.
我很乐意在实际的代码更改中指出正确的方向 - 任何帮助都非常感激.
这是我的第一篇stackOverflow帖子,请温柔.
多谢你们.
-Duncan
原始代码(发布到墙上但带有可修改的文本框)
//offer to facebook connect your score
facebook = [[Facebook alloc] initWithAppId:@"210645928948875"];
[facebook authorize:nil delegate:self];
NSMutableString *facebookMessage = [NSMutableString stringWithString:@"I scored a whopping "];
[facebookMessage appendString: [NSMutableString stringWithFormat:@"%d", currentScore]];
[facebookMessage appendString: [NSMutableString stringWithString:@". Can you beat me?"]];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"210645928948875", @"app_id",
@"http://duncan.co.uk/", @"link",
@"http://d.yimg.com/gg/goran_anicic/dunc.jpeg", @"picture",
@"dunc", @"name",
//@"Reference Documentation", @"caption",
@"Download the app NOW from the App Store", @"description",
facebookMessage, @"message",
nil]; …
Run Code Online (Sandbox Code Playgroud) 我的代码适用于Chrome和Firefox,但不适用于IE8.
<a href="javascript:void();" class="shareActionLink" id="comment">
<img src="comment.gif" class="shareActionImage" />Comment
</a>
Run Code Online (Sandbox Code Playgroud)
这个CSS是:
.shareActionLink:link, .shareActionLink:visited
{
margin-right:8px;
color:#999;
opacity:0.6;
filter: alpha(opacity=60); /* internet explorer */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=60)"; /*IE8*/
background-color: #fff;
}
#shareActionsBox .shareActionLink:hover
{
color:#333;
text-decoration:none;
opacity:1.0;
filter: alpha(opacity=100); /* internet explorer */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=100)"; /*IE8*/
}
Run Code Online (Sandbox Code Playgroud)
基于其他StackOverflow帖子,我添加了IE过滤器,这有助于调整文本不透明度,但是,IE中的图像不透明度仍然没有变化.它在其他浏览器中工作正常.
我怀疑这种情况正在发生,因为img嵌套在链接中.如何让图像在IE中改变不透明度?
谢谢
我单位测试我的家庭控制器.此测试工作正常,直到我添加了一个保存图像的新功能.
导致问题的方法如下.
public static void SaveStarCarCAPImage(int capID)
{
byte[] capBinary = Motorpoint2011Data.RetrieveCapImageData(capID);
if (capBinary != null)
{
MemoryStream ioStream = new MemoryStream();
ioStream = new MemoryStream(capBinary);
// save the memory stream as an image
// Read in the data but do not close, before using the stream.
using (Stream originalBinaryDataStream = ioStream)
{
var path = HttpContext.Current.Server.MapPath("/StarVehiclesImages");
path = System.IO.Path.Combine(path, capID + ".jpg");
Image image = Image.FromStream(originalBinaryDataStream);
Image resize = image.GetThumbnailImage(500, 375, null, new IntPtr());
resize.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
} …
Run Code Online (Sandbox Code Playgroud) 使用C++,我需要检测给定的路径(文件名)是绝对的还是相对的.我可以使用Windows API,但不想使用像Boost这样的第三方库,因为我需要在没有经验依赖性的小型Windows应用程序中使用此解决方案.
当用户未启用JavaScript时,最好的做法是什么?向这类用户提供内容的最佳方式是什么?保持网站可供搜索引擎阅读的最佳方法是什么?
我可以想到两种方法来实现这一点,但不知道什么是更好的(或者如果第三种选择更好):
我也很欣赏高调的例子,说明正确或错误的方法.
---------问题的补充-----------
以下是我过去为解决这个问题所做的一个例子:http: //photocontest.highpoint.edu/
我想确保没有更好的方法来做到这一点.
嗨,我很好奇是否有人知道spin/swirl
在第一次运行应用程序时制作启动画面的方法。我想要旋转/漩涡的图像是一个 png。
也许这是一个愚蠢的问题,但我找不到答案:在下面的xaml中CommandParameter
绑定到什么?或者一般来说,"{Binding}"
意味着什么?
<Button Command="{Binding DataContext.DeleteCommand, ElementName=List}"
CommandParameter="{Binding}"/>
Run Code Online (Sandbox Code Playgroud) 我想在Swing中创建自己的外观和感觉.任何人都可以给我简明扼要的知识吗?
当我与同事谈论Git时,我告诉他们,一旦本地repo初始化(假设origin
本地机器不在本地机器上),只有三个Git命令无法在没有远程存储库的情况下执行:
只是为了确保我没有错过任何东西:是否有任何其他命令需要连接到远程存储库?
android ×2
binding ×1
c# ×1
c++ ×1
css ×1
facebook ×1
git ×1
ios ×1
iphone ×1
javascript ×1
moq ×1
noscript ×1
objective-c ×1
path ×1
seo ×1
swing ×1
unit-testing ×1
visual-c++ ×1
windows ×1
wpf ×1