You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

287 lines
0 B

2 years ago
//
// JCClient.h
// JCSDK-OC
//
// Created by maikireton on 2017/8/10.
// Copyright © 2017年 juphoon. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JCClientCallback.h"
/**
* @defgroup
* @{
* sdk Juphoon Cloud
2 years ago
*/
/**
*
2 years ago
*/
@interface JCClientCreateParam : NSObject
2 years ago
/**
* sdk
*
* Documents/JuphoonCloud
*
* @note App
*/
@property (nonatomic, copy) NSString* __nonnull sdkInfoDir;
/**
* sdk
*
* @ref sdkInfoDir log
*
* @note App
*/
@property (nonatomic, copy) NSString* __nonnull sdkLogDir;
/**
* sdk @ref JCLogLevelInfo
*
* - @ref JCLogLevelDisable :
* - @ref JCLogLevelError : error
* - @ref JCLogLevelInfo : info error
* - @ref JCLogLevelDebug :
*/
@property (nonatomic) JCLogLevel sdkLogLevel;
@end
/**
*
*
* {@link JCClient#login:password:loginParam: login}
*/
@interface JCClientLoginParam : NSObject
/**
* id
*
* 使id都一样
*/
@property (nonatomic, copy) NSString* __nonnull deviceId;
/**
* https代理地址
*
* 192.168.1.100:3128
*/
@property (nonatomic, copy) NSString* __nullable httpsProxy;
/**
*
* - true:
* - false:
2 years ago
*/
@property (nonatomic) bool autoCreateAccount;
2 years ago
/**
*
*
*
* PC端同时能登录 mobilepc端设为 pc {@link login:password:loginParam: login} 线
*/
@property (nonatomic, strong) NSString* __nonnull terminalType;
/**
* callserver接入方式
* - true: arc形式
* - false: endpoint形式
*/
@property (nonatomic) bool directConnectEnable;
@end
/**
*
*
*
*/
@interface JCClient : NSObject
/**
*
*
* {@link login:password:loginParam: login} userId <br>
* nil
*/
@property (nonatomic, readonly, copy) NSString* __nullable userId;
/**
* /
*
*
*
* @note
* - {@link create:callback:createParam: create} SDK
* - IOT
*/
@property (nonatomic, copy) NSString* __nullable displayName;
/**
*
*
* - @ref JCClientStateNotInit :
* - @ref JCClientStateIdle :
* - @ref JCClientStateLogining :
* - @ref JCClientStateLogined :
* - @ref JCClientStateLogouting :
2 years ago
*/
@property (nonatomic, readonly) JCClientState state;
/**
*
*
* {@link create:callback:createParam: create} createParam <br>
* {@link create:callback:createParam: create} createParam nil JCClientCreateParam
2 years ago
*/
@property (nonatomic, readonly) JCClientCreateParam* __nullable createParam;
2 years ago
/**
*
2 years ago
*
* {@link login:password:loginParam: login} loginParam <br>
* {@link login:password:loginParam: login} loginParam nil JCClientLoginParam <br>
* nil
2 years ago
*/
@property (nonatomic, readonly) JCClientLoginParam* __nullable loginParam;
2 years ago
/**
* appkey
*
* appkey是由 {@link create:callback:createParam: create}
2 years ago
*/
@property (nonatomic, readonly) NSString* __nonnull appkey;
2 years ago
/// @cond Doxygen_All
2 years ago
/**
* uid
2 years ago
*/
@property (nonatomic, readonly) NSString* __nonnull serverUid;
/// @endcond
2 years ago
/**
* /
*
* http:<span><span/>cn.router.justalkcloud.com:8080 http:<span><span/>intl.router.justalkcloud.com:8080<br>
* {@link login:password:loginParam: login}
*/
@property (nonatomic, copy) NSString * __nonnull serverAddress;
/**
* , 60
2 years ago
*/
@property (nonatomic, assign) int timeout;
2 years ago
/**
* arcChannel开关
2 years ago
*/
@property (nonatomic, assign) bool arcChannel;
/**
* JCClient
*
* JCClient 线
*
* @note
* - API JCClient
* - JCClient {@link destroy} JCClient
*
* @param appKey Juphoon Cloud AppKey [ appKey](https://developer.juphoon.com/cn/document/V2.1/create-application.php)
* @param callback JCClientCallback
* @param createParam nil JCClientCreateParam
* @return JCClient
* @exception "appKey、JCClientCallback 任意一个参数传空就会返回 nil"
*/
+(JCClient* __nullable)create:(NSString* __nonnull)appKey callback:(id<JCClientCallback> __nonnull)callback createParam:(JCClientCreateParam* __nullable)createParam;
/**
* JCClient
*
* JCClient 使 SDK <br>
* JCClient **** JCSDK JCClient <br>
* JCClient @ref destroy
*/
+(void)destroy;
/**
* Juphoon Cloud
*
*
*
* @param userId 64 66
* - 26 a-z
* - 26 A-Z
* - 10 0-9
* - '+''-''_''.' '-''_''.'
* @param password nil "" 128 Token Token
* @param loginParam nil JCClientLoginParam
* @return
* - true {@link JCClientCallback#onLogin:reason: onLogin}
* - false {@link JCClientCallback#onLogin:reason: onLogin}
*/
-(bool)login:(NSString* __nonnull)userId password:(NSString* __nonnull)password loginParam:(JCClientLoginParam* __nullable)loginParam;
/// @cond Doxygen_All
/**
*
*
* {@link JCClientCallback#onLogin:reason: onLogin}
*
* @note @ref login
* - 使线
* - 使
* - 使
*
* @param userId
* @param password
* @param loginParam nil JCClientLoginParam
* @return
* - true {@link JCClientCallback#onLogin:reason: onLogin}
* - false {@link JCClientCallback#onLogin:reason: onLogin}
*/
-(bool)relogin:(NSString* __nonnull)userId password:(NSString* __nonnull)password loginParam:(JCClientLoginParam* __nullable)loginParam;
/// @endcond
/**
* Juphoon Cloud
*
*
*
* @return
* - true {@link JCClientCallback#onLogout: onLogout}
* - false {@link JCClientCallback#onLogout: onLogout}
*/
-(bool)logout;
/**
* 线
*
* @ref JCClientCallback#onOnlineMessageSendResult "onOnlineMessageSendResult"
*
* @note
* - 线
* - 100/
*
* @param userId userId
* @param content
* @return
* - &gt;0id operationId
* - -1
*/
-(int)sendOnlineMessage:(NSString* __nonnull)userId content:(NSString* __nonnull)content;
2 years ago
@end
/**
* @}
*/