尽管将Glympse Api与Gradle

时间:2017-12-28 05:20:24

标签: android glympse

我正在我的Android Studio 3.0上运行Glympse Sdk示例,我能够运行示例但是发现像sdk这样的问题并没有正常使用Studio,请参考下面的dropbox链接查看屏幕截图: -

https://www.dropbox.com/personal?preview=Glympse.png

项目正在运行,但我无法使用任何帐户在Glympse内签名,也无法通过跳过登录进行签名。

我在Facebook上使用此功能: -

public void fbLogin() {
        LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList(this.getString(R.string.fb_email), this.getString(R.string.fb_public_profile)));
        LoginManager.getInstance().registerCallback(_callbackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {
                mSocialFbToken = com.facebook.AccessToken.getCurrentAccessToken().getToken().toString();
                GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
                    @Override
                    public void onCompleted(JSONObject object, GraphResponse response) {
                        try {
                            GPrimitive profile = GlympseFactory.createFacebookAccountProfile(mSocialFbToken);
                            GlympseWrapper.instance().getGlympse().logout();
                            GlympseWrapper.instance().getGlympse().login(profile);
                            GlympseWrapper.instance().getGlympse().start();

                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                });
                Bundle parameters = new Bundle();
                parameters.putString("fields", "id, name, email, first_name,birthday,last_name,gender");
                request.setParameters(parameters);
                request.executeAsync();
            }

            @Override
            public void onCancel() {

            }

            @Override
            public void onError(FacebookException error) {
                if (error instanceof FacebookAuthorizationException) {
                    if (com.facebook.AccessToken.getCurrentAccessToken() != null) {
                        LoginManager.getInstance().logOut();
                        fbLogin();
                    }
                }
            }
        });
    }

请参阅以下链接: -

https://www.dropbox.com/s/9ao6pl532pmumiw/glypseFbLoginProcess.png?dl=0

执行行后: -

GPrimitive profile = GlympseFactory.createFacebookAccountProfile(mSocialFbToken);

这是我在评估GPrimitive对象时得到的: -

https://www.dropbox.com/s/w6n3fj0l7eq3hnx/glympsecreate.png?dl=0

我的调试停止了这段回电: -

@Override
    public void eventsOccurred(GGlympse glympse, int listener, int events, Object obj) {
        if (GE.LISTENER_PLATFORM == listener) {
            if (0 != (events & GE.PLATFORM_ACCOUNT_CREATE_FAILED)) {
                // Check for a failure to create a Glympse account. This can happen for several reasons,
                // but in this case, it's most likely invalid or expired tokens from a third-party service.
                Toast.makeText(this, "Error: Federated login failed.", Toast.LENGTH_LONG).show();

                setTitle("Account Linking", false);
            }
            if (0 != (events & GE.PLATFORM_SYNCED_WITH_SERVER)) {
                // If we successfully sync with the server, then we have a valid Glympse user account and
                // up-to-date access tokens, so show the "account linking" view from which the user can
                // choose to link new accounts, unlink existing accounts or logout.
                Intent intent = new Intent(this, LinkedAccountsActivity.class);
                startActivity(intent);

                setTitle("Account Linking", false);
            }
        }
    }

似乎是不匹配的东西,但当我试图评估 GE.LISTENER_PLATFORM 时,表示无法找到任何本地变量GE

请让我知道我需要更新或放入我的代码,以便开始识别以下两个软件包: -

  
      
  1. com.glympse.android.api
  2.   
  3. com.glympse.android.core
  4.   

这是我的setting.gradle文件: -

include ':accountLinkingDemo' include ':GlympseApi' project(':GlympseApi').projectDir = new File('../GlympseApi')

请让我知道我剩下的是什么,或者我在做错了什么。我已按照Glympse主页上的入门流程中提到的每一步: -

https://developer.glympse.com/docs/core/client-sdk/guides/platforms/intro-android

我是这个SDk的新手,想要了解它是如何工作的,以便我可以在我的应用程序中看到它。

我试图解决这些兼容性问题,但Glympse Api还没有得到工作室的认可。

以前有人遇到过这个问题吗?任何帮助都会得到赞赏!!!

感谢。

0 个答案:

没有答案