最近の検索
最近の検索はありません

Shenxin Xu
参加日2023年11月28日
·
前回のアクティビティ2023年11月28日
フォロー中
0
フォロワー
0
合計アクティビティ
2
投票
0
サブスクリプション
1
アクティビティの概要
バッジ
記事
投稿
コミュニティへのコメント
記事へのコメント
アクティビティの概要
さんの最近のアクティビティ Shenxin Xu
Shenxin Xuさんが投稿を作成しました:
#ifndef AuthDelegate_h
#define AuthDelegate_h
#import
#import
@interface MyAuthDelegate : NSObject <SKTAuthenticationDelegate>
- (void)onInvalidToken:(NSError *)error handler:(SKTAuthenticationCompletionBlock)completionHandler;
@end
#endif /* AuthDelegate_h */
//////////////////////////////////////////////
///// below is AuthDelegate.m ///
#import
#import "AuthDelegate.h"
@implementation MyAuthDelegate
/**
* Notifies the delegate of a failed request due to invalid credentials
* @param completionHandler callback to invoke with a new token
*/
- (void)onInvalidToken:(NSError *)error handler:(SKTAuthenticationCompletionBlock)completionHandler
{
// retrieve new token
NSLog(@"Smooch onInvalidToken triggered nick:");
completionHandler(@"fake token");
}
@end
///////////// below is how I attach the delegate to Smooch ////
SKTSettings *customSettings = [[SKTSettings alloc] init];
customSettings.integrationId =integrationId;
MyAuthDelegate *tempDelegate = [MyAuthDelegate new]; // [[MyAuthDelegate alloc] init];
customSettings.authenticationDelegate = tempDelegate;
ConversationDelegate *conversationDelegate = [ConversationDelegate new];
[Smooch setConversationDelegate:conversationDelegate];
[Smooch initWithSettings:customSettings completionHandler:^(NSError * _Nullable error, NSDictionary * _Nullable userInfo) {
if (error == nil) {
.......
......
The delegate function is not firing. I also tried the didDismissViewController on `SKTConversationDelegate`, it is also not firing. I think something serious is wrong with my understanding. I probably miss some fundermental concept. Thanks!
投稿日時:2023年11月28日 · Shenxin Xu
0
フォロワー
3
投票
1
コメント