Skip to content

[EN] Initialization

Gyeonghwan edited this page Sep 30, 2016 · 2 revisions

Configure Initialization

In this page, we will describe settings for development environment and initialization, which is required to run the NAVER Cafe SDK.

1. Configure Project

The following steps show you how to set up your development environment in Xcode in order to use the NAVER Cafe SDK.

  1. Register a URL scheme as the first item that you entered when you registered your application to implement NAVER Login.
  2. Add the NAVER Login and AFNetworking libraries to your project.
  3. Go to Build Settings > Other Linker Flags and select the -ObjC option.
  4. Add the following libraries to Link Binary With Libraries under Build Phases. Specify Status of added libraries to Required.
    − MobileCoreServices.framework
    − SystemConfiguration.framework
    − MediaPlayer.framework
    − AVFoundation.framework
    − CoreMedia.framework
  5. Add the ReplayKit.framework library to Link Binary With Libraries under Build Phases. Specify Status to Optional.

2. Initialize the NAVER Cafe SDK

Initialize the NAVER Cafe SDK as described below. The values for client ID and client secret were obtained when you registered your application to implement NAVER Login.

- (void)viewDidLoad {
    [super viewDidLoad];
   /**
     * Initialize the NAVER Cafe SDK using information obtained when you registered your application in NAVER Login Developers.
     * You must perform the initialization before you call methods of the Glink class.
     * NAVER Login Developers: https://nid.naver.com/devcenter/main.nhn
     */
    [[NCSDKManager getSharedInstance] setNaverLoginClientId:@"197CymaStozo7X5r2qR5"
                                     naverLoginClientSecret:@"evCgKH1kJL"
                                                     cafeId:28290504];
...
}

Write code below to configure the app delegate so that the login information can be configured in the NAVER Cafe SDK when the NAVER Login process is completed.

//AppDelegate
#import <NaverCafeSDK/NCSDKLoginManager.h>
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { //Configure the login information in the NAVER Login object.
return [[NCSDKLoginManager getSharedInstance] finishNaverLoginWithURL:url];
}

Other NAVER CAFE SDK Documents.

Unity

Unreal

Cocos-2dx

Android

Clone this wiki locally