Facebook App Invite, Invite Friends

后端 未结 5 2046
难免孤独
难免孤独 2020-12-28 16:17

I switched to Facebook 4.0 in order to implement AppInviteDialog for Android. I followed this reference.

The dialog appears, I can select friends, invite them, I get

5条回答
  •  萌比男神i
    2020-12-28 16:40

    I am using the following code and is working fine... but After inviting friends (if you've shared android application then invitee have to check on his/her mobile application..) the invitation is not visible through browsers

    private CallbackManager sCallbackManager;
    
    public void openDialogInvite(final Activity activity) {
                String AppURl = "https://fb.me/421570...5709";  //Generated from //fb developers
    
            String previewImageUrl = "http://someurl/13_dp.png";
    
            sCallbackManager = CallbackManager.Factory.create();
    
            if (AppInviteDialog.canShow()) {
                AppInviteContent content = new AppInviteContent.Builder()
                        .setApplinkUrl(AppURl).setPreviewImageUrl(previewImageUrl)
                        .build();
    
                AppInviteDialog appInviteDialog = new AppInviteDialog(activity);
                appInviteDialog.registerCallback(sCallbackManager,
                        new FacebookCallback() {
                            @Override
                            public void onSuccess(AppInviteDialog.Result result) {
                                Log.d("Invitation", "Invitation Sent Successfully");
                                finish();
                            }
    
                            @Override
                            public void onCancel() {
                            }
    
                            @Override
                            public void onError(FacebookException e) {
                                Log.d("Invitation", "Error Occured");
                            }
                        });
    
                appInviteDialog.show(content);
            }
    
        }
    

提交回复
热议问题