Mobile Native Share Adds Drupal 12 Support and Renderer Service

Hero graphic for Mobile Native Share 1.2.x showing Drupal 12 support, a renderer service update, accessibility improvements, portraits of Lap Pham and Alexander Shabanov, and logos for Kyanon Digital and Attico International.

Developers using the Mobile Native Share module now have a dedicated renderer service for generating share buttons in custom Drupal implementations. Version 1.2.0, announced in a LinkedIn post by Alexander Shabanov, adds Drupal 12 compatibility while continuing to support Drupal 10.1 and Drupal 11.

The module was created by Lap Pham, a Vietnamese Drupal developer known on Drupal.org as phthlaap. Drupal.org lists Lap as the project creator and one of its maintainers, alongside Alexander.

The release is significant for developers because it moves rendering logic out of procedural hooks and into the mobile_native_share.renderer service. The service implements MobileNativeShareRendererInterface, allowing share button render arrays to be generated programmatically in custom blocks, controllers, routes, and other custom implementations.

Administrators gain three display options through the module settings form: Icon and Text, Icon Only, and Text Only. The update also refactors the Twig template to use semantic <button type="button"> markup instead of <a> anchors. It adds dynamic aria-label handling for icon-only output, marks decorative icons with alt="" and aria-hidden="true", and improves keyboard focus styles.

The release also adds stricter validation for custom icon configuration in MobileNativeShareSettings::validateForm(). The field checks whether a submitted value is a proper URL or a valid relative path, limits icon paths to allowed image extensions such as png, jpg, jpeg, gif, and svg, and applies stripDangerousProtocols during form validation before configuration is saved.

The module adds a native share button to Drupal entities by using the Web Share API where supported and fallback behaviour where it is not. It supports configurable share buttons for nodes, taxonomy terms, and comments, and can be extended to other entity types through hook_mobile_native_share_entity_types_alter().

Site owners can install the release with composer require 'drupal/mobile_native_share:^1.2'. The project has since published version 1.2.1, released on 28 June 2026 at 15:32 UTC, which adds automatic field definition cache invalidation when module configuration is saved, so the Manage display form updates without a full cache rebuild.

Disclosure: This content is produced with the assistance of AI.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Related Organizations

Upcoming Events