0

We have a site, for example, say https://www.example.com and then user sends this URL through Android Official Message App to some contact, then there is a preview generated using the HTML rendered, which we don't want. Like totally disabling this feature from our side.

NOTE: Android Message app does not follow the Open Graph Protocol, as I have already tried emptying the meta tags related to this protocol. That is why currently according to my research, there is no such code to disable this feature programmatically.

We want to do it using HTML so that we control it from the development side as we don't know how users are sharing our links. We can't suggest workarounds to users.

Is there anyone who has faced this and tried some tricks to solve in HTML, JavaScript or jQuery. I am also open to a server-side implementation if that is the case.

enter image description here

Tadit Dash
  • 305
  • 23
  • 60
  • 141
  • "then user sends this URL through Android Official Message App to some contact" -- there is no single "Android Official Message App". "then there is a preview generated using the HTML rendered, which we don't want" -- the behavior of an app is up to the developers of that app, not you. So long as your Web site is accessible, an app can render a preview of it, whether that app is a Web browser, a messaging client, or something else. – CommonsWare Jul 15 '19 at 13:48
  • 1
    on iOS, adding `"` at the beginning and the end of a link will stop link previews. Same goes for `.` (periods) and putting the link in the middle of a sentence. Check if this works on Android as well. Do note: there's no standard SMS app. – Zun Jul 15 '19 at 13:59
  • @CommonsWare Okay, I am talking about - https://play.google.com/store/apps/details?id=com.google.android.apps.messaging&hl=en_IN The same thing happens on iOS message app as well. I want to know if there is any standard behind this feature so that we can disable in coding. If so, let me know. – Tadit Dash Jul 15 '19 at 14:17
  • @Zun I know those tricks. But we can't tell all users to use this method. We need some trick to implement from our side. – Tadit Dash Jul 15 '19 at 14:33

1 Answers1

0

Well, it is not the exact answer for your question, but you can improvise your code to fix the open graph issue.

As per the screenshot, it seems the app is fully supporting the opengraph. I am sure open graph is not implemented correctly, that is why you don't see the image or text correctly. You might like to test the url with the facebook debugger tool from the below url, https://developers.facebook.com/tools/debug/

You can crosscheck your og implementations as below. You can make the values dynamic as per your need. See the below example (with Asp.net MVC, of course you can use your own code depending on the language). Check what you are missing.

<meta property="og:title" content="@ViewBag.OgTitle" />
<meta property="og:url" content="@ViewBag.OGUrl" />
<meta property="og:image" content="@ViewBag.OgImage" />
<meta property="og:type" content="website" />
<meta property="og:description" content="@ViewBag.OgHeadline" />

After completion retest the url on the facebook debugger tool again. If it works on the debugger, I bet it would work 100% on android messaging app.

Naibedya Kar
  • 305
  • 2
  • 9