-
Notifications
You must be signed in to change notification settings - Fork 9
[EN] Callback Delegate
Gyeonghwan edited this page Aug 4, 2016
·
1 revision
You can handle events occurred in the NAVER Cafe SDK by adding callback delegates.
The callback delegate has been supported since 1.4.0 of the NAVER Cafe SDK.
Add a view controller handling the callback delegate to the NCSDKManager class.
@interface ViewController () <NCSDKManagerDelegate>
...
[[NCSDKManager getSharedInstance] setNcSDKDelegate:self];
...
The following code shows methods to be called through the callback delegate when an event occurs in the NAVER Cafe SDK.
#pragma mark – NCSDKManagerDelegate
// Start the NAVER Cafe SDK.
- (void)ncSDKViewDidLoad {
NSLog(@"Starting the NAVER Cafe SDK");
}
// Stop the NAVER Cafe SDK.
- (void)ncSDKViewDidUnLoad {
NSLog(@"Stopping the NAVER Cafe SDK");
}
// Join a Cafe community.
- (void)ncSDKJoinedCafeMember {
NSLog(@"Joining completed");
}
// Add a post.
- (void)ncSDKPostedArticleAtMenu:(NSInteger)menuId
attachImageCount:(NSInteger)imageCount
attachVideoCount:(NSInteger)videoCount {
NSLog(@"Posting completed, menu ID[%@]", @(menuId));
}
// Add a comment.
- (void)ncSDKPostedCommentAtArticle:(NSInteger)articleId {
NSLog(@"Commenting completed, post ID[%@]", @(articleId));
}
// Screenshot
- (void)ncSDKRequestScreenShot {
NSLog(@"Screenshot");
}
// Vote completed.
- (void)ncSDKDidVoteAtArticle:(NSInteger)articleId {
NSLog(@"Vote completed, post ID[%@]", @(articleId));
}
// Touch a screen capture button on the Cafe widget.
- (void)ncSDKWidgetPostArticleWithImage {
NSLog(@"Cafe widget screenshot");
}
// Recording completed.
- (void)ncSDKWidgetSuccessVideoRecord {
NSLog(@"Video recording completed of the Cafe widget");
}