我想从Facebook发送我的应用邀请。我写的代码能够发送邀请,但我面临两个问题。
在大多数设备中,邀请对话框具有默认语言Hindi(Click for Screenshot)。如何将默认值更改为英语? PS:我在Facebook开发者帐户应用程序中检查了默认语言是英语 任何帮助将不胜感激。
String AppURl = "<My Facebook App URL>";
String previewImageUrl = "<Preview Image URL>";
sCallbackManager = CallbackManager.Factory.create();
AppInviteDialog appInviteDialog = new AppInviteDialog(getActivity());
appInviteDialog.registerCallback(sCallbackManager,
new FacebookCallback<AppInviteDialog.Result>() {
@Override
public void onSuccess(AppInviteDialog.Result result) {
Log.d("Invitation", "Invitation Sent Successfully");
Toast.makeText(getActivity(), "Invitation Sent Successfully", Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException e) {
Log.d("Invitation", "Error Occured");
}
});
if (AppInviteDialog.canShow()) {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(AppURl)
.setPreviewImageUrl(previewImageUrl)
.build();
appInviteDialog.show(content);
}