私は、MessageDialog APIを介してFacebookのメッセンジャーにリンク+コンテンツを送るルーチンを実装しました。私はメッセージのダイアログにリンクコンテンツを表示させることができましたが、送信ボタンは無効になっています。私はこれが何よりも構成上の問題だと思う。Facebook iOSメッセージダイアログ送信ボタンが無効
xamarinのネイティブiosで最新のxamarin facebook sdk(v 4.15.1)を使用してこれを実装しました。私はsdk 10.0でコンパイルしています。ここ
は、非常に基本的な実装である:ここ
public bool SendMessageViaMessenger(string Text, string Link) {
var content = new ShareLinkContent();
content.SetContentUrl(new NSUrl(Link));
content.ContentTitle = "Here is an invite";
content.ContentDescription = "Test description";
MessageDialog.Show(content, null);
return true;
}
は私のInfo.plistのFacebookの設定部である:
{MY-FB-APP-ID}は私のFacebookに置き換えた<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{my-fb-app-id}</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>{my-fb-app-id}</string>
<key>FacebookDisplayName</key>
<string>{my-fb-app-name}</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
app id、{my-fb-app-name}にアプリ名を入力します。
私も持っている:
は私のバンドル識別子は、私がFacebookアプリの設定に入れているものとまったく同じ文字列であることを確認。
私はFacebookのアプリの設定でアプリドメインとして送信しているリンクのドメインを追加しました。
私はウェブサイトプラットフォームとして送信しているリンクのドメインを追加しました。
は、次のコードを経て、Facebookのからの1で私のアプリのアプリデリゲートを統合:
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); Facebook.CoreKit.ApplicationDelegate.SharedInstance.FinishedLaunching(app, options); return base.FinishedLaunching(app, options); }
を任意の助けをいただければ幸いです。 ありがとう!
iOSでURLなしのメッセージ(テキストメッセージ)を送信する方法はありますか? – Rakii
@Rakii、Message Dialog APIでは恐れることはありません。これを行うにはSend APIを使用する必要があります(https://developers.facebook.com/docs/messenger-platform/send-api-reference#request;) –