Google plus shared url not rendering

I use the URL for google plus PlusShare.Builder, but not its rendering.

Its rendering is successful when I just copy the url in google plus but it doesn't work on the android side.

this is my url

Plz tell me my code .. is there anything in my code.

private void shareToGooglePlus(String urlToShare){
        PlusShare.Builder builder = new PlusShare.Builder(getActivity());

        // Set call-to-action metadata.
        builder.addCallToAction(
                "CREATE_ITEM", /** call-to-action button label */
                Uri.parse("http://plus.google.com/pages/create"), /** call-to-action url (for desktop use) */
                "/pages/create" /** call to action deep-link ID (for mobile use), 512 characters or fewer */);

        // Set the content url (for desktop use).
        builder.setContentUrl(Uri.parse("https://plus.google.com/share?url="+ urlToShare));
        // Set the share text.
        builder.addStream(Uri.parse(urlToShare));
        builder.setText(urlToShare);

        startActivityForResult(builder.getIntent(), 0);
    }
+4
source share
1 answer

You tried

Intent shareIntent = new PlusShare.Builder(this)
        .setText("CREATE_ITEM")
        .setType("text/plain")
        .setContentUrl(Uri.parse("https://plus.google.com/share?url="+ urlToShare)
        .setContentDeepLinkId(Uri.parse("/pages/create"))
        .getIntent();

startActivityForResult(shareIntent, 0);

Check the source in case you don’t have the correct code configured: https://developers.google.com/+/mobile/android/share/deep-link

IDK, addCallToAction , https://developers.google.com/android/reference/com/google/android/gms/plus/PlusShare.Builder#addCallToAction(java.lang.String,%20android.net.Uri,%20java.lang.String) PlusClient , : fooobar.com/questions/1680198/...

,

+3

Source: https://habr.com/ru/post/1680197/


All Articles