New activity not keeping facebook access token - java

Basically I'm using the facebook sdk in my android app. However, on my scoreboard activity i need to use the access token to get my results for my high scores.
However everytime I try to use
accessToken = AccessToken.getCurrentAccessToken();
It's either null or my app crashes because it's a null pointer error.
java.lang.RuntimeException: Unable to start activity ComponentInfo{wmrapplications.plankoff/wmrapplications.plankoff.ScoreBoard}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.facebook.AccessToken.getToken()' on a null object reference
What I need it to do is retrieve the current login for the current login session.
I tried this using an "isloggedin" method.
public boolean isLoggedIn() {
accessToken = AccessToken.getCurrentAccessToken();
if (accessToken == null) {
Toast.makeText(getApplicationContext(), "no access token", Toast.LENGTH_LONG).show();
accessTokenTracker = new AccessTokenTracker() {
#Override
protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken currentAccessToken) {
// fetchUserInfo();
}
};
callbackManager = CallbackManager.Factory.create();
} else {
Toast.makeText(getApplicationContext(), " access token", Toast.LENGTH_LONG).show();
Token = accessToken.getToken().toString();
}
return accessToken != null;
}
along with a fetchinfo function
private void fetchUserInfo() {
accessToken = AccessToken.getCurrentAccessToken();
Toast.makeText(getApplicationContext(),
"Relogin successful?" + AccessToken.getCurrentAccessToken().getToken().toString(), Toast.LENGTH_LONG)
.show();
if (accessToken != null) {
GraphRequest request = GraphRequest.newMeRequest(accessToken, new GraphRequest.GraphJSONObjectCallback() {
#Override
public void onCompleted(JSONObject me, GraphResponse response) {
// LinkFacebook(socialService);
// FindFriends(socialService);
Token = accessToken.getToken().toString();
}
});
Bundle parameters = new Bundle();
parameters.putString(FIELDS, REQUEST_FIELDS);
request.setParameters(parameters);
GraphRequest.executeBatchAsync(request);
} else {
Toast.makeText(getApplicationContext(), "Relogin failed.", Toast.LENGTH_LONG).show();
}
}
However my accesstoken is still null.
Thanks

What I ended up doing was saving the token in sharedpreferences, then using it later in my app. That allowed me to use my tokens in all my activities.
Whether or not it will break later on down the line I'm not sure.

Related

Correctly check if user is logged in. Android

I have my login setup like this, I use retrofit to authenticate from the server and I'm using a token api authentication:
In the MainActivity.java method onCreate
apiInterface = ApiClient.getClient().create(ApiInterface.class);
User user = SharedPreferencesHelper.getUser(MainActivity.this);
if (user.getToken() == null) {
Intent login = new Intent(MainActivity.this, LoginActivity.class);
startActivity(login);
} else {
setContentView(R.layout.activity_main);
buildMain();
}
In the LoginActivity.java method on create (I'll summarize, the code is quite long)
loginbtn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
//get login ingo
Login login = new Login(scardI, passwordI, device_name);
Call<User> call = apiInterface.LoginUser(login);
call.enqueue(new Callback<User>() {
#Override
public void onResponse(Call<User> call, Response<User> response) {
if (response.isSuccessful()) {
User user = response.body();
//save user info into SharedPreferences
SharedPreferencesHelper.setUser(LoginActivity.this, user);
//check if user saved correctly by getting the user token
if (SharedPreferencesHelper.getUserToken(LoginActivity.this) != null) {
finish();
}
} else {
//show error message
}
}
#Override
public void onFailure(Call<User> call, Throwable t) {
//show error message
}
});
}
});
I'm having an issue, after the user logs in a blank page is displayed instead of the activity_main.xml however when I close the app and reopen it it takes me straight to the activity_main.xml as expected. Is there a reason that after the login it doesn't take me to the activity_main like expected.
An intent to MainActivity.java is missing on success. A blank screen is displayed because finish() is called.
if (response.isSuccessful()) {
User user = response.body();
SharedPreferencesHelper.setUser(LoginActivity.this, user);
if (SharedPreferencesHelper.getUserToken(LoginActivity.this) != null){
Intent i = new Intent(this, MainActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)
startActivity(i);
}
}

User location coordinates being null when passed into url

