-
Notifications
You must be signed in to change notification settings - Fork 9
[EN] 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.
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");
}
The Cafe widget offers a video record button so that users can record screens during gameplay.
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;
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");
}
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;
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];
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];