NHN Cloud > SDK User Guide > Getting Started > iOS

Supported Environment

  • iOS 9.0 or higher
  • The latest version of XCode (version 13 or higher)

NHN Cloud SDK Components

  • NHN Cloud SDK for iOS consists of the following:

  • You can selectively apply the required feature among the services provided by NHN Cloud SDK.

Service Cocoapods Pod Name Carthage Framework Dependency Build Settings
All NHNCloudSDK binary "https://nh.nu/nhncloudsdk" NHNCloudCore.framework
NHNCloudCommon.framework
NHNCloudLogger.framework
NHNCloudIAP.framework
NHNCloudPush.framework
Mandatory NHNCloudCore
NHNCloudCommon
NHNCloudCore.framework
NHNCloudCommon.framework
OTHER_LDFLAGS = (
"-ObjC",
"-lc++"
);
Log & Crash NHNCloudLogger NHNCloudLogger.framework [External & Optional]
* CrashReporter.framework (NHNCloud)
IAP NHNCloudIAP NHNCloudIAP.framework * StoreKit.framework

[Optional]
* libsqlite3.tdb
Push NHNCloudPush NHNCloudPush.framework * UserNotifications.framework

[Optional]
* PushKit.framework

Apply NHN Cloud SDK to Xcode Projects

1. Apply NHN Cloud SDK with Cococapods

  • Create a Podfile and add a pod for NHN Cloud SDK.
platform :ios, '9.0'
use_frameworks!

target '{YOUR PROJECT TARGET NAME}' do
    pod 'NHNCloudSDK'
end

2. Apply NHN Cloud SDK with Carthage

  • Create a Cartfile and add NHN Cloud SDK.
# Full URL
binary "https://api-storage.cloud.toast.com/v1/AUTH_f9e3dc598ca142d3820e1c19343d5428/carthage/NHNCloudSDK.json"

# Short URL
binary "https://nh.nu/nhncloudsdk"
  • Add the frameworks in the created Carthage/Build folder to the Xcode project. carthage_import_framework

  • Check that the frameworks have been added to the project as shown below. import_carthage_frameworks_complete import_carthage_frameworks_complete

  • To use NHN Cloud SDK, you must perform Framework setting and Project setting.

To use desired features among the services selectively, you need to choose only the required frameworks per service and add them to the project. For details on required frameworks per service, see NHN Cloud SDK Components.

3. Apply NHN Cloud SDK by Downloading Binaries

Frameworks Setup

  • The entire iOS SDK can be downloaded from the Downloads page of NHN Cloud. import_frameworks

  • To use the Crash Report feature of Logger, CrashReporter.framework which is released along with the service, must be added to the project. import_external_framework

  • Check that the frameworks have been added to the project as shown below. import_frameworks_complete

  • To use the IAP feature, StoreKit.framework must be added. linked__storekit_frameworks

  • To use the Push feature, UserNotifications.framework must be added. linked__usernotifications_frameworks

xcframework
  • Using xcframework allows you to use NHN Cloud SDK even in arm simulator. xcframework01 xcframework01

Project Settings

  • Add -lc++ and -ObjC to Other Linker Flags under Build Settings.

    • Project Target > Build Settings > Linking > Other Linker Flags other_linker_flags
  • If you directly downloaded or built CrashReporter.framework, the Enable Bitcode under Build Settings must be changed to No.

    • Project Target > Build Settings > Build Options > Enable Bitcode enable_bitcode

      CrashReporter.framework downloaded from the Downloads page of NHN Cloud supports bitcode.

Import Framework

  • Import the frameworks to use.
#import <NHNCloudCore/NHNCloudCore.h>
#import <NHNCloudLogger/NHNCloudLogger.h>
#import <NHNCloudIAP/NHNCloudIAP.h>
#import <NHNCloudPush/NHNCloudPush.h>

Set User ID

  • User ID can be set for NHN Cloud SDK.
  • The configured User ID is commonly used in each module of NHN Cloud SDK.
  • Whenever Log Sending API of NHN Cloud Logger is called, the configured User ID is sent to a server along with logs.

Specification for User ID Setting API

+ (void)setUserID:(NSString *)userID;

Usage Example of User ID Setting

[NHNCloudSDK setUserID:@"NHNCLOUD-USER"];

Set Debug Mode

  • To check logs within NHN Cloud SDK, the debug mode can be set.
  • When you make an inquiry regarding NHN Cloud SDK, sending the logs with the debug mode enabled can be helpful for faster response.

Specification for Debug Mode API

+ (void)setDebugMode:(BOOL)debugMode;

Usage Example of Debug Mode Setting

[NHNCloudSDK setDebugMode:YES];    // or NO

[Caution] The debug mode must be disabled before releasing an app.

Use NHN Cloud Service

TOP