I'm building a simple five-day weather forecast Android app using the open weather map API. I am trying to insert the user coordinates into my request URL using the Google Play Services but values for latitude and longitude are null when I am passing them into the URL. I am just wondering if there is any way to solve this by passing the coordinates from the onConnected methods of the Google Play Services.
MainActivity
public class MainActivity extends AppCompatActivity implements OnConnectionFailedListener {
private GoogleApiClient mGoogleApiClient;
private Location mLastLocation;
private String latitude;
private String longitude;
private String requestUrl = "http://api.openweathermap.org/data/2.5/forecast?lat="+latitude+"&lon="+longitude+"&units=metric&APPID={insert api key here}";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Create an instance of GoogleAPIClient.
if (mGoogleApiClient == null) {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
}
new WeatherAsyncTask().execute(requestUrl);
}
public void updateUi(final ArrayList<Weather> weather) {
// Find a reference to the {#link ListView} in the layout
ListView weatherListView = (ListView) findViewById(R.id.list);
// Create a new {#link ArrayAdapter} of earthquakes
WeatherAdapter adapter = new WeatherAdapter(this, weather);
// Set the adapter on the {#link ListView}
// so the list can be populated in the user interface
weatherListView.setAdapter(adapter);
}
private class WeatherAsyncTask extends AsyncTask<String, Void, ArrayList<Weather>> {
protected ArrayList<Weather> doInBackground(String... requestUrl) {
// Dont perform the request if there is no URL, or first is null
if (requestUrl.length < 1 || requestUrl[0] == null) {
return null;
}
ArrayList<Weather> weather = QueryUtils.fetchWeatherData(requestUrl[0]);
return weather;
}
protected void onPostExecute(ArrayList<Weather> weather) {
// if there is no result do nothing
if (weather == null) {
return;
}
updateUi(weather);
}
}
// if connection not established to google play services
#Override
public void onConnectionFailed(ConnectionResult result) {
// An unresolvable error has occurred and a connection to Google APIs
// could not be established. Display an error message, or handle
// the failure silently
// ...
}
// get latitude and longitude of last known location when connected to google play services
public void onConnected(Bundle connectionHint) {
try {
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
} catch (SecurityException e) {
Log.e("MainActivity", "Security exception thrown", e);
}
if (mLastLocation != null) {
latitude = String.valueOf(mLastLocation.getLatitude());
longitude = String.valueOf(mLastLocation.getLongitude());
}
}
}
When the app is run, I get a NullPointerException. I realize that the values for latitude and longitude are null but I am not sure how to retrieve them correctly. Thanks for any help, I'm fairly new at android development.
P.S. I have omitted the API key from the URL
Please refer this guide : Retrieving-Location-with-LocationServices-API
First of all LocationServices.FusedLocationApi.getLastLocation will return you a location if any recent app used location(device has recent location) otherwise it will return null.
So in case of null value you must check it inside onConnected .
For getting non null location you must listen devices location.(FusedLocationApi, LocationManager ...)
Also you must check permission for Android M higher devices, luckily you are using FusedLocationApi inside your Activity.
Basic sample of my code :
#Override
public void onConnected(#Nullable Bundle bundle) {
if( HelperUtils.isGpsOpen(getApplicationContext()) ) {
startListenLocation();
}
}
#Override
public void startListenLocation() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
//ask permission whatever you want to do
} else {
if(mGoogleApiClient==null) {
buildGoogleApiClient();
} else {
if(mGoogleApiClient.isConnected()) {
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(UPDATE_INTERVAL);
mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
Location mCurrentLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
//here I am checking null thats where you get null
if(mCurrentLocation!=null) {
mPresenter.onNewLocation(getDeviceId(),mCurrentLocation.getLatitude(),mCurrentLocation.getLongitude());
}
// then I am tracking user location , this will trigger onLocationChanged method when a new location arrived so you can handle new location
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
} else {
if(!mGoogleApiClient.isConnecting())
buildGoogleApiClient();
}
}
}
}
#Override
public void onLocationChanged(Location location) {
// I am just checking null again, more cautious I am :)
if(location!=null) // handle it
}
Then important part is remove location requests when your Activity's onPause or onDestroy :
if(mGoogleApiClient!=null){
LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
if(mGoogleApiClient.isConnected()) mGoogleApiClient.disconnect();
}

Android: Google Sign in Integration with Sashido (Parse.com SDK) without Cloud Code

