Reputation: 4769
I'm testing QuickBlox Android API. All the samples works fine at my environment. So I try to create a Android library project to separate everything about Chat, because I will use this functionality in other projects so I want to reuse some code.
But It didn't work. When I use my library(with QuickBlox jar there) in a Android project I can't create a session.
Below, you will see my code to create a Session:
QBSettings.getInstance().fastConfigInit(getAppId(), getAuthKey(), getAuthSecret());
QBAuth.createSession(new AuthenticationCallback(this));
It never calls the method public void onComplete(Result result) from the QBCallback I passed.
I got this log below on the logcat
=== REQUEST ==== 76e23110-eda0-470d-bc7f-65f93d83c1ba === REQUEST POST https://api.quickblox.com/session.json HEADERS QuickBlox-REST-API-Version=0.1.1 QB-SDK=Android 1.2.3 PARAMETERS application_id= [MY APP ID NUMBER] auth_key= [MY APP AUTH KEY] nonce=-1363221055 timestamp=1407524693 signature=0e763d80ac3ebb60f266f3faef59c21994d535b8 INLINE POST https://api.quickblox.com/session.json?application_id=MY_APP_ID&auth_key=MY_AUTH&nonce=-1363221055×tamp=1407524693&signature=0e763d80ac3ebb60f266f3faef59c21994d535b8
Everything works fine if use this code directly in my project without using a Android project library.
So What I'm doing wrong?
Thanks!
Upvotes: 0
Views: 556
Reputation: 527
I had the same issue, nothing logged, I finally just guessed that I hadn't given permission to the app to connect to the internet. Make sure to add internet access in your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
Fixed my issue right up! Wish that was logged someplace to make it more obvious, wasted a few hours on this!! Silent fails suck!!
Upvotes: 2