//
//  FunCellChannel.h
//  FunCellChannel
//
//  Created by 胡鑫 on 16/5/26.
//  Copyright © 2016年 huxin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import <funcell_framework/Platform_553.h>

//delegate
@protocol FunCellChannelDelegate <NSObject>

/**
 *初始化成功回调
 */
- (void)FCCDInitSuccessCallback;

/**
 *登录回调
 */
- (void)FCCDLoginCallBack:(NSString *)username anduserid:(NSString *)userID andsessionid:(NSString *)sessionID andtoken:(NSString *)token andresult:(NSString*)result;

/**
 *支付回调
 */
- (void)FCCDPayCallBack:(NSString *)billNo;

/**
 *渠道回调支付成功回调
 *billNo
 平台订单号
 *extData
 调用支付传入的附加字符串,透传参数
 */
- (void)FCCDPaySuccessCallBack:(NSString*)billNo andextdata:(NSString *)extData;

/**
 *渠道回调支付失败回调
 *information
 回调通知信息
 */
- (void)FCCDPayFailCallBack:(NSString*)information;

/**
 *渠道回调支付取消回调
 *information
 回调通知信息
 */
- (void)FCCDPayCancelCallBack:(NSString*)information;

/**
 *渠道回调支付关闭界面,网络请求失败,未知错误等
 *information
 回调通知信息
 */
- (void)FCCDPayClosePayPage:(NSString*)information;

/**
 *sdk通知游戏退出登录
 */
- (void)FCCDPlatformToGameLogout;

/**
 *游戏中心关闭回调
 */
- (void)FCCDGameCenterCloseCallback;

/**
 *注册或游客登录成功回调
 */
- (void)FCCDRegisterCloseCallback;

/**
 *分享结果反馈
 */
- (void)FCCDShareResult:(NSString*)state andresult:(NSDictionary*)result;

@end

@interface FunCellChannel : UIViewController<UITextFieldDelegate, UIAlertViewDelegate, Platform_553Delegate>
{
    UIView* m_rootView;
    NSString* userIdStr;
    NSString* s_extData;
}

@property (nonatomic, assign) id<FunCellChannelDelegate> funcellchanneldelegate;

//当前实例系统
+(FunCellChannel*) shareInstace;

/**
 *保存商品列表,app补单用到
 */
- (void)setsdkpaylist:(NSString*)paylist;

-(void)setRootViewController:(UIViewController *)viewController;

//初始化回调的ＳＤＫ系统
-(void)InitSystem;

-(void)InitSDK;

//打开登录接口
-(void)Login;

-(void)LoginSuccess;

//得到平台的编号
-(int)GetPlatformID;

//得到平台的名字
-(NSString*)GetPlatFormName;

-(NSString *)getPlatformUserName;

//支付接口
-(void)SDKPay:(float)money num:(int)num params:(NSDictionary*)params;

//统计调用处理
-(void)SDKtotal:(int)type params:(NSDictionary*)params;

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;

#ifdef __IPHONE_9_0
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options;
#endif

//Deprecated in iOS 9.0.
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;

- (void)applicationWillResignActive:(UIApplication *)application;

- (void)applicationDidEnterBackground:(UIApplication *)application;

- (void)applicationWillEnterForeground:(UIApplication *)application;

- (void)applicationDidBecomeActive:(UIApplication *)application;

- (void)applicationWillTerminate:(UIApplication *)application;

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;

-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;

#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_7_0
#warning "Remote push open tracking is counted only when user touches notification center under iOS SDK 7.0"

// iOS version7 以下时,
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
#else
// iOS version7 以上时,
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler;
#endif

//Local Push Handler
- (void)application:(UIApplication*)application didReceiveLocalNotification:(UILocalNotification *)notification;

//游戏通知平台注销
-(void)SDkLogOut;

-(void)showToolbar:(bool) bShow;

-(void)showTip:(NSString *)info;

//-------------------------重做DealMessage写成函数形式-----------------
/**
 *用户中心
 */
