1:Appdelegate,注册appkey
#import <NIMSDK/NIMSDK.h>
#define WANG_YI_YUN_APPKEY @“xxxxxxxxxxxxxx”
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions
:(NSDictionary *)launchOptions{
NSString *appKey = WANG_YI_YUN_APPKEY;
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
option.apnsCername = @"your APNs cer name";
option.pkCername = @"your pushkit cer name";
[[NIMSDK sharedSDK] registerWithOption:option];
}
2.封装登录模型 WangYiYunModel XMDataSavingTools是保存模型用的工具
#import <Foundation/Foundation.h>
#import "XMDataSavingTools.h"
@interface WangYiYunModel : NSObject
@property (nonatomic,strong) NSString *accid;
@property (nonatomic,strong) NSString *token;
+ (void) Save:(WangYiYunModel *