cdts/xdts-ios 3/Pods/GTSDK/GTSDK.framework/Headers/GeTuiSdk.h

494 lines
16 KiB
C
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
//
// GeTuiSdk.h
// GeTuiSdk
//
// Created by gexin on 15-5-5.
// Copyright (c) 2015年 Gexin Interactive (Beijing) Network Technology Co.,LTD. All rights reserved.
//
// GTSDK-Version: 2.6.7.0
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UserNotifications/UserNotifications.h>
typedef NS_ENUM(NSUInteger, SdkStatus) {
SdkStatusStarting, // 正在启动
SdkStatusStarted, // 启动、在线
SdkStatusStoped, // 停止
SdkStatusOffline, // 离线
};
#define kGtResponseBindType @"bindAlias"
#define kGtResponseUnBindType @"unbindAlias"
//SDK Delegate 回调接口
@protocol GeTuiSdkDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface GeTuiSdk : NSObject
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 80000
#error "GeTuiSDK is requested iOS8 or iOS8 above version"
#endif
//MARK: -
/**
* SDK
*
* @param appid app的个推appIdappId从个推网站获取
* @param appKey app的个推appKeyappKey从个推网站获取
* @param appSecret app的个推appSecretappSecret从个推网站获取
* @param delegate delegate
* @param launchOptions didFinishLaunchingWithOptions中的launchOptions参数
*/
+ (void)startSdkWithAppId:(NSString *)appid appKey:(NSString *)appKey appSecret:(NSString *)appSecret delegate:(id<GeTuiSdkDelegate>)delegate launchingOptions:(NSDictionary * __nullable)launchOptions;
/**
* App Groups Id (使 iOS Extension SDK)
*/
+ (void)setApplicationGroupIdentifier:(NSString*)identifier;
/// 注册远程通知
/// 必须使用个推注册通知否则可能无法获取APNs回调
/// 注意!!!使用个推注册通知, 开发者无需关注DeviceToken相关逻辑且仅需要关注个推APNs消息通知回调
/// 若不使用此方法开发者需要自行处理DeviceToken相关逻辑 和 重写系统APNs回调, 可参考Demo版本2.4.6.0 [https://www.getui.com/download/docs/getui/iOS/GETUI_IOS_SDK_2.4.6.0.zip]
/// @param types UNAuthorizationOptions类型的通知选项
+ (void)registerRemoteNotification:(UNAuthorizationOptions)types;
/**
* SDK版本号
*
* GeTuiSdk版本, ()
* @return
*/
+ (NSString *)version;
/**
* SDK的Cid
*
* @return Cid值
*/
+ (NSString *)clientId;
/**
* SDK运行状态
*
* @return
*/
+ (SdkStatus)status;
/**
*
* SDK可以未启动就调用该方法
*
* SDK-1.5.0+
*
* @param aChannelId
*/
+ (void)setChannelId:(NSString *)aChannelId;
/**
* IDFA
*
* SDK-2.5.6.0+
*
* @param idfa idfa
*/
+ (void)setIDFA:(NSString *)idfa;
/**
* NO
* SDK在线才能调用
*
* @param isValue YES. NO.
*
* SDK-1.2.1+
*
*/
+ (void)setPushModeForOff:(BOOL)isValue;
/**
* SDK NO
* SDK就调用该方法
* @param isEnable APP进入后台后,YES.
*
* Signing & Capabilities > Background Modes > Auido, Airplay and Picture in Picture 线使
* [GeTuiSdk runBackgroundEnable:NO]
*/
+ (void)runBackgroundEnable:(BOOL)isEnable;
/**
*
* SDK可以未启动就调用该方法
*
* @param isEnable NO
* @param isVerify SDK主动弹出用户定位请求NO
*/
+ (void)lbsLocationEnable:(BOOL)isEnable andUserVerify:(BOOL)isVerify;
/**
* ,0
*/
+ (void)clearAllNotificationForNotificationBar;
/**
* SDK
*/
+ (void)destroy;
//MARK: - 注册Token
/**
* VoipToken
* SDK就调用该方法
*
* @param voipToken 使voipToken NSString
* @return voipToken有效判断YES. NO.
*
*/
+ (BOOL)registerVoipToken:(NSString *)voipToken;
/**
* VoipToken
* SDK就调用该方法
* Xcode11iOS13 DeviceToken适配使SDK-2.4.1.0
*
* @param voipToken 使voipToken NSData
* @return voipToken有效判断YES. NO.
*
*/
+ (BOOL)registerVoipTokenCredentials:(NSData *)voipToken;
//MARK: - 设置标签
/**
* ,
*
* @param tags
* tag: 0-9+-*_.
*
* @return YES表示尝试提交成功NO表示尝试提交失败
*/
+ (BOOL)setTags:(NSArray *)tags;
/**
* ,
*
* @param tags
* tag: 0-9+-*_.
* @param aSn , nil
* @return YES表示尝试提交成功NO表示尝试提交失败
*/
+ (BOOL)setTags:(NSArray *)tags andSequenceNum:(NSString *)aSn;
//MARK: - 设置角标
/**
*
* setApplicationIconBadgeNumber函数
*
* SDK-1.4.0+
*
* @param badge
*/
+ (void)setBadge:(NSUInteger)badge;
/**
* "setBadge:0"
*
* SDK-1.4.0+
*
*/
+ (void)resetBadge;
//MARK: - 设置别名
/**
* :
* SDK在线才能调用
*
* @param alias
* @param aSn , nil
*/
+ (void)bindAlias:(NSString *)alias andSequenceNum:(NSString *)aSn;
/**
*
* SDK在线才能调用
*
* @param alias
* @param aSn , nil
* @param isSelf cid有效truecid做解绑falsecid列表做解绑
*/
+ (void)unbindAlias:(NSString *)alias andSequenceNum:(NSString *)aSn andIsSelf:(BOOL)isSelf;
//MARK: - 处理回执
/**
*
*
* @param userInfo
*
* - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
*
*/
+ (void)handleRemoteNotification:(NSDictionary *)userInfo;
/**
* VOIP消息回执
*
* @param payload VOIP
*/
+ (void)handleVoipNotification:(NSDictionary *)payload;
/**
* APPLink
* @param webUrl applink Url
* @return applink payload
*/
+ (NSString *)handleApplinkFeedback:(NSURL *)webUrl;
/**
* SDK发送上行消息结果
*
* @param body
*
* @return msgId
*/
+ (NSString *)sendMessage:(NSData *)body;
/**
* SDK发送上行消息结果
*
* @param body
* @param taskId ID, UUID String
* @param error
*
* @return messageidnil
*/
+ (NSString *)sendMessage:(NSData *)body taskId:(NSString *)taskId error:(NSError **)error;
/**
* actionid
*
* @param actionId actionidint类型90001-90999
* @param taskId ID
* @param msgId ID
*
* @return BOOLYES表示尝试提交成功NO表示尝试提交失败
* GeTuiSdkDidReceivePayload:andTaskId:andMessageId:andOffLine:fromApplication:使
*/
+ (BOOL)sendFeedbackMessage:(NSInteger)actionId andTaskId:(NSString *)taskId andMsgId:(NSString *)msgId;
//MARK: - 已废弃
/**
* SDK运行,IOS7 Background Fetch方式,Fetch起来后被调用SDK
*/
+ (void)resume DEPRECATED_MSG_ATTRIBUTE("已废弃");
/**
* DeviceToken
* SDK就调用该方法
*
* @param deviceToken 使deviceToken NSString
* @return deviceToken有效判断YES. NO.
*
*/
+ (BOOL)registerDeviceToken:(NSString *)deviceToken DEPRECATED_MSG_ATTRIBUTE("已废弃");
/**
* DeviceToken
* SDK就调用该方法
* Xcode11iOS13 DeviceToken适配使SDK-2.4.1.0
*
* @param deviceToken 使deviceToken NSData
* @return deviceToken有效判断YES. NO.
*
*/
+ (BOOL)registerDeviceTokenData:(NSData *)deviceToken DEPRECATED_MSG_ATTRIBUTE("已废弃");
//MARK: - 已废弃
/**
* SDK发送上行消息结果
*
* @param body
* @param error messageidnil
*
* @return msgId
*/
+ (NSString *)sendMessage:(NSData *)body error:(NSError **)error DEPRECATED_MSG_ATTRIBUTE("Please use -[GeTuiSdk sendMessage:taskId:error:]");
@end
//MARK: - SDK Delegate
@protocol GeTuiSdkDelegate <NSObject>
@optional
/**
* SDK登入成功返回clientId
*
* @param clientId clientId
* :GeTuiSdk后SDK会自动向个推服务器注册SDKSDK通知应用注册成功
* : appid/appkey/appSecret等验证不通过
*/
- (void)GeTuiSdkDidRegisterClient:(NSString *)clientId;
/**
* SDK运行状态通知
*
* @param status SDK运行状态
*/
- (void)GeTuiSDkDidNotifySdkState:(SdkStatus)status;
/**
* SDK遇到错误消息返回error
*
* @param error SDK内部发生错误
*/
- (void)GeTuiSdkDidOccurError:(NSError *)error;
//MARK: - 通知回调
/// 通知展示iOS10及以上版本
/// @param center center
/// @param notification notification
/// @param completionHandler completionHandler
- (void)GeTuiSdkNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification * )notification
completionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
__API_AVAILABLE(macos(10.14), ios(10.0), watchos(3.0), tvos(10.0));
/// 收到通知信息
/// @param userInfo apns通知内容
/// @param center UNUserNotificationCenteriOS10及以上版本
/// @param response UNNotificationResponseiOS10及以上版本
/// @param completionHandler 用来在后台状态下进行操作iOS10以下版本
- (void)GeTuiSdkDidReceiveNotification:(NSDictionary *)userInfo
notificationCenter:(nullable UNUserNotificationCenter *)center
response:(nullable UNNotificationResponse *)response
fetchCompletionHandler:(nullable void (^)(UIBackgroundFetchResult))completionHandler;
/// 收到透传消息
/// @param userInfo 推送消息内容, {"payload": 消息内容}
/// @param fromGetui YES: 个推通道 NO苹果apns通道
/// @param offLine 是否是离线消息YES.是离线消息
/// @param appId 应用的appId
/// @param taskId 推送消息的任务id
/// @param msgId 推送消息的messageid
/// @param completionHandler 用来在后台状态下进行操作通过苹果apns通道的消息 才有此参数值)
- (void)GeTuiSdkDidReceiveSlience:(NSDictionary *)userInfo
fromGetui:(BOOL)fromGetui
offLine:(BOOL)offLine
appId:(nullable NSString *)appId
taskId:(nullable NSString *)taskId
msgId:(nullable NSString *)msgId
fetchCompletionHandler:(nullable void (^)(UIBackgroundFetchResult))completionHandler;
- (void)GeTuiSdkNotificationCenter:(UNUserNotificationCenter *)center
openSettingsForNotification:(nullable UNNotification *)notification
__API_AVAILABLE(macos(10.14), ios(12.0)) __API_UNAVAILABLE(watchos, tvos);
//MARK: - 发送上行消息
/**
* SDK通知发送上行消息结果sendMessage消息回调
*
* @param messageId sendMessage:error:id
* @param isSuccess YES, NO
* @param aError nil, error信息
* : sendMessage:error:sdk到达结果isSuccess为 YES
* : ,SendMessage 1
*/
- (void)GeTuiSdkDidSendMessage:(NSString *)messageId result:(BOOL)isSuccess error:(nullable NSError *)aError;
//MARK: - 开关设置
/**
* SDK设置关闭推送模式回调
*
* @param isModeOff YES. NO.
* @param error
*/
- (void)GeTuiSdkDidSetPushMode:(BOOL)isModeOff error:(nullable NSError *)error;
//MARK: - 别名设置
/**
* SDK绑定
*
* @param action kGtResponseBindType kGtResponseUnBindType
* @param isSuccess YES, NO
* @param aSn
* @param aError nil, error信息
*/
- (void)GeTuiSdkDidAliasAction:(NSString *)action result:(BOOL)isSuccess sequenceNum:(NSString *)aSn error:(nullable NSError *)aError;
//MARK: - 标签设置
/**
*
*
* @param sequenceNum
* @param isSuccess YES, NO
* @param aError nil, error信息
*/
- (void)GeTuiSdkDidSetTagsAction:(NSString *)sequenceNum result:(BOOL)isSuccess error:(nullable NSError *)aError;
/**
* tag结果返回
* @param aTags tag
* @param aSn queryTag
* @param aError nil,error信息
*/
- (void)GetuiSdkDidQueryTag:(NSArray *)aTags sequenceNum:(NSString *)aSn error:(nullable NSError *)aError;
//MARK: - 已废弃
/**
* SDK通知收到个推推送的透传消息
*
* @param payloadData
* @param taskId id
* @param msgId messageid
* @param offLine 线YES.线
* @param appId appId
*/
- (void)GeTuiSdkDidReceivePayloadData:(NSData *)payloadData
andTaskId:(NSString *)taskId
andMsgId:(NSString *)msgId
andOffLine:(BOOL)offLine
fromGtAppId:(NSString *)appId DEPRECATED_MSG_ATTRIBUTE("使用GeTuiSdkDidReceiveSlience:fromGetui:offLine:appId:taskId:msgId:fetchCompletionHandler:");
/**
* SDK通知发送上行消息结果sendMessage消息回调 ()
*
* @param messageId sendMessage:error:id
* @param result 1, 0
* : sendMessage:error:sdk到达结果result为 1
* : ,SendMessage 1
*/;
- (void)GeTuiSdkDidSendMessage:(NSString *)messageId result:(int)result DEPRECATED_MSG_ATTRIBUTE("Please use -[delegate GeTuiSdkDidSendMessage:msg result: error:]");
@end
NS_ASSUME_NONNULL_END