I'm writing this question and answer because I haven't seen a full solution to the integration of Google sign in on Android using Facebook's Parse SDK (or Sashido in my case) as a back-end without cloud code.
Related Questions:
How to link Google + signed in users on Parse backend on Android?
Google Plus Login issues - Parse.com
How would one go about integrating Google Sign in with Parse back-end without Cloud Code?
First of all, follow the steps provided by Android Developers on starting and implementing the integration.
Start Integrating Google Sign-In into Your Android App
Integrating Google Sign-In into Your Android App
In the onCreate your activity you need to build the GoogleSignInOptions
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
You can get your web_client_id when you add Google Services to your project to your Google Developers account. Find out more at: Creating a Google API Console project and client ID
Build your GoogleApiClient (make it a global instance private GoogleApiClient mGoogleApiClient;)
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {
#Override
public void onConnectionFailed(#NonNull ConnectionResult connectionResult) {
Log.e("Failed", "failed" + connectionResult.getErrorMessage());
}
})
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
Listen out for the click on the dedicated button for your Google sign in and then start a Auth.GoogleSignInApi.getSignIntent(mGoogleApiClient);
case R.id.btn_google:
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
break;
Make sure you've assigned a value to RC_SIGN_IN (I've done 1000)
Now start adding implementation to your onActivityResult method
// Result returned from launching the Intent from
// GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleSignInResult(result);
} else {
ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
}
Now to handle the sign in request:
`private void handleSignInResult(GoogleSignInResult result) {
Log.e("handleSignIn", "handleSignInResult:" + result.isSuccess());
if (result.isSuccess()) {
// Signed in successfully, show authenticated UI.
final GoogleSignInAccount acct = result.getSignInAccount();
if (acct != null) {
ParseQuery<ParseObject> query = ParseQuery.getQuery("_User");
query.setLimit(10000);
query.whereEqualTo("email", acct.getEmail());
query.findInBackground(new FindCallback<ParseObject>() {
#Override
public void done(List<ParseObject> objects, ParseException e) {
if (e == null) {
if (objects.size() == 0) {
saveNewUserGoogle(acct);
} else {
loginGoogleUser(objects.get(0), acct);
}
} else {
saveNewUserGoogle(acct);
}
}
});
}
} else {
Log.e("failed", "failed to sign in");
// Signed out, show unauthenticated UI.
}
}`
So what this method does is if the request to the GoogleSignIn Request is successful, get the account details, query the _User table in your database and to see if the email with the account matches. If it does, Log the user in.
private void loginGoogleUser(ParseObject j, GoogleSignInAccount acct) {
ParseUser.logInInBackground(j.getString("username"), String.valueOf(acct.getId()), new LogInCallback() {
public void done(ParseUser user, ParseException e) {
if (user != null) {
Intent i = new Intent(AllLoginActivity.this, MainActivity.class);
startActivity(i);
finish();
} else {
Log.e("failed", "could not be validated");
}
}
});
}
else sign the user up:
private void saveNewUserGoogle(GoogleSignInAccount acct) {
google = true;
final ParseUser user = new ParseUser();
String mFullName = acct.getDisplayName();
String mEmail = acct.getEmail();
String mProfilePic = String.valueOf(acct.getPhotoUrl());
String mUsername = acct.getId();
String password = acct.getId();
user.setUsername(mUsername);
user.setEmail(mEmail);
user.setPassword(password);
user.put("userEmail", mEmail);
user.put("uniqueID", mUsername);
user.put("name", mFullName);
user.put("loginMethod", "Google");
user.put("profilePicture", mProfilePic);
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
Log.e("SaveTest", "Successful");
//sign user up
} else {
switch (e.getCode()) {
case ParseException.USERNAME_TAKEN:
Toast.makeText(context, "Sorry, this username has already been taken.", Toast.LENGTH_SHORT).show();
break;
case ParseException.USERNAME_MISSING:
Toast.makeText(context, "Sorry, a username is needed", Toast.LENGTH_SHORT).show();
break;
case ParseException.PASSWORD_MISSING:
Toast.makeText(context, "Sorry, a password is needed.", Toast.LENGTH_SHORT).show();
break;
case ParseException.OBJECT_NOT_FOUND:
Toast.makeText(context, "invalid credentials", Toast.LENGTH_SHORT).show();
break;
case ParseException.CONNECTION_FAILED:
Toast.makeText(context, "Sorry, internet is needed.", Toast.LENGTH_SHORT).show();
break;
default:
Log.d("Testing", e.getLocalizedMessage());
break;
}
}
}
});
}
So for this if you set the password on Parse as the clientID it'll be unique to that user and can be read by Parse and given by Google.
Note: I'm setting the username as the Google Identifier and then when they have successfully connected and signed up I display a username dialog box where they enter a username, so it can be displayed as something in plain text rather than numerics.

Getting a Malformed access token "t ​ype":"OAuthException","code":190

