Learn, Share, Build

227
October 11, 2017, at 4:39 PM

I am using this code...

I used the logInWithPublishPermissions for login...

    FacebookSdk.sdkInitialize(getApplicationContext());
    callbackManager = CallbackManager.Factory.create();
    shareDialog = new ShareDialog(this);
    java.util.List<String> permissionNeeds = Arrays.asList("publish_actions");
    //this loginManager helps you eliminate adding a LoginButton to your UI
//  LoginManager = LoginManager.getInstance();
    LoginManager.getInstance().logInWithPublishPermissions(
            FacebookShareActivity.this,
            Arrays.asList("publish_actions"));
    LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            sharePhotoToFacebook();
        }
        @Override
        public void onCancel() {
            System.out.println("onCancel");
        }
        @Override
        public void onError(FacebookException exception) {
            System.out.println("onError");
        }
    });

sharePhotoToFacebook

private void sharePhotoToFacebook(){

    SharePhoto photo = new SharePhoto.Builder()
            .setBitmap(bitmap)
            .setCaption("Caption")
            .build();
    SharePhotoContent content = new SharePhotoContent.Builder()
            .addPhoto(photo)
            .build();
    ShareApi.share(content,shareCallback);
//  Toast.makeText(getApplicationContext(),"Snapshot shared On Facebook",Toast.LENGTH_SHORT).show();

            //shareDialog.registerCallback(callbackManager, FacebookCallback<Sharer.Result>(), REQUEST_CODE);

}

But I want the app ask for permission it's not show the dialog of ask permission of publish.

READ ALSO
Learn, Share, Build

Learn, Share, Build

I have been learning RESTful web services and I am following this tutorial for thatMoreover, I have implemented the example code given in that tutorial but when I run it through Postman, I am getting 404 Not Found Error

244
Learn, Share, Build

Learn, Share, Build

I am fairly new to the IoTI have created a thing on AWS and I have created a client

170
Learn, Share, Build

Learn, Share, Build

Can we write intent from android device using user input? How watson recognise any number,name and address?

241
Learn, Share, Build

Learn, Share, Build

I have jar file and uses some relative addresses to the folder that it residesI want to call the jar file over ssh using JSch, but when I ran the jar file it cannot find the relative addresses

152