- (void)FCDMUsercenter;

/**
 *论坛
 */
- (void)FCDMWebbbs;

/**
 *反馈页面
 */
- (void)FCDMWebbackup;

/**
 *统计通能
 */
- (void)FCDMWebtotal;

/**
 *创建角色
 */
- (void)FCDMCreaterole;

/**
 *进入游戏
 */
- (void)FCDMEntergame;

/**
 *等级变化
 */
- (void)FCDMLevelChange:(int)level;

/**
 *游戏激活
 */
- (void)FCDMGameActive;

/**
 *官方网站
 */
- (void)FCDMWeburl:(NSString*)url;

/**
 *统计完成了新手引导
 */
- (void)FCDMCompletedTutorial;

/**
 *打开facebook界面,某些国外渠道需要
 */
- (void)FCDMFacebookBtn;

/**
 *是否接受第三方sdk推送
 */
- (void)FCDMIsPush:(BOOL)ispush;

/**
 *分享图片
 *img
 图片
 */
- (void)FCDMSharePhoto:(UIImage *)img;
/**
 *分享链接
 *AppName
 应用名
 *imageurl
 图片链接
 *despt
 内容说明
 *url
 分享的链接
 */
- (void)FCDMShareLink:(NSString*)title pictureURL:(NSString*)imageurl description:(NSString*)despt linkUrl:(NSString*)url;

/**
 *点赞
 *objectid
 通过 objectID 属性将网址分配到赞
 */
- (void)FCDMLike:(NSString*)objectid;

/**
 *第三方Event统计
 *eventName
 自定义事件的id
 *values
 统计传入的值
 *sdktype
 sdk的类型,一般为sdk名字小写全称
 值可以有:@"facebook",@"appsflyer",@"all",all为所有sdk都调用
 */
- (void)FCDMThirdEvent:(NSString*)eventName withValues:(NSDictionary*)values andEventType:(NSString*)eventtype andSdkType:(NSString*)sdktype;

//gamecenter
/**
 *显示排行榜界面
 *leaderboardID
 排行榜id,可以传空
 */
- (void)FCDMshowLeaderboard:(NSString*)leaderboardID;

/**
 *上传分数到排行榜
 *score
 上传的分数
 *identifier
 排行榜id
 */
- (void)FCDMreportScore:(int64_t)score forLeaderboardID:(NSString*)identifier;

/**
 *显示成就界面
 *achievementboardID
 成就id,可以传空
 */
//- (void)FCDMshowAchievementboard:(NSString*)achievementboardID;
/**
 *报告成就
 *identifier
 成就id
 *percent
 要报告的成就的进度
 */
- (void)FCDMreportAchievementIdentifier:(NSString*)identifier percentComplete:(float)percent;

/**
 *展示Helpshift
 */
- (void)FCDMHelpshiftView;

/**
 *显示账号绑定和切换界面
 */
- (void)FCDMShowFuncellAccount;

/**
 *设置统计sdk货币单位
 *currencyCode
 币种:RMB/USD…
 */
- (void)setAppsFlyerCurrencyCode:(NSString*)currencyCode;

/**
 *获取AppsFlyer Unique ID
 */
- (NSString*)getAppsFlyerUID;

/**
 *设置AppsFlyer  Customer User ID (用户账户ID)
 *userId
 用户ID
 */
- (void)setAppsFlyerCustomerUserId:(NSString*)userId;

/**
 *AppsFlyer基于深度链接Re-targeting广告追踪
 */
- (void)setAppsFlyerSendDeepLinkData;

///////////////////////////////////////游戏周期事件
/**
 *渠道登录事件
 */
- (id)LoginEvent:(NSDictionary*)values;

/**
 *渠道角色创建事件
 */
- (id)CreatRoleEvent:(NSDictionary*)values;

/**
 *渠道角色升级事件
 */
- (id)RoleLevelUpEvent:(NSDictionary*)values;

/**
 *进入游戏主场景事件
 */
- (id)ServerRoleEvent:(NSDictionary*)values;

//

@end
