当前位置: 首页 > news >正文

网站开发方向wordpress活动插件

网站开发方向,wordpress活动插件,在网站设计中 网页框架设计,重庆网站推广公司哪家好一、接入的准备工作 官方文档链接地址#xff1a;开始使用一键登录和注册 按照步骤进行接入即可 二、项目参考#xff08;Unity项目#xff09; 注意#xff1a;代码版本如果不适用新的Google API 请自行参考最新版本接口 SDKGoogleSignInActivity 主要用于登录的代码。Un…一、接入的准备工作 官方文档链接地址开始使用一键登录和注册 按照步骤进行接入即可 二、项目参考Unity项目 注意代码版本如果不适用新的Google API 请自行参考最新版本接口 SDKGoogleSignInActivity 主要用于登录的代码。UnityPlayer.UnitySendMessage的参数按照自己项目填写com.xxxxx.my也是填写自己项目的路径。 package com.xxxxx.my;import android.content.Intent; import android.net.Uri; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.TextView;import com.zhijingweilai.domino.R; import com.google.android.gms.auth.api.signin.GoogleSignIn; import com.google.android.gms.auth.api.signin.GoogleSignInAccount; import com.google.android.gms.auth.api.signin.GoogleSignInClient; import com.google.android.gms.auth.api.signin.GoogleSignInOptions; import com.google.android.gms.common.SignInButton; import com.google.android.gms.common.api.ApiException; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.unity3d.player.UnityPlayer;/*** Activity to demonstrate basic retrieval of the Google users ID, email address, and basic* profile.*/ public class SDKGoogleSignInActivity extends AppCompatActivity {private static final String TAG SignInActivity;private static final int RC_SIGN_IN 1234; // Can be any integer unique to the Activity.private GoogleSignInClient mGoogleSignInClient;private TextView mStatusTextView;Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);// [START configure_signin]// Configure sign-in to request the users ID, email address, and basic// profile. ID and basic profile are included in DEFAULT_SIGN_IN.String clientId getString(R.string.server_client_id);GoogleSignInOptions gso new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestEmail().requestIdToken(clientId).build();// [END configure_signin]// [START build_client]// Build a GoogleSignInClient with the options specified by gso.mGoogleSignInClient GoogleSignIn.getClient(this, gso);// [END build_client]}public void SendLogin() {GoogleSignInAccount account GoogleSignIn.getLastSignedInAccount(this);if (account ! null !account.isExpired()) {updateUI(account, );}elsesignIn();}// [START onActivityResult]Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {super.onActivityResult(requestCode, resultCode, data);// Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);if (requestCode RC_SIGN_IN) {// The Task returned from this call is always completed, no need to attach// a listener.TaskGoogleSignInAccount task GoogleSignIn.getSignedInAccountFromIntent(data);handleSignInResult(task);}}// [END onActivityResult]// [START handleSignInResult]private void handleSignInResult(TaskGoogleSignInAccount completedTask) {try {GoogleSignInAccount account completedTask.getResult(ApiException.class);// Signed in successfully, show authenticated UI.updateUI(account, );} catch (ApiException e) {// The ApiException status code indicates the detailed failure reason.// Please refer to the GoogleSignInStatusCodes class reference for more information.Log.w(TAG, signInResult:failed code e.getStatusCode());updateUI(null, e.toString());}}// [END handleSignInResult]// [START signIn]public void signIn() {Intent signInIntent mGoogleSignInClient.getSignInIntent();startActivityForResult(signInIntent, RC_SIGN_IN);}// [END signIn]// [START signOut]public void signOut() {mGoogleSignInClient.signOut().addOnCompleteListener(this, new OnCompleteListenerVoid() {Overridepublic void onComplete(NonNull TaskVoid task) {String str new JsonToString().AddJSONObject(result, 0).AddJSONObject(msg, signout).GetString();Log.i(Google, Google SignOut str str);UnityPlayer.UnitySendMessage(SDK_callback, OnGGSignOutResult, str);finish();}});}// [END signOut]// [START revokeAccess]public void revokeAccess() {mGoogleSignInClient.revokeAccess().addOnCompleteListener(this, new OnCompleteListenerVoid() {Overridepublic void onComplete(NonNull TaskVoid task) {String str new JsonToString().AddJSONObject(result, 0).AddJSONObject(msg, revokeAccess).GetString();Log.i(Google, Google RevokeAccess str str);UnityPlayer.UnitySendMessage(SDK_callback, OnGGRevokeAccessResult, str);finish();}});}// [END revokeAccess]private void updateUI(Nullable GoogleSignInAccount acct, String err) {if (acct ! null){String idToken acct.getIdToken();String personName acct.getDisplayName();String personGivenName acct.getGivenName();String personFamilyName acct.getFamilyName();String personEmail acct.getEmail();String personId acct.getId();Uri personPhoto acct.getPhotoUrl();Log.i(Google, Google SignIn URI personPhoto.toString());Log.i(Google, Google SignIn URI personPhoto.getPath());Log.i(Google, Google SignIn URI personPhoto.getQuery());String str new JsonToString().AddJSONObject(result, 0).AddJSONObject(msg, signin).AddJSONObject(refresh_token, idToken).AddJSONObject(personName, personName).AddJSONObject(personGivenName, personGivenName).AddJSONObject(personFamilyName, personFamilyName).AddJSONObject(personEmail, personEmail).AddJSONObject(loginId, personId).AddJSONObject(iconUrl, personPhoto.toString()).GetString();Log.i(Google, Google SignIn str str);UnityPlayer.UnitySendMessage(SDK_callback, OnGGSignInResult, str);acct null;}else{String str new JsonToString().AddJSONObject(result, 1).AddJSONObject(msg, signin).AddJSONObject(err, err).GetString();Log.i(Google, Google SignIn str str);UnityPlayer.UnitySendMessage(SDK_callback, OnGGSignInResult, str);}finish();}}JsonToString 用于处理数据将json数据转成string方便传输 package com.xxxxx.my;import org.json.JSONObject;public class JsonToString {private JSONObject jsonObj;public JsonToString(){jsonObj new JSONObject();};public JsonToString AddJSONObject(String key, Object val) {try {jsonObj.put(key, val);}catch(Exception e) {}return this;}public String GetString(){String str jsonObj.toString();return str;} }
http://www.tj-hxxt.cn/news/230720.html

