Rainbow-CPaaS / Rainbow-Android-SDK-Samples

All samples of the Rainbow SDK for Android
Other
2 stars 8 forks source link

Signin failed #1

Closed Samuelyip74 closed 6 years ago

Samuelyip74 commented 6 years ago

Hi, I clone the code and run the app in my Android device, tried to sign in with an account newly created in sandbox. But I got an error that says Signin_failed: CONNECTION_WRONG_LOGIN_OR_PWD.

I can login via browser to the sandbox with the same email and password

Please advise what could be the problem?

zucher commented 6 years ago

Hi, did you change the target host to sandbox ?

Regards

Samuelyip74 commented 6 years ago

Do I need to change?

Is already in the code.

private void attemptLogin() { final String email = m_loginView.getText().toString(); final String password = m_passwordView.getText().toString();

    RainbowSdk.instance().connection().start(new StartResponseListener() {
        @Override
        public void onStartSucceeded() {
            RainbowSdk.instance().connection().signin(email, password, "sandbox.openrainbow.com", new SigninResponseListener() {
                @Override
                public void onSigninSucceeded() {
                    m_activity.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            new ImNotificationMgr(m_activity);
                            m_activity.openConversationsTabFragment();
                            m_activity.unlockDrawer();
                        }
                    });
                }
                @Override
                public void onRequestFailed(final RainbowSdk.ErrorCode errorCode, final String s) {
                    m_activity.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            Toast.makeText(m_activity, "Signin failed: " + errorCode, Toast.LENGTH_SHORT).show();
                        }
                    });
                }
            });
        }

        @Override
        public void onRequestFailed(RainbowSdk.ErrorCode errorCode, String err) {
            Log.getLogger().error(LOG_TAG, "SDK start failure !!!");
        }
    });

}

}

setyongr commented 6 years ago

@Samuelyip74 You need to remove applicationId and applicationSecret from Application. Initialize the SDK like this RainbowSdk.instance().initialize().

It's works for me

Samuelyip74 commented 6 years ago

Thank you. Got it resolved after following the steps below.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Setyo Nugroho notifications@github.com Sent: Wednesday, May 9, 2018 8:03:53 PM To: Rainbow-CPaaS/Rainbow-Android-SDK-Samples Cc: Samuelyip74; Mention Subject: Re: [Rainbow-CPaaS/Rainbow-Android-SDK-Samples] Signin failed (#1)

@Samuelyip74https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSamuelyip74&data=02%7C01%7C%7Ca1c9254b0a9946cf7c1608d5b5a4ef7a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636614642351908808&sdata=twYk1D9zQMo%2BTYnZ3Tbsi0PHOdWbT9sOg%2FkCyDKyndM%3D&reserved=0 You need to remove applicationId and applicationSecret from Application. Initialize the SDK like this RainbowSdk.instance().initialize().

It's works for me

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRainbow-CPaaS%2FRainbow-Android-SDK-Samples%2Fissues%2F1%23issuecomment-387716579&data=02%7C01%7C%7Ca1c9254b0a9946cf7c1608d5b5a4ef7a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636614642352065084&sdata=oQtBH1R3%2B2IJbXrIKCXzA5zd9F5i6B4wIT4JaAREHS4%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAcz-HQ9sCS1eHpif_zXJ2HxtQk49oHibks5twtspgaJpZM4Twjab&data=02%7C01%7C%7Ca1c9254b0a9946cf7c1608d5b5a4ef7a%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636614642352065084&sdata=3cppGqowzPaAM9pomMC53zHuE%2FklsOi%2Bxn%2BnaNrOcWk%3D&reserved=0.