Android Linkedin SDK DeepLink automatically crash - android

I am trying to "Deeplink" to some user profile on my Android application
but the app always reacts the same way. It opens the offical Linkedin Application, which crashes immediatly, and then it doesn't enter in the callback (onDeepLinkError)...
I tried both openCurrentProfile and openOtherProfile methods...
My session is valid, and I am authenticated, everything's good on that side.
Here is my piece of code :
DeepLinkHelper deepLinkHelper = new DeepLinkHelper();
deepLinkHelper.openCurrentProfile(getActivity(), new DeepLinkListener() {
#Override
public void onDeepLinkSuccess() {
}
#Override
public void onDeepLinkError(LIDeepLinkError error) {
Log.e("ERROR", error.toString());
}
});
EDIT : It seems to crash only on my smartphone, I ran the app on a friend device, and I works properly... Any ideas would be extremely apprieciated :D

Related

android snapchat login kit's LoginResultCallback doesn't work normally

I implemented the snapchat login in my Android app by referring to the snapchat login kit sdk guide.
I refer to the below code that uses a custom button.
// Get the login API
SnapLogin snapLogin = SnapLoginProvider.get(getContext());
View yourButtonView = findViewById(...);
yourButtonView.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// Start token grant
snapLogin.startTokenGrant(new LoginResultCallback() {
#Override
public void onStart() {
// Here you could update the UI to show login start
}
#Override
public void onSuccess(#NonNull String accessToken) {
// Here you could update the UI to show login success
}
#Override
public void onFailure(#NonNull LoginException exception) {
// Here you could update the UI to show login failure
}
});
}
});
Call startTokenGrant api to complete authentication in snapchat.
After authentication, callback is called when returning to my app.
Step 1 goes well.
But intermittently, the callback is not called.
I thought this was an error in the sdk, but I saw that it works normally in other apps.
Has anyone had an experience where the callback never gets called?
If yes, please help how to solve it.
(I'm developing using dev clientId right now, will this have any effect?)

logging in to facebook from my app works on emulator but not on device

This is my code for logging in to facebook.
mLoginButton = (LoginButton) findViewById(R.id.login);
// restore session if one exists
SessionStore.restore(Utility.mFacebook, this);
SessionEvents.addAuthListener(new FbAPIsAuthListener());
SessionEvents.addLogoutListener(new FbAPIsLogoutListener());
/*
* Source Tag: login_tag
*/
mLoginButton.init(this, AUTHORIZE_ACTIVITY_RESULT_CODE, Utility.mFacebook, permissions);
if (Utility.mFacebook.isSessionValid()) {
requestUserData();
}
public class FbAPIsAuthListener implements AuthListener {
//#Override
public void onAuthSucceed() {
requestUserData();
}
//#Override
public void onAuthFail(String error) {
mText.setText("Login Failed: " + error);
}
}
/*
* The Callback for notifying the application when log out starts and
* finishes.
*/
public class FbAPIsLogoutListener implements LogoutListener {
//#Override
public void onLogoutBegin() {
mText.setText("Logging out...");
}
///#Override
public void onLogoutFinish() {
mText.setText("You have logged out! ");
mUserPic.setImageBitmap(null);
}
}
On emulator it works perfect. I have tried in ton 3 devices, that have already facebook installed and here is the problem.
it just spinning aroun on loading and it does nothing. I see the login button again.
Then i tried to logout from the original facebook application, and when pressing the login button on my app, i see the login window but now that I used to see when logging in the emulator but the login window of the original facebook application. Like is has started this one.
the code I am using is taken from the hackbook.java
The Platform Status says that there's a problem with the SSO.
The SSO only works if you have the facebook application installed on the android device, and what you describe fits right into all of this.
On the emulator you don't have the facebook application, and so when your application tries to log the user in it uses the dialog it has in the sdk instead of using the SSO process that ships with the fb application.
On the device how ever you said that you do have the fb app, and so the SSO kicks in and, at least currently, there's a problem with it.
Try to uninstall the facebook application on the device or maybe just cancel the SSO, i.e.: How to disable Facebook single sign on for android - Facebook-android-sdk
You need to generate the hash key of your system and just place it by editing the existing facebook App.

FACEBOOK/TWITTER login no longer work on Android app after updating Facebook APK (login disappears immediately!)

I have an App that allows users to log in with their twitter, facebook, and gmail so I can send them updates to each. I just downloaded the newest facebook APK and now I every time I click on the twitter or facebook logins, the login only shows up for a split-second and then disappears. Here's what I've changed:
public static Facebook load(Context context) {
Facebook fb = new Facebook(context.getString(R.string.facebook_App_ID));
restore(fb, context);
return fb;
}
--It didn't used to take the APP_ID as a parameter but the new APK enforces you to do it here I believe.
facebook.authorize(this, PERMISSIONS,new LoginDialogListener());
-- This previously took the APP_ID as a parameter but now it is passed in when the facebook object is created.
--NOTE: I already tried using FORCE_DIALOG_AUTH and that did not work.
private final class LoginDialogListener implements DialogListener
{
public void onComplete(Bundle values) {
System.out.println("fb success");
FacebookHelper.save(facebook, SMTPSettings.this);
updateFacebookSumamry();
}
public void onFacebookError(FacebookError error) {
L.p("loginDialogListener",4900374);
System.out.println("fb error " + error.getMessage());
}
public void onError(DialogError error) {
L.p("loginDialogListener",4900387);
System.out.println("fb error " + error.getMessage());
}
public void onCancel() {
L.p("loginDialogListener",4900392);
System.out.println("fb cancel");
}
}
-I haven't changed anything with my dialogListener. But every time the control moves to the Dialoglistener it just goes straight into the onError function.
Twitter login no longer works but gmail still does. I don't know exactly what i changed that makes twitter no longer work too, but any help or tips would be greatly appreciated!
Thanks!
For anyone that has seen this, I thought I might post what I remember solved the problem. I uninstalled the other facebook apps I had on my phone like Andreas said above. That didn't solve it immediately, but restarting the phone made it work perfectly. I think it had to do with clearing out temporary memory files or something...not a very complicated problem, but all else fails, give it a clean restart!

Android Facebook API - sending an app invite to a friend

I managed to login to Facebook / get permissions.. retrieve friends data, names/ids etc.
The issue is that I cannot send an app invite to my friends. I'd like to send the invite without a dialog to a single person. But it seems that's wishful thinking. Now I'd settle for anything. It seems nothing will do the job!
I tried the dialog provided by Facebook Graph API but it tells me that the display is not supported (error 103). Also tried the fix modifying the url inside the Facebook SDK to not point to the mobile version and set the display as popup. Still no good (same error);
Any thoughts on this?
Thank you in advance.
(BTW, it seems to me like Facebook is a very unreliable service!)
This code will bring up an app invite dialog (and I don't know how to send an invite without a dialog). Note: assumes that facebook has been successfully authorized/logged in:
Facebook facebook = new Facebook( MY_APP_ID );
...
Bundle parameters = new Bundle();
parameters.putString( "message", "Check this out!" );
facebook.dialog( activity, "apprequests", parameters,
new Facebook.DialogListener()
{
public void onComplete() { ... }
public void onFacebookError( FacebookError e ) { ... }
public void onError(DialogError e) { ... }
public void onCancel() { ... }
} );

Facebook single sign-on not redirecting back to my application

I have a scenario where Facebook application is installed in the device but not logged in by the user.
Now when I try to login throw my application its taking me to the Facebook applications login screen, After login its asking me to allow/block. Now Ideally It should take me back to my application but its not, It stays into the Facebook app.
Its working fine if the user is already logged in to the Facebook App.
If anyone has any idea on this issue please help...
Thanks.
You need to catch Authentication events in AuthListener and then return to your activity through finish.
/* AuthListener Methods */
#Override
public void onAuthFail(String error) {
Log.e(TAG, "AuthFailed: " + error);
this.finish();
}
#Override
public void onAuthSucceed() {
Log.e(TAG, "AuthSucceed");
this.finish();
}

Categories

Resources