I am writing an android application to get the Facebook user albums and photos and display in my Android application.
I have created a Facebook App with APP_ID 281846961912565.
While creating the Facebook instance, I am passing this id as follows
facebook = new Facebook(APP_ID);
Using this instance, I am able to login to my FB account post on messages on facebook wall programatically.
After logging in, I get an access_token.
I'm using the access token to get the album ids using facebook.request("https://graph.facebook.com/me/albums?access_token="+facebook.getAccessToken());
Now I get {"error":{"message":"Malformed access token ACCESSTOKENACCESSTOKEN?access_token=ACCESSTOKENACCESSTOKEN","t‌​ype":"OAuthException","code":190}}
Can any of you please help me resolve this issue and point out what i am doing wrong.
My code is as follows:
private static final String[] PERMISSIONS = new String[] { "publish_stream","user_photos" };
public boolean saveCredentials(Facebook facebook) {
Editor editor = getApplicationContext().getSharedPreferences(KEY,
Context.MODE_PRIVATE).edit();
editor.putString(TOKEN, facebook.getAccessToken());
editor.putLong(EXPIRES, facebook.getAccessExpires());
return editor.commit();
}
public boolean restoreCredentials(Facebook facebook) {
SharedPreferences sharedPreferences = getApplicationContext()
.getSharedPreferences(KEY, Context.MODE_PRIVATE);
facebook.setAccessToken(sharedPreferences.getString(TOKEN, null));
facebook.setAccessExpires(sharedPreferences.getLong(EXPIRES, 0));
return facebook.isSessionValid();
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
facebook = new Facebook(APP_ID);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.facebook_dialog);
String facebookMessage = getIntent().getStringExtra("facebookMessage");
if (facebookMessage == null) {
facebookMessage = "Test wall post";
}
messageToPost = facebookMessage;
}
R.layout.facebook_dialog is the dialog which pops up asking if a message should be shared on facebook or not. If yes the following method is called.
public void share(View button) {
if (!facebook.isSessionValid()) {
loginAndPostToWall();
} else {
postToWall(messageToPost);
}
}
public void loginAndPostToWall() {
facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH,
new LoginDialogListener());
}
class LoginDialogListener implements DialogListener {
public void onComplete(Bundle values) {
saveCredentials(facebook);
if (messageToPost != null) {
postToWall(messageToPost);
}
}
public void onFacebookError(FacebookError error) {
showToast("Authentication with Facebook failed!");
finish();
}
public void onError(DialogError error) {
showToast("Authentication with Facebook failed!");
finish();
}
public void onCancel() {
showToast("Authentication with Facebook cancelled!");
finish();
}
}
public void postToWall(String message) {
Bundle parameters = new Bundle();
parameters.putString("message", message);
parameters.putString("description", "topic share");
try {
facebook.request("me");
String response = facebook.request("me/feed", parameters, "POST");
Log.d("Tests", "got response: " + response);
if (response == null || response.equals("")
|| response.equals("false")) {
showToast("Blank response.");
} else {
showToast("Message posted to your facebook wall!");
}
getImagesFromUserAlbum();
finish();
} catch (Exception e) {
showToast("Failed to post to wall!");
e.printStackTrace();
finish();
}
}
Later when I do a `private void getImagesFromUserAlbum() {
facebook.getAccessToken();
JSONArray albumss = null;
String response = null;
try {
response = facebook.request("me/albums");
// `
I get the error
{"error":{"message":"Malformed access token ACCESSTOKEN?access_token=ACCESSTOKEN","type":"OAuthException","code":190}}
Thanks for your help.
The code above is now the working copy. Thanks to Bartek.
If you look at the Errors page in the documentation you will see that when you get error 190 you should authorise/reauthorise the user.
I suspect that this happened to you because you first logged in, then added the permissions to access the albums to your application BUT did not log out and log back in. Hence, you need to obtain a new access token which will grant the new permissions to your application.
Please check is there &expires in your access token if yes then remove it because it is not part of access_token and try after that.

Using OAuth with Scribe on Android

