4

Ich nutze den ShareDialog von Facebook, um ein PrintScreen-Bild auf Facebook innerhalb meiner App zu teilen.facebook shareDialog wenn App ist ist nicht installiert - seltsames Verhalten?

Wenn Facebook App installiert ist, funktioniert es in Ordnung.

Wenn Facebook App nicht installiert ist, funktioniert es nicht. Ich sehe den "Lade" -Bildschirm und dann ist er verschwunden und nichts passiert. Der Anteil Dialogobjekt erreicht onError Rückruf mit dem FacebookException:

{FacebookGraphResponseException: (#200) Requires extended permission: publish_actions httpResponseCode: 403, facebookErrorCode: 200, facebookErrorType: OAuthException, message: (#200) Requires extended permission: publish_actions} 

Also brauche ich „publish_actions“ Erlaubnis wirklich nur für Facebook Web und nicht für Facebook-App? seltsam ..

Facebook writes: 

https://developers.facebook.com/docs/sharing/android

"If the Facebook app is not installed it will automatically fallback to the web-based dialog" 

"Now the SDK automatically checks for the native Facebook app. If it isn't installed, the SDK switches people to their default browser and opens the Feed Dialog." 

mein Code:

mShareDialog = new ShareDialog(mActivity); 

    mShareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() { 
     @Override 
     public void onSuccess(Sharer.Result result) {} 

     @Override 
     public void onCancel() {} 

     @Override 
     public void onError(FacebookException error) { 
      if (error != null) { 
       showDialog("facebook app isn't installed"); 
      } 
     } 
    }); 

    if (ShareDialog.canShow(ShareLinkContent.class)) { 

     // get a screenshot 
     Bitmap image = getScreenshot(); 

     SharePhoto photo = new SharePhoto.Builder() 
       .setBitmap(image) 
       .setCaption(getResources().getString(R.string.shareBodyText)) 
       .build(); 

     SharePhotoContent content = new SharePhotoContent.Builder() 
       .addPhoto(photo) 
       .build(); 

     mShareDialog.show(content); 
    } 

Also, warum es nicht funktioniert, wenn Facebook-App, ohne dass die "publish_actions" installiert ist und funktioniert nicht, wenn Facebook App ist nicht installiert?

Antwort

-1

Es ist eine Voraussetzung für SharePhotoContent, dass Sie die native faceboook App installiert haben müssen, um Fotos zu teilen.

Von Facebook Docs

Fotos

Leute Fotos von Ihrer App auf Facebook mit dem Anteil Dialog oder mit einer benutzerdefinierten Schnittstelle gemeinsam nutzen können.

  • Die Bilder müssen kleiner als 12 MB in Größe
  • Menschen die native Facebook für Android App installiert benötigen, Version 7.0 oder höher
Verwandte Themen