-
Notifications
You must be signed in to change notification settings - Fork 9
[EN] Initialization
Gyeonghwan edited this page Sep 30, 2016
·
2 revisions
In this page, we will describe settings for development environment and initialization, which is required to run the NAVER Cafe SDK.
The following steps show you how to set up your development environment in Xcode in order to use the NAVER Cafe SDK.
- Register a URL scheme as the first item that you entered when you registered your application to implement NAVER Login.
- Add the NAVER Login and AFNetworking libraries to your project.
- Go to Build Settings > Other Linker Flags and select the -ObjC option.
- 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 - Add the ReplayKit.framework library to Link Binary With Libraries under Build Phases. Specify Status to Optional.
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];
}