최근 검색
최근 검색 없음

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
댓글