Facebook ShareDialog与Robovm绑定Robopods

时间:2015-07-10 12:05:54

标签: libgdx robovm

我有一个由RoboVM编译到iOS的libgGDX游戏,我想在Facebook上分享一个链接。

我使用新的Robovm绑定Robopods,请看这个链接:https://github.com/robovm/robovm-robopods

我试图打开Facebook分享对话框来分享链接,但它没有用。

我是这样开始的:

@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
    FBSDKApplicationDelegate.getSharedInstance().didFinishLaunching(application, launchOptions);
    return true;
}

@Override
public boolean openURL(UIApplication application, NSURL url, String sourceApplication, NSPropertyList annotation) {
    return FBSDKApplicationDelegate.getSharedInstance().openURL(application, url, sourceApplication, annotation);
}

@Override
public void didBecomeActive(UIApplication application) {
    FBSDKAppEvents.activateApp();
}

public static void main(String[] argv) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(argv, null, IOSLauncher.class);
pool.close();

}

我试图打开Share Dialog:

NSURL urlShare = new NSURL("http://web.page.com");
FBSDKShareLinkContent content = new FBSDKShareLinkContent();
content.setContentURL(urlShare);

dialog = new FBSDKShareDialog();
dialog.setFromViewController(getWindow().getRootViewController());
dialog.setShareContent(content);
dialog.show();

但它并不起作用,因为我认为我犯了错误。有人可以帮忙吗?

非常感谢!

(顺便感谢robopods作者的好工作)

0 个答案:

没有答案