Skip to content

[Question] Android: My own providers are not supported yet? #102

Open
@pi-chan

Description

@pi-chan

I've implemented iOS app for my own oauth provider with rn-oauth.
It works as I expected.

But on Android, it doesn't.
I got following error on OAuthManager#authorize().

04-09 22:22:55.143  5149  5189 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.github.scribejava.core.oauth.OAuth20Service.getAuthorizationUrl()' on a null object reference

So I read some code, found this static method, and it seems additional providers are not cosidered on Android.

  static public OAuth20Service getApiFor20Provider(
    final String providerName,
    final HashMap params,
    @Nullable final ReadableMap opts,
    final String callbackUrl
  ) {
    if (providerName.equalsIgnoreCase("facebook")) {
      return OAuthManagerProviders.facebookService(params, opts, callbackUrl);
    } else if (providerName.equalsIgnoreCase("google")) {
      return OAuthManagerProviders.googleService(params, opts, callbackUrl);
    } else if (providerName.equalsIgnoreCase("github")) {
      return OAuthManagerProviders.githubService(params, opts, callbackUrl);
    } else if (providerName.equalsIgnoreCase("slack")) {
      return OAuthManagerProviders.slackService(params, opts, callbackUrl);
    } else {
      return null;
    }
  }

Not supported yet on Android ?
Or there is the way to get my own provider work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions