2015-08-28 63 views
3
  String appLinkUrl, previewImageUrl; 
      final String TAG = "fbv4"; 
      appLinkUrl = "https://fb.me/1161673067......"; 
      previewImageUrl = "mydomain.com/my_invite_image.jpg"; 

      if (AppInviteDialog.canShow()) 
      { 
       AppInviteContent content = new AppInviteContent.Builder() 
         .setApplinkUrl(appLinkUrl) 
         .setPreviewImageUrl(previewImageUrl) 
         .build(); 
       AppInviteDialog.show(MainActivity.this, content); 
       AppInviteDialog appInviteDialog = new AppInviteDialog(activity); 
       appInviteDialog.registerCallback(callbackManager, new FacebookCallback<AppInviteDialog.Result>() 
       { 

        @Override 
        public void onSuccess(AppInviteDialog.Result result) 
        { 
         Log.d(TAG, "onSuccess result = " + result.getData().toString()); 
        } 

        @Override 
        public void onCancel() 
        { 
        } 

        @Override 
        public void onError(FacebookException e) 
        { 
         Log.d(TAG, "onError message = "+ e.getMessage()); 
        } 
       }); 

       appInviteDialog.show(content); 
      } 

這是我的facebook代碼,邀請朋友用facebook-sdk.4.0。我的邀請對話與好友列表正常打開,並顯示邀請發送正確,但沒有邀請到達好友。在記錄所有過程中取得成功是正確的,但我沒有得到任何我的應用程序的通知。Facebook朋友邀請已成功發送,但沒有收到任何迴應的數據在facebook-sdk.4.0 android

+1

收件人可能已經阻止了所有的應用邀請。 – derabbink

+0

http://stackoverflow.com/a/30374275/3647974可能這個幫助嗎? –

+0

是的,它會工作需要更改設置帳戶 –

回答

0

@zephyr

是的,我面臨的通知阻止來自Facebook的用戶設置的問題,請試試這個,所以也許這將有助於您以及它爲我工作。

Click in the top right of Facebook and select Settings 
Click Notifications in the left menu 
Click Edit next to On Facebook 
Click Edit next to App requests and activity 
Click to set the notifications for the app or game to On 
相關問題