Skip to content

[EN] Callback Delegate

Gyeonghwan edited this page Aug 4, 2016 · 1 revision

Callback Delegate

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.

1. Add Callback Delegate

Add a view controller handling the callback delegate to the NCSDKManager class.

@interface ViewController () <NCSDKManagerDelegate>
...
[[NCSDKManager getSharedInstance] setNcSDKDelegate:self];
...

2. Implement Callback Delegate

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");
}

Other NAVER CAFE SDK Documents.

Unity

Unreal

Cocos-2dx

Android

Clone this wiki locally