GithubHelp home page GithubHelp logo

oneall / android-sdk Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 18.0 770 KB

This SDK provides the tools to use OneAll on the Android platform. It allows users to login with their social network accounts and to share messages with their friends. The library is integrated with a few lines of code and uses native Android integration with Facebook and Twitter where possible.

Home Page: http://docs.oneall.com/services/implementation-guide/

Java 100.00%

android-sdk's Introduction

OneAll

The .Net OneAll SDK originally created by me at XPG. Contains code examples that show you how to use OneAll REST API and how to implement and customize Social Login on your own website. The OneAll.Net SDK supports single and multiple OneAll REST API connections simultaneously. It also includes extension methods for use in ASP.Net Web Pages as well as extensions for .Net MVC Razor Engine and a singleton API class for easy server side interaction. Full CHM documentation is included.

android-sdk's People

Contributors

rjam avatar urk avatar zaradamien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-sdk's Issues

YouTube login issue

Hi,
We were trying to login to youtube by using below method,

private void loginToYouTube() {

        OAManager.getInstance().login(this, "youtube", new OAManager.LoginHandler() {
            @Override
            public void loginSuccess(User user, Boolean newUser) {
                //Log.v(TAG, String.format("OA user %s", user.identity.name.formatted));
                mUser = user;
            }

            @Override
            public void loginFailure(OAError error) {
                Log.v(TAG, String.format("Failed to login into OA: %s", error.getMessage()));
            }
        });
    }

But we are unable to login as OAuth requests to Google in embedded browsers known as “web-views” is no longer supported.
We can find details here.
https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html

Please guide how we can move forward with youtube login.

--
Thanks,
Abhijit

Reduce SDK's method count footprint from native SDKs

AFAICT, the Twitter wrapper is currently only used to perform authorization requests to Twitter. This is part of the twitter-core submodule and the only one required to perform this action. Updating the dependency to use twitter-core instead of its parent "twitter" module significantly reduces the SDK's footprint on the calling application which is important due to Android's method count limits per .dex file pre-5.0.

The change is as simple as:

  • Alter the build.gradle dependencies block:
compile('com.twitter.sdk.android:twitter-core:1.4.1@aar') {
        transitive = true;
    }
//    compile('com.twitter.sdk.android:twitter:1.3.2@aar') {
//        transitive = true;
//    }
  • Alter Fabric's init method from Twitter to TwitterCore:
Fabric.with(this.mAppContext, new TwitterCore(authConfig));

Crash with FacebookWrapper class

Hi ,
When we call below method in onCreate method of Activity,
OAManager.getInstance().onCreate(this, savedInstanceState);

We are getting crash as below,

java.lang.NoClassDefFoundError: com.oneall.oneallsdk.FacebookWrapper$SessionStatusCallback
               at com.oneall.oneallsdk.FacebookWrapper.<init>(FacebookWrapper.java:38)
               at com.oneall.oneallsdk.FacebookWrapper.getInstance(FacebookWrapper.java:57)
               at com.oneall.oneallsdk.OAManager.onCreate(OAManager.java:612)

Please let us know if we are missing something.

--
Thanks,
Abhijit

Native SDKs aren't being notified when user cancels sign in

When the user attempts to sign in using FB or Twitter, if he backs out of the process and attempts to do it again, the SDK will not return any action nor feedback until the app is completely killed from memory and restarted. The cause for this behavior is the fact that the native SDKs are not being notified of this user action as they should.

OAManager's onActivityResult is currently discarding the canceled events as far as the native SDKs are concerned. It should look this instead (notice how both OK and CANCELED results are propagated to the native SDKs:

public void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (resultCode) {
            case Activity.RESULT_OK:
                if (requestCode == INTENT_REQUEST_CODE_SELECT_ACTIVITY) {
                    loginOnResumeProvider = data.getExtras().getString(ProviderSelectActivity.INTENT_EXTRA_PROVIDER);
                    loginOnResume = true;
                } else if (requestCode == INTENT_REQUEST_CODE_LOGIN) {
                    webLoginComplete(data);
                } else {
                    FacebookWrapper.getInstance().onActivityResult(requestCode, resultCode, data);
                    TwitterWrapper.getInstance().onActivityResult(requestCode, resultCode, data);
                }
                break;
            case Activity.RESULT_CANCELED:
                // let the native sdk's handle the result canceled ev as well
                FacebookWrapper.getInstance().onActivityResult(requestCode, resultCode, data);
                TwitterWrapper.getInstance().onActivityResult(requestCode, resultCode, data);
            case WebLoginActivity.RESULT_FAILED:
                if (loginHandler != null) {
                    loginHandler.loginFailure(new OAError(OAError.ErrorCode.OA_ERROR_CANCELLED, null));
                    loginHandler = null;
                }
        }
    }

Unable to postMessage to multiple social sites in a single call

Hi,
Below is the method which we are using to post the message on social sites,
public void postMessage(String text,
@nullable String pictureUrl,
@nullable String videoUrl,
@nullable String linkUrl,
@nullable String linkName,
@nullable String linkCaption,
@nullable String linkDescription,
@NotNull Boolean enableTracking,
String userToken,
String publishToken,
java.util.Collection providers,
OAManager.OAManagerPostHandler handler)

It works perfectly for posting a message to one social site at a time.
But when we try to post the message to multiple social sites then it fails.
For posting the message to multiple site we used 2nd last parameter,
java.util.Collection providers

Here with this parameter we added facebook and twitter in the collections and used the "User" object which we received from either twitter or facebook after successful login.

So can you guide for this how exactly we can achieve posting the message to the multiple sites in a call.
Do we have any provision where we can send the array of User token as we are accepting array of providers.
Awaiting for the reply.

--
Thanks,
Abhijit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.