1

タイトルで十分だと思いますが、ストーリーは次のとおりです。

私はXMPPFrameworkiOS を初めて使用します。受信したサブスクリプション要求を自動的に受け入れるようにクライアントを設定したいと考えています。他のクライアントが要求したときに、このクライアントのプレゼンス ステータスを確認できるようにします。

開発者のコ​​メントによるとXMPPRoster.h、ファイルには、サブスクリプション要求が受信されたときに呼び出される次のメソッドがあります。

/**
 * Sent when a presence subscription request is received.
 * That is, another user has added you to their roster,
 * and is requesting permission to receive presence broadcasts that you send.
 * 
 * The entire presence packet is provided for proper extensibility.
 * You can use [presence from] to get the JID of the user who sent the request.
 * 
 * The methods acceptPresenceSubscriptionRequestFrom: and rejectPresenceSubscriptionRequestFrom: can
 * be used to respond to the request.
**/
- (void)xmppRoster:(XMPPRoster *)sender didReceivePresenceSubscriptionRequest:(XMPPPresence *)presence;

しかし、それは実装されていませんXMPPRoster.m。だから私は次のように実装しました:

- (void)xmppRoster:(XMPPRoster *)sender didReceivePresenceSubscriptionRequest:(XMPPPresence *)presence
{
    [self acceptPresenceSubscriptionRequestFrom:[presence from] andAddToRoster:YES];
}

私は XMPPFramework を初めて使用するので、何か間違ったことをしたかどうかはわかりませんが、他のクライアントでこのクライアントの存在を確認することはできません。

Accept buddy request in xmpp client iphoneXmpp Accepting buddy requestのような同様のトピックも見ましたが、解決策は関連していないようです!

どんな提案でも大歓迎です。ありがとう。

4

1 に答える 1