相关文章:

  • 动力启航做网站校园网站建设素材
  • 世纪兴网站建设wordpress怎么放图片不显示
  • 海口免费自助建站模板淘宝关键词优化推广排名
  • 东莞高端网站建设哪个好wordpress侧栏导航栏
  • 网站开发代做东营建设网站公司电话
  • 网站建设的软件是哪个品牌推广策略包括哪些内容
  • 有什么网站可以自己做书网站首页做的好看
  • 电商型网站是否是趋势wordpress网站入口
  • 合肥网站营销网页制作中的常见问题
  • 西安网站建设开发熊掌号临沂网站哪家好
  • 网站开发小组wordpress管理员手册
  • 黄岩建设局台州网站建设为什么不用wordpress
  • 如何安装网站百度关键词搜索量查询
  • 上海网站建设流程青海建设厅的门户网站
  • 专门做讲座的英语网站手把手教你用动易做网站
  • 成都网站建设07fly网络维护管理
  • 织梦网站开发门户网站系统有哪些平台
  • 企业网站内容如何搭建单页网站 产品放哪
  • 注册域名网站asp网站开发心得体会
  • 上上海网站建设设计集团门户网站建设公司
  • 椒江网站建设578做网站wordpress需要的插件
  • 有关做内购的网站科学规划网页的做法是()
  • 视频网站后台登陆东莞常平嘉华学校
  • php网站源码带后台静态网站 搜索
  • 网站建设标志图怎么用自助网站
  • 网站建设cach目录陕西省住房与建设厅网站
  • 杭州seo网站优化公司石家庄网站建设公司怎么样
  • 龙华住房与建设局网站wordpress如何设置页面布局
  • 做门户网站用什么技术好wordpress安装的模板文件在哪
  • 赣州做网站的公司哪家好搜索引擎优化与推广技术