Skip to content
Gyeonghwan edited this page Aug 4, 2016 · 1 revision

Cafe Widget

The Cafe widget appears when the NAVER Cafe SDK is closed. With this, users can use the NAVER Cafe features anywhere within the game.

The Cafe widget has been supported since 1.6.0 of the NAVER Cafe SDK.

Cafe Widget

Screen Capture Button

The Cafe widget offers a screen capture button so that users can capture game screens.

Use the ncSDKWidgetPostArticleWithImage method to implement this functionality.

(void)ncSDKWidgetPostArticleWithImage;

The following code shows an example of how to add a delegate so that the ncSDKWidgetPostArticleWithImage method is called when a user taps the screen capture button offered by the Cafe widget.

...
[[NCSDKManager getSharedInstance] setNcSDKDelegate:self];
...
- (void)ncSDKWidgetPostArticleWithImage {
    NSLog(@"Requesting a screenshot");
}

Video Record Button

The Cafe widget offers a video record button so that users can record screens during gameplay.

Display the Video Record Button

Use the useWidgetVideoRecord property to specify whether this functionality is enabled.

@property (nonatomic, assign) BOOL useWidgetVideoRecord;

If the useWidgetVideoRecord property is set to YES, the video record button will appear on the Cafe widget (default: NO).

  /**
   * Determine whether video recording is enabled.
   */
[NCSDKManager getSharedInstance].useWidgetVideoRecord = YES;

Recording Completed

Use the ncSDKWidgetSuccessVideoRecord method to implement tasks to be handled when the video recording is completed.

The ncSDKWidgetSuccessVideoRecord method has been supported since 1.7.0 of the NAVER Cafe SDK.

(void)ncSDKWidgetSuccessVideoRecord;

The following code shows an example of how to add a delegate so that the ncSDKWidgetSuccessVideoRecord method is called when the video recording is completed.

...
[[NCSDKManager getSharedInstance] setNcSDKDelegate:self];
...
- (void)ncSDKWidgetSuccessVideoRecord {
    NSLog(@"Video recording completed");
}

Display Cafe Widget

Use the showWidgetWhenUnloadSDK property to specify whether the Cafe widget appears when the NAVER Cafe SDK is closed.

@property (nonatomic, assign) BOOL showWidgetWhenUnloadSDK;

If the showWidgetWhenUnloadSDK property is set to YES, the Cafe widget will appear when the NAVER Cafe SDK is closed (default: YES).

The following code shows an example of how to make the Cafe widget appear.

  /**
   * Determine whether the Cafe widget appears when the NAVER Cafe SDK is closed.
   */
[NCSDKManager getSharedInstance].showWidgetWhenUnloadSDK = YES;

Start Cafe Widget

Use the startWidget method to start the Cafe widget.

The startWidget method has been supported since 1.7.0 of the NAVER Cafe SDK.

(void)startWidget;

The following code shows an example of how to start the Cafe widget.

  /**
   * Start the Cafe widget.
   */
[[NCSDKManager getSharedInstance] startWidget];

Stop Cafe Widget

Use the stopWidget method to stop the Cafe widget.

The stopWidget method has been supported since 1.7.0 of the NAVER Cafe SDK.

(void)stopWidget;

The following code shows an example of how to force stop the Cafe widget.

  /**
   * Stop the Cafe widget.
   */
[[NCSDKManager getSharedInstance] stopWidget];

Other NAVER CAFE SDK Documents.

Unity

Unreal

Cocos-2dx

Android

Clone this wiki locally