From d6a208e3c4c4a43cd66a1c190653070df307644f Mon Sep 17 00:00:00 2001 From: King Date: Sun, 15 Feb 2015 10:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ios=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/IOSDocument.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 doc/IOSDocument.md diff --git a/doc/IOSDocument.md b/doc/IOSDocument.md new file mode 100644 index 0000000..30aa200 --- /dev/null +++ b/doc/IOSDocument.md @@ -0,0 +1,51 @@ +# Gump IOS SDK使用文档 + + +接入手册 +V +2015年02月13日 + + + +## 1、添加动态库 +在工程里添加FacebookSDK.framework、MobileCoreServices.framework、SystemConfiguration.framework、libz.dylib、CFNetwork.framework、libletsgame.a + + +## 2、设置头文件搜索路径 +头文件只有LetsGameAPI.h和LSGAccount.h两个文件,引入头文件,并设置搜索路径。 + + +## 3、添加资源文件 +在工程里添加letsgame.bundle资源文件,里面包含图片及相关语言包 + + +## 4、设置FacebookAppID和FacebookDisplayName +在工程的info.plist里设置FacebookAppID和FacebookDisplayName + + +## 5、在工程里添加SDK登录代码 + + [LetsGameAPI instance].appId = @"100"; // 设置appId + [LetsGameAPI instance].appKey = @"100"; // 设置appKey + + [[LetsGameAPI instance] showLoginView]; // 弹出登录页面 + + // 登录成功回调 + [LetsGameAPI instance].succBlock = ^(NSString *userId, NSString *sessionKey, LSGAccountType type) { + NSLog(@"%@", [NSString stringWithFormat:@"login succ: userId = %@, sessionKey = %@, accountType = %d", userId, sessionKey, type]); + }; + + // 登录失败回调 + [LetsGameAPI instance].dismissBlock = ^() { + NSLog(@"dismiss without login"); + }; + + +## 6、在xxAppDelegate.h里添加代码 + + - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { + // attempt to extract a token from the url + return [[LetsGameAPI instance] handleOpenURL:url sourceApplication:sourceApplication]; + } + +这样facebook跳转到web或facebook app 后, 登录返回时,才能够把登录信息带回来 \ No newline at end of file -- 2.0.0