Giter VIP home page Giter VIP logo

line-sdk-starter-android-v2's Introduction

line-android-v2-starter

LINE Android SDK V2 starter

Introduction

This is a sample application for LINE Android SDK V2. It demonstrates the following functionality:

  • App-to-app Login
  • Web Login
  • GetProfile API
  • Verify Token API
  • Refresh Token API
  • Logout API

Before Starting

  • You must have Android Studio installed.
  • You must create a LINE Login account on the LINE Business Center that has the application type set to NATIVE_APP. You will need the account's Channel ID to set up the SDK.

Setup

  1. Download the SDK aar file (line-sdk-x.x.x) from the LINE Developer Console and put it into the app/libs folder.
  2. Set the CHANNEL_ID constant in Constants.java to your Channel ID and then open the project in Android Studio and build it as you would with any normal Android application.

How to Use

The Login with LINE button will use the LINE App to log in and the Browser Login button will open a Web Login screen inside of a Chrome custom tab.

After logging in, the user's profile information and access token will be displayed on the screen in addition four buttons:

  • GET PROFILE - Pushing this button will call the LINE SDK's getProfile() method. The profile information retrieved from the API will appear in a Popup Dialog. This information should be the same as the profile information that is initially displayed to the user after they log into this starter application.
  • VERIFY TOKEN - Pushing this button will call the LINE SDK's verifyToken() method. A will appear informing the user if their token is valid or not.
  • REFRESH TOKEN - Pushing this button will call the LINE SDK's refreshAccessToken() method. This will update the access token that is displayed on the starter app's main screen.
  • LOGOUT - Pushing this button will call the LINE SDK's logout() method. This will revoke the access token and return the user to the "Select Login" page.

Documentation

For detailed documentation, please refer to these links:

line-sdk-starter-android-v2's People

Contributors

cosmic-cowboy avatar liying2010 avatar mrmaakun avatar yichingchiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

line-sdk-starter-android-v2's Issues

Callback intent is null

public void onActivityResult(int requestCode, int resultCode, Intent data) 方法中返回的intent为空,调用 LineLoginResult result = LineLoginApi.getLoginResultFromIntent(data);时 返回new LineLoginResult(LineApiResponseCode.INTERNAL_ERROR, new LineApiError("Callback intent is null"))

login with browser failed

Not installed line application, login using UC browser, login successful can't return to the game

Line login issue

when I login with line sdk android I've got white dialog
"Error"
"An unknow error occurred."

what is this error ?

what should I do now?

Everything in channel is all set and matched

I think line sdk for android is too much problem

getLoginIntent()後に「ログインしました」というToastを非表示にできますか

getLoginIntent()後に「ログインしました」というToastが勝手に出ますが、これを非表示にする方法はないですか?
ログインSDKなので、ログイン処理のみ行えば良いと思います。UI部分まで含まれていて、しかもそれが変更できない仕様は非常によくないです。Facebook Login SDKを参考に修正してください。
あとドキュメントがひどい(簡略すぎる)ので、修正してほしいです。

getLoginIntent() 후에 로그인했다는 토스트가 멋대로 나오는데, 이걸 표시안하는 방법이 있을까요?
갠적으로 로그인SDK는 로그인 처리만 할 수 있으면 된다고 생각합니다. 로그인SDK가 UI부분까지 포함되어 있는데다가 그 UI가 변경불가능한 사양은 매우 안좋습니다. Facebook Login SDK를 참고해서 설계를 변경해주셨으면 합니다.
그리고 개발자용 도큐멘트가 너무 대충입니다. 라인이라는 플랫폼이 세계적인 플랫폼인데 이래서 되겠습니까.

line login issue

Hello,
When I tune up the line client login, this time directly press the back button, will stay in the progressbar interface, will not automatically shut down.

Question about a mid

Even if the channel is different, does the user's mid obtained by calling the /v1/profile endpoint have the same value?

Calling LineLoginApi.getLoginIntent getting ActivityNotFoundException

