Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application closes with white screen on click on "View Glymplses found in text". #2

Closed
githubmss opened this issue Dec 19, 2017 · 3 comments

Comments

@githubmss
Copy link

Hello Sir , I am trying to run your sample code but facing above mentioned issue.Also i would like to know Is it possible to integrate Glympse Map inside my application ?As i am making one application which do offers live location sharing and still i have not found any sample where i can see Gympse map integrated, if i am not wrong , in your sample you are passing data to Glympse app.What if i do not want to show that in Glymse app just want to render that in my own application's App . Is It Possible ?

@githubmss githubmss changed the title Application closes screen with white screen on click on "View Glymplses found in text". Application closes with white screen on click on "View Glymplses found in text". Dec 19, 2017
@hoosr2b2
Copy link

Hi @githubmss ! Thanks for reaching out. We will certainly look into the issue you are having. For your other questions could you submit a ticket at https://glympse.zendesk.com/hc/en-us/requests/new and we will be happy to help you get set up with Glympse SDK.
Thanks, Remington!

@githubmss
Copy link
Author

githubmss commented Dec 26, 2017

Hello @hoosr2b2 , i am running your sample on my Android Studio 3.0 , i am able to run your sample but finding some issue like sdk is not properly working with Studio ,Please refer below dropbox link :-
https://www.dropbox.com/personal?preview=Glympse.png

Project is running but i am not able to get signed inside glympse using any of the account and neither by Skipping login .

i am using this function for 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();
                    }
                }
            }
        });
    }

Please refer the bellow link :-

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

After execution of line :-

GPrimitive profile = GlympseFactory.createFacebookAccountProfile(mSocialFbToken);

Here is what i got in evaluating GPrimitive Object :-

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

My debugging got stop at this piece of call back :-

@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);
            }
        }
    }

Seems something not matching but when i try to evaluate GE.LISTENER_PLATFORM it says unable to find any local variable GE

Please let me know what i need to update or place in my code so that it starts recognizing the following two packages :-

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

Here is my setting.gradle file :-

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

Please let me know what i am left with , or what i am doing wrong in this.

@githubmss
Copy link
Author

Solved!!! , The problem was with gradle version , the studio was not recognizing imports when gradle version was 3.0.0-alpha3 , when i changed it to com.android.tools.build:gradle:2.2.3' and added distributionUrl=https://services.gradle.org/distributions/gradle-3.5-all.zip in wrapper properties , Studio start recognizing all imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants