Facebook Android SDK - App request not redirects to Google Play Store

旧街凉风 提交于 2019-12-05 22:01:46
Rana Pratap Singh

After spent long time I got the solution is to redirect on Google play Store via facebook app notification with android app and its working 100% with new facebook Interface and facebook SDK version 3.18.

To achieve this you have to follow few steps.

  1. Generate the app request code is.

        Bundle params = new Bundle();
    params.putString("message",
            "Learn how to make your Android apps social");
    WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(getActivity(),
            facebookSession.getFacebookSession(), params))
    
            .setOnCompleteListener(new OnCompleteListener() {
    
                @Override
                public void onComplete(Bundle values, FacebookException error) {
                    if (error != null) {
                        if (error instanceof FacebookOperationCanceledException) {
                            Toast.makeText(getActivity(),
                                    "Request cancelled", Toast.LENGTH_SHORT).show();
                        } else {
                            Toast.makeText(getActivity(),
                                    "Network Error", Toast.LENGTH_SHORT).show();
                        }
                    } else {
                        final String requestId = values.getString("request");
                        if (requestId != null) {
                            Toast.makeText(getActivity(), "Request sent",
                                    Toast.LENGTH_SHORT).show();
                        } else {
                            Toast.makeText(getActivity(),
                                    "Request cancelled", Toast.LENGTH_SHORT).show();
                        }
                    }
                }
    
            }).build();
    requestsDialog.show();
    
  2. Go to in developers.facebook.com in ur app account and then there "app details->Contact Info->Marketing URL->PASTE YOUR APPLICATION PATH OF PLAY STORE". and save it. After few hours it will work fine and you will get ur target :)

You should set a market://details?id=YOUR_APP_ID like URL for redirection URL. Then it will be redirected to the play store if the login succeeded.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!