SDK Version: 4.0.2
Device Model: Samsung S4
Here is stack trace:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://access.line.me/dialog/oauth/weblogin?response_type=code&client_id=1509810234&state=sn1XUQ99mS0&otpId=7O3NQAgKclnwKUl+ej6/gT8KUd0=&redirect_uri=intent://result#Intent;package=com.gobike.consumer.stg;scheme=lineauth;end pkg=jp.naver.line.android }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1801)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1499)
at android.app.Activity.startActivityForResult(Activity.java:3942)
at android.support.v4.app.ActivityCompatJB.startActivityForResult(ActivityCompatJB.java:26)
at android.support.v4.app.ActivityCompat.startActivityForResult(ActivityCompat.java:146)
at com.linecorp.linesdk.auth.internal.c$c.onPostExecute(SourceFile:1120)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5951)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

Anyone has idea?

Login Error

I use this project with latest SDK 4.0.8 and upgrade project setting to [Gradle Version=>4.6]& [Android Plugin Version3.2.1]
(cuz got error:"No toolchains found in the NDK toolchains folder for ABI with prefix: mipsel-linux-android" seems to old gradle version)

change the channel ID then build APK. so far so good.
when press "Login with Line". Pop out the Line Client APP but show"錯誤 無法正常執行"(Error Can't Execute)
Error here:

E/ActivityTrigger: activityStartTrigger: not whiteListedjp.line.android.sdk.sample/jp.line.android.sdk.sample.MainActivity/1
E/ActivityTrigger: activityStartTrigger: not whiteListedjp.line.android.sdk.sample/com.linecorp.linesdk.auth.internal.LineAuthenticationActivity/1
E/ActivityTrigger: activityStartTrigger: not whiteListedjp.naver.line.android/jp.naver.line.android.IdentityRequiredSchemeServiceActivity/19081503
E/ActivityTrigger: activityStartTrigger: not whiteListedjp.naver.line.android/jp.naver.line.android.urlscheme.service.oauth.OAuthWebLoginServiceActivity/19081503_

and press "browser login". shows the browser correctly but when type in the account&password. It always return got the the account is not signed up,wrong e-mail or wrong password.

I check and try several times.and checked the line account which I already logged in both PC and Mobile.
Need a big help.I'm new to android studio(need this in Unity Project).

Hope maybe somedays will add Unity's package.
Sorry for poor English.
Many thanks.

User ID keeps changing.

I found that getting user id from this command
--> result.getLineProfile().getUserId()
will return different id after some peroid of time.

Is this normal or should it remain the same?

Will the user id change if users change their profile details?
Can the user id be different if users change their phone?

What can cause the user id to change?

Duplicate id "@+id/userDataLayout" in activity_post_login.xml

in app/src/main/res/layout/activity_post_login.xml, there are 2 <LinearLayout android:id="@+id/userDataLayout"> ... </LinearLayout> tags, and one is inside the other.

So, gradle build task complains an error:

Error: Duplicate id @+id/userDataLayout, already defined earlier in this layout [DuplicateIds]
android:id="@+id/userDataLayout"

BTW, I am using the latest gradle v4.1, instead of the old gradle v2.14.1 which is used by this repo currently, maybe this is why this error not happen in current build environment?

Unable to load class io.jsonwebtoken.impl.DefaultJwtParser

when I request Scope.OPENID_CONNECT, I got the following error.
I guess I might have to touch the proguard file, but what is it?

java.io.IOException: org.json.JSONException: Unable to load class named [io.jsonwebtoken.impl.DefaultJwtParser] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. Class could not be found.
at com.linecorp.linesdk.a.a.d.a(Unknown Source:14)
at com.linecorp.linesdk.a.a.a.a.a(Unknown Source:101)
at com.linecorp.linesdk.a.a.a.a.a(Unknown Source:84)
at com.linecorp.linesdk.auth.internal.c$a.a(Unknown Source:151)
at com.linecorp.linesdk.auth.internal.c$a.doInBackground(Unknown Source:2)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: org.json.JSONException: Unable to load class named [io.jsonwebtoken.impl.DefaultJwtParser] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. Class could not be found.
at com.linecorp.linesdk.a.a.e$a.b(Unknown Source:92)
at com.linecorp.linesdk.a.a.e$a.a(Unknown Source:0)
at com.linecorp.linesdk.a.a.d.a(Unknown Source:6)
... 10 more

login successful can't return to the game

Hi,
OK , I encountered a problem。
When the Line App Client does not log in, I choose to get information from my app login line, login successful can't return to the game

Unbale to Login into Line when Android App in Release Mode

Line Login working fine in Android App in Debug Mode.

Class : IdTokenParser Method : LineIdToken parse(final String idTokenStr, final SigningKeyResolver signingKeyResolver) throws Exception

Unable to load class named [io.jsonwebtoken.impl.DefaultJwtParser] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. The class could not be found.

Login failed

hi ,
First I use first phone to log in . Then I use second phone to log in the same id;
This time, I was in the first mobile phone, with my own app call line client login time, will report

 Error
 An unknown error occured

The dialog box.

login fail ?

tools:eclipse

linesdk :4.0.8

05-28 18:32:22.396 22764 22764 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/customtabs/CustomTabsIntent$Builder;
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at com.linecorp.linesdk.auth.internal.c$c.onPostExecute(SourceFile:12180)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:667)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at android.os.AsyncTask.-wrap1(AsyncTask.java)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:684)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at android.os.Looper.loop(Looper.java:159)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6345)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
05-28 18:32:22.396 22764 22764 E AndroidRuntime: Caused by: java.lang.ClassNotFoundExc
05-28 18:32:22.397 22764 22798 I MID : read mid from Settings.System
05-28 18:32:22.403 1376 2335 W ActivityManager: Force finishing activity com.xxxx.test/com.linecorp.linesdk.auth.internal.LineAuthenticationActivity, mTaskHistory size = 30

