unity ios login
// quick login
public void QuickLogin()
{
Debug.Log ("--------------- quick login -------------");
Facade.Instance.SendNotification(LoginNotes.SHOW_CONNECT_GAMECENTER);
Social.localUser.Authenticate (_HandleAuthenticated);
}
private void _HandleAuthenticated(bool success)
{
_userInfo = "";
Debug.Log ("--------- login static ----------------: " + success);
if (success)
{
Debug.Log("-------------- login success --------");
//@"TestType", @"type",
//[AppGameCenterForZszb instance].mId, @"id",
//[AppGameCenterForZszb instance].mUserName, @"userName",
//@"TestPassword", @"password",
//@"123", @"token", nil];
Debug.Log("authenticated :" + Social.localUser.authenticated
+ "\n id :" + Social.localUser.id
+ "\n user name :" + Social.localUser.userName
+ "\n underage :" + Social.localUser.underage
+ "\n state :" + Social.localUser.state);
_userInfo = _CreateUserInfo("type", Social.localUser.id, Social.localUser.userName, "pw", "123");
//SendMessage(gameObject.name, "OnMessage", MSG_LOGIN_SUCCESS);
SendMessage("OnMessage", MSG_LOGIN_SUCCESS);
}
else
{
SendMessage("OnMessage", MSG_LOGIN_FAIL);
Hint.Show(OTManager.Get("hint_login_GameCenter_fail"));
}
Facade.Instance.SendNotification(LoginNotes.HIDE_CONNECT_GAMECENTER);
}
xcode 打ios 64位 c99 Missing 64-bit support :
原因是mm文件,c混编的方法无法找到,需要引入相关的头文件
如以下代码:
#if defined(__cplusplus)
extern "C" {
#endif
extern void UnitySendMessage(const char* obj, const char* method, const char* msg);
extern NSString* AppStoreCreateNSString (const char* string);
extern NSString* CreateNSString (const char* string);
#if defined(__cplusplus)
}
#endif
打包64位没任何错误,直接build failed
先不要archive,先clean ,然后build,就能出现错误,解决完即可