IOS huanxin 3.0 integration (I) SDK Integration

Source: Internet
Author: User
Tags email account

IOS huanxin 3.0 integration (I) SDK Integration
I. Preparations 1. register an email account

After registering an email account, we use the registered account to log in. Then, create an application and obtain a corresponding AppKey. This AppKey is required when you initialize the huanxin SDK.

Click to view the registration email account tutorial

2. Create a push Certificate

If you need the offline push function, you need to create a push certificate. Skip this step if you only need to implement Single chat and group chat functions. I personally suggest that developers who have just started to contact huanxin ignore this step.

Click to view the certificate creation tutorial

3. Download The huanxin SDK

Click to download the iOS SDK

2. Integrate huanxin SDK1 and add the huanxin SDK to the Project

Download a compressed package from the website of huanxin. decompress the package and drag the SDK we need, that is, the folder HyphenateSDK, into our project. For example:

 

There are two static libraries under the lib folder. You only need to use one library and select one library based on your needs.

 

LibHyphenateSDK. a does not contain real-time voice functions. libHyphenateFullSDK. a contains all functions.

2. Add the corresponding dependent Library

 

2.1. Add dependency Libraries to Build Phases → Link Binary With Libraries

 

The SDK dependency library has

  • CoreMedi. framework
  • AudioToolbox. framework
  • AVFoundation. framework
  • MobileCoreServices. framework
  • ImageIO. framework
  • SystemConfiguration. framework
  • Libc ++. dylib
  • Libresolv. dylib
  • Libz. dylib
  • Libstdc ++. 6.0.9.dylib
  • Libsqlite3.dylib

    (If xcode7 is used and the suffix is tbd)

    The SDK contains real-time voice dependent libraries.

    • CoreMedia. framework
    • AudioToolbox. framework
    • AVFoundation. framework
    • MobileCoreServices. framework
    • ImageIO. framework
    • SystemConfiguration. framework
    • Libc ++. dylib
    • Libresolv. dylib
    • Libz. dylib
    • Libstdc ++. 6.0.9.dylib
    • Libsqlite3.dylib
    • Libiconv. dylib


      Note: Do not add errors or add fewer items. After adding them, compile them first. If the compilation is successful, it means there is no problem. If the compilation reports an error, add it against the static library mentioned above carefully until the compilation is successful and then proceed to the next step.

      3. configuration project 3.1 does not contain the static voice Library

      (1) Delete libHyphenateFullSDK. a and retain libHyphenateSDK.;
      (2) Add the relative paths fore_load and libHyphenateSDK. a In Build Settings> Other Linker Flags.

      As shown in:

      3.2 how to configure static voice Libraries

      (1) Delete libHyphenateSDK. a and retain libHyphenateFullSDK.;
      (2) Add "-ObjC" in Build Settings> Other Linker Flags ".

      As shown in:

      4. Verify that the SDK is successfully added.

      In the AppDelegate. m file, add the method to initialize the ring mail SDK. Remember to add the header file "EaseMob. h ". The test AppKey is provided below. you can replace it with the AppKey you applied. If the compilation is successful, it means that you have correctly integrated the huanxin SDK.

      Possible causes of compilation problems:

      (1) The static library is not correctly added;
      (2) The static library is incorrectly configured;

      -(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions {

      // Override point for customization after application launch.

      EMOptions * options = [EMOptions optionsWithAppkey: @ "chongwu # chongwu"];

      // Options. apnsCertName = @"";

      [[EMClient sharedClient] initializesdkwitexceptions: options];

      EMError * error1 = [[EMClient sharedClient] registerWithUsername: @ "easeuidemo" password: @ "1"];

      If (error1 = nil ){

      NSLog (@ "registered successfully ");

      }

       

      EMError * error2 = [[EMClient sharedClient] loginWithUsername: @ "easeuidemo" password: @ "1"];

      If (! Error2 ){

      NSLog (@ "Login successful ");

      }


       

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.