Hi I'm using the scribe library for OAuth communication with LInkedIn.
I have a login class and a query class.
The login class creates a service to get my request token and secret and creates my access token. The access token is then saved to the preferences file. This seems to work fine and I can make a successful api call after all the tokens have been created.
In my OAuth query class i retrieve the access token, create another service and try to make an API call, but when ever I load an activity which makes calls this class it causes my app to crash. I have tested to make sure that the access token is saved and they are.
Here is my login class
public class Login_LinkedIn extends Activity
{
SharedPreferences settings;
OAuthService service;
Token requestToken;
Button home;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.webauth);
initControls();
service = new ServiceBuilder()
.provider(LinkedInApi.class)
.apiKey( getString(R.string.apiKey) )
.apiSecret( getString(R.string.secKey) )
.callback( getString(R.string.callBack) )
.build();
requestToken = service.getRequestToken();
final String authURL = service.getAuthorizationUrl(requestToken);
final WebView webview = (WebView) findViewById(R.id.webView);
//attach WebViewClient to intercept the callback url
webview.setWebViewClient(new WebViewClient()
{
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
//check for our custom callback protocol
//otherwise use default behavior
if(url.startsWith( getString(R.string.callBack) ))
{
//authorization complete hide webview for now.
webview.setVisibility(View.GONE);
Uri uri = Uri.parse(url);
String verifier = uri.getQueryParameter("oauth_verifier");
Verifier v = new Verifier(verifier);
//save this token for practical use.
Token accessToken = service.getAccessToken(requestToken, v);
OAuthRequest request = new OAuthRequest(Verb.GET, "http://api.linkedin.com/v1/people/~:(first-name,last-name)");
service.signRequest(accessToken, request);
Response response = request.send();
xmlHandler xh = new xmlHandler(response.getBody());
settings = getSharedPreferences("preferences", 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("accessToken", accessToken.getToken());
// The requestToken is saved for use later on to verify the OAuth request.
// See onResume() below
editor.putString("requestToken", requestToken.getToken());
editor.putString("requestSecret", requestToken.getSecret());
editor.putString("first-name", xh.getValue("first-name"));
editor.putString("last-name", xh.getValue("last-name"));
editor.commit();
return true;
}
return super.shouldOverrideUrlLoading(view, url);
}
});
//send user to authorization page
webview.loadUrl(authURL);
}
#Override
protected void onResume()
{
super.onResume();
Intent i = getIntent();
if(i != null)
{
Uri uri = i.getData();
if(uri != null)
{
String oauthVerifier = uri.getQueryParameter("oauth_verifier");
Verifier verifier = new Verifier(oauthVerifier);
requestToken = new Token(settings.getString("requestToken", null), settings.getString("requestSecret", null));
Token accessToken = service.getAccessToken(requestToken, verifier);
// Save the access token.
SharedPreferences.Editor editor = settings.edit();
editor.remove("requestToken");
editor.remove("requestSecret");
editor.putString("accessToken", accessToken.getToken());
editor.putString("accessSecret", accessToken.getSecret());
editor.commit();
// Start the film list activity.
final Intent intent = new Intent(this,ProConnect.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
}
}
private void initControls()
{
home = (Button)findViewById(R.id.home);
final Intent intent = new Intent(this,ProConnect.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
home.setOnClickListener(new Button.OnClickListener()
{
public void onClick (View v)
{
startActivity(intent);
}
});
}
}
and my query class
public class oAuthQuery extends Activity
{
OAuthService service;
Token accessToken;
SharedPreferences settings;
public oAuthQuery()
{
service= new ServiceBuilder()
.provider(LinkedInApi.class)
.apiKey( getString(R.string.apiKey) )
.apiSecret( getString(R.string.secKey) )
.callback( getString(R.string.callBack) )
.build();
settings = getSharedPreferences("preferences", 0);
accessToken = new Token(settings.getString("accessToken", null), settings.getString("accessSecret", null));
}
public String query(String s)
{
OAuthRequest request = new OAuthRequest(Verb.GET, s);
service.signRequest(accessToken, request);
Response response = request.send();
return response.getBody();
}
public OAuthService getService()
{
return service;
}
}
Thanks for any help
Jeff
I solved the problem it was something stupid in the end. I had edited my code to save the access secret and the the access token but had forgotten to re-login when testing my app on my phone. This resulted in the code which saved the parts of the token was not being reached.
I still have a problem using the invite call in the LinkedIn API
invite.setOnClickListener(new Button.OnClickListener()
{
public void onClick (View v)
{
inviteXml = inviteCreator.inviteString(to, subj, body, authName, authValue);
nameField.setText(inviteXml);
titleField.setText("");
call = "http://api.linkedin.com/v1/people/~/mailbox";
request = new OAuthRequest(Verb.GET, call);
request.addPayload(inviteXml);
service.signRequest(accessToken, request);
response = request.send();
invite.setVisibility(View.GONE);
}
});
I'm not sure if this is the correct way to add the XML string to the call. The LinkedIn API doesn't specify how it is to be added. Has anyone any experience with this?

Categories