telenordigital / connect-android-sdk

Android SDK for CONNECT ID
https://telenordigital.github.io/id-docs.telenordigital.com/
Other
16 stars 14 forks source link

Clean up connect custom tab login button #153

Closed jorunfa closed 5 years ago

jorunfa commented 5 years ago

An expansion on #149, to clean up some of the button related code.

@simonnorberg, it's working for me, but do you have the possibility of checking if you get any memory leaks with this version/branch? Ref the changes in 73169c9

simonnorberg commented 5 years ago

Hi, it seems to work fine. I have not encountered any leaks.

Probably unrelated, but I saw this in Logcat while testing.

2019-02-21 16:07:13.878 E/ConnectSDK: Failed to parse header-enrichment-token
    org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject
        at org.json.JSON.typeMismatch(JSON.java:111)
        at org.json.JSONObject.<init>(JSONObject.java:163)
        at org.json.JSONObject.<init>(JSONObject.java:176)
        at com.telenor.connect.headerenrichment.GetHeaderEnrichmentGifTask.convertHeTokenResponse(GetHeaderEnrichmentGifTask.java:61)
        at com.telenor.connect.headerenrichment.GetHeaderEnrichmentGifTask.doInBackground(GetHeaderEnrichmentGifTask.java:47)
        at com.telenor.connect.headerenrichment.GetHeaderEnrichmentGifTask.doInBackground(GetHeaderEnrichmentGifTask.java:18)
        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)
jorunfa commented 5 years ago

Great, thanks for testing!

Are you testing in the production (not-staging) environment? If so it's currently expected, because we had to delay instant verification rollout in our backend to next week.

simonnorberg commented 5 years ago

Ok, yes I am testing production.

simonnorberg commented 5 years ago

Hello, I'm afraid the CustomTabsServiceConnection memory leak is back in 1.9.4. I don't know why we didn't catch it in test. Would it be possible to restore the weak reference fix?

jorunfa commented 5 years ago

Can do. We will revert the refactor and make a new release.

jorunfa commented 5 years ago

@simonnorberg, as a curiosity, are you using Activity or Application context to initialise the SDK?

simonnorberg commented 5 years ago

Application

jorunfa commented 5 years ago

@simonnorberg: Released v1.9.5 to fix the problem.

By the way, if you are upgrading, could you check out/try v1.11.1-beta in your app and see that it doesn't crash or has any other glaring problems? It has the instant verification feature enabled, also for production. It should give you a very snappy login, assuming you have mobile data enabled.

simonnorberg commented 5 years ago

Great, thanks!

I will try v1.11.1-beta also.