SDK Issues

Class not found when unmarshalling: com.linecorp.linesdk.auth.LineAuthenticationConfig
java.lang.ClassNotFoundException: com.linecorp.linesdk.auth.LineAuthenticationConfig

on Samsung occur this

login always require authorization after change keystore

we changed our keystore setting in line developer website and our local build setting
before do that, our app only show line authorization once, and directly login later
after do that, our app show line authorization everytime login
we use line android sdk v1

chat with line user

Hello,
Can I use this SDK to develop a IM app which can chat with line user?

I am looking forward for your answers :)

when discard activities option on onActivityResult not call

background activity may be killed by system.
line-sdk cannot return onActivityResult this case.

08-02 16:26:43.590 583-1162/? E/BufferQueueProducer: [myapp.debug/com.linecorp.linesdk.auth.internal.LineAuthenticationActivity#0] disconnect: not connected (req=1)

08-02 16:26:43.778 1214-1359/? E/WindowManager: win=Window{e1c109f u0 myapp.debug/com.linecorp.linesdk.auth.internal.LineAuthenticationActivity EXITING} destroySurfaces: appStopped=true win.mWindowRemovalAllowed=true win.mRemoveOnExit=true

08-02 16:26:43.791 583-1162/? E/BufferQueueProducer: [jp.naver.line.android/jp.naver.line.android.activity.channel.permission.ChannelPermissionApprovalActivity#0] disconnect: not connected (req=1)
08-02 16:26:43.792 583-1162/? E/SurfaceFlinger: Failed to find layer (myapp.debug/com.linecorp.linesdk.auth.internal.LineAuthenticationActivity#0) in layer parent (no-parent).

problem

How can I solve this problem?
02444

share in android

Our game integrate line android sdk. We want share app to other line user.But I can't find method to share or get friend list in android sdk. Can you help me ?

Unable to Login

Hi,

i am using the latest sdk (4.0.4)
and got the following error using the A2ALogin. The browser login also continually fails.

E/ERROR: Login FAILED!
E/ERROR: LineApiError{httpResponseCode=-1, message='Callback intent is null'}

I have set the channel id accordingly in the channel console.
However what I am not sure of is the Android package signature, is there any specification on this? The doc only says that i can fill it with anything, so I did.

Regards

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.