为什么我不能够看到使用这个code应用程序的屏幕允许发布之前为Facebook照片的后期进入的形象呢? [英] Why i am not able see the screen of Application allow access for facebook photo post before Post the image using this code?

查看:223
本文介绍了为什么我不能够看到使用这个code应用程序的屏幕允许发布之前为Facebook照片的后期进入的形象呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我使用的是下面code到Uploade的照片。

虽然我unistalling的应用程序,并重新安装应用程序,并在Facebook上张贴thehoto,如果功能NEW ID是新的,然后它给我的应用程序的屏幕允许访问。
但有些时候它不给我该屏幕。我不知道什么在它的问题。

请参见code和给我Sollution。
为什么我不能够获取应用程序允许访问屏幕。
谢谢你。

在code是:

  //对于Facebook的================================== =
            按钮facebookButton =(按钮)saveButtonDialog.findViewById(R.id.facebook);
            facebookButton.setOnClickListener(新View.OnClickListener(){
                @覆盖
                公共无效的onClick(视图v){
                    saveButtonDialog.dismiss();                    saveImageFunction(); //保存图片                    facebook.authorize(TWSBIDrawMainActivity.this,新的String [] {user_photos,publish_checkins,publish_actions,publish_stream},新DialogListener(){
                        @覆盖
                        公共无效的onComplete(束值){
                            postImageonWall();
                            Toast.makeText(getApplicationContext(),图像发布在Facebook上。Toast.LENGTH_SHORT).show();
                            //文件f =新的文件(APP_FILE_PATH +/\"+filename+\".jpg);
                            //f.delete();
                        }
                        @覆盖
                        公共无效onFacebookError(FacebookError错误){
                        }
                        @覆盖
                        公共无效onerror的(DialogError E){
                        }
                        @覆盖
                        公共无效onCancel(){
                        }
                    });
                }
            });
 公共无效postImageonWall(){
    字节[]数据= NULL;    位图双= BitmapFactory.de codeFILE(APP_FILE_PATH +/\"+filename+\".jpg);
    //位图双= BitmapFactory.de codeResource(getResources(),R.drawable.icon);
    ByteArrayOutputStream BAOS =新ByteArrayOutputStream();
    bi.com preSS(Bitmap.Com pressFormat.JPEG,100,BAOS);
    数据= baos.toByteArray();
    捆绑PARAMS =新包();
    params.putString(Facebook.TOKEN,facebook.getAccessToken());
    params.putString(法,photos.upload);
    params.putByteArray(图片,数据);
    AsyncFacebookRunner mAsyncRunner =新AsyncFacebookRunner(脸谱);
    mAsyncRunner.request(NULL,则params,POST,新SampleUploadListener(),NULL);
}


解决方案

一个实心猜想:它的,因为你已经在过去允许该应用程序(应用程序ID),所以你只要登录到您的Facebook户头 - 去你的应用程序和删除该应用程序。所以下次它会问。

您尝试另一个新墨西哥大学和pwd然后还要它不是正常显示?那么我没有正确的解决方案有now..will要搜索的...但同时你可以做一件事情用另外一个应用程序ID或UNM /密码并检查您的code的!

,然后解决您的错误(我猜的原因并没有得到这样的问题还)..同时,在日志中的窗口出现从Facebook的默认app..so这一切问题happens..to删除和调用自己弹出的对话框中看到的 My答这里

感谢。

In My Application i am Using the Below Code to Uploade the Photo.

While i am unistalling the application and reinstall the application and posting thehoto on the facebook and if the faceboook id is new then it gives me the screen of application allow access. but Some time it not gives me that screen. I dont know whats the problem in it.

Please see the code and give me the Sollution. Why i am not able to get the application allow access Screen. Thanks.

the Code is:

 // For Facebook ===================================
            Button facebookButton = (Button) saveButtonDialog.findViewById(R.id.facebook);
            facebookButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    saveButtonDialog.dismiss();

                    saveImageFunction(); // to save the Image

                    facebook.authorize(TWSBIDrawMainActivity.this, new String[]{ "user_photos,publish_checkins,publish_actions,publish_stream"},new DialogListener() {                     
                        @Override                     
                        public void onComplete(Bundle values) {   
                            postImageonWall(); 
                            Toast.makeText(getApplicationContext(), "Image Posted on Facebook.", Toast.LENGTH_SHORT).show();
                            //File f = new File(APP_FILE_PATH + "/"+filename+".jpg");
                            //f.delete();
                        }                      
                        @Override                     
                        public void onFacebookError(FacebookError error) {                     
                        }                      
                        @Override                     
                        public void onError(DialogError e) {                     
                        }                      
                        @Override                     
                        public void onCancel() {                     
                        }                 
                    }); 
                }
            });


 public void postImageonWall() {             
    byte[] data = null;               

    Bitmap bi = BitmapFactory.decodeFile(APP_FILE_PATH + "/"+filename+".jpg");
    //Bitmap bi = BitmapFactory.decodeResource(getResources(), R.drawable.icon);             
    ByteArrayOutputStream baos = new ByteArrayOutputStream();              
    bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);              
    data = baos.toByteArray();                
    Bundle params = new Bundle();              
    params.putString(Facebook.TOKEN, facebook.getAccessToken());              
    params.putString("method", "photos.upload");              
    params.putByteArray("picture", data);               
    AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);              
    mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);       
} 

解决方案

A Solid Guess : Its because you have allowed this application(app id) in past so you just log-in to your facebook accout - go to your application and remove that app. so next time it will ask.

you tried another unm and pwd then also its not shown properly? then I don't have solution right now..will have to search for that...but meanwhile you can do one thing make use of another app id or unm/pwd and check your code!

and then to resolve your error (I am guessing cause didn't got such issue yet)..while log-in the window appears is from the facebook default app..so this all problem happens..to remove that and call your own pop-up dialog see My Answer Here.

Thanks.

这篇关于为什么我不能够看到使用这个code应用程序的屏幕允许发布之前为Facebook照片的后期进入的形象呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