gpt4 book ai didi

javascript - 如何使用 Cordova 在 iOS 上向 Facebook 好友发送邀请?

转载 作者:行者123 更新时间:2023-11-29 05:32:57 25 4
gpt4 key购买 nike

使用完全相同的代码库,我可以在 Android 上完美运行 Facebook 事件。然而,在 iOS 上它不起作用。我正在使用https://github.com/jeduan/cordova-plugin-facebook4为此,并尝试设置一些警报以查看错误代码或其他内容(请注意代码中的 alert ,用于调试目的),但没有任何操作。本质上,我看不到任何错误,它只是不起作用。代码如下:

this.options = {
method: 'apprequests',
message: 'Play YellowSidd with me!'
};
this.onSuccess = function(result) {
alert("Success with invite, result: " + result);
};
this.onError = function(msg) {
alert("Failed with invite, msg: " + msg);
};

facebookConnectPlugin.showDialog(this.options, this.onSuccess, this.onError);

在 Xcode 的“构建阶段”->“编译源”中,我确实有 FacebookConnectPlugin.m。在“构建阶段”->“将二进制文件与库链接”中,我还具有以下内容:libsqlite3.dylib(由我添加)、Security.framework(由我添加)、Accounts.framework(由我添加),Social.framework(由我添加)。此外,还有 FBSDKCoreKit.frameworkFBSDKLoginKit.frameworkFBSDKShareKit.framework。最后 3 个已经在该项目中了。

最佳答案

显然,在 iOS 平台上使用此插件时需要 actionType,即使在 Android 上没有它一切都可以正常工作。最终得到以下在 iOS 上运行良好的代码:

this.options = {
actionType: '',
method: 'apprequests',
message: 'Play YellowSidd with me!'
};

关于javascript - 如何使用 Cordova 在 iOS 上向 Facebook 好友发送邀请?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57352541/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com