Skip to main content
Version: 1.6.0

Sending Viral Posts to Social Media Feed

This module allows the app to prompt users to share a viral post image/text on their social media feed.

This feature is Android-only. All settings are marked ๐Ÿค–.
Under the hood, the SDK uses Android intents to share content.

Configuration is done via the Settings Inspector in Unity.

Configuration is applied automatically at build time for each platform.

Platform markersโ€‹

The following markers are used to indicate platform availability of parameters and features:

  • (no marker) โ€” Shared parameter or feature
  • ๐Ÿ โ€” iOS-specific parameter or feature
  • ๐Ÿค– โ€” Android-specific parameter or feature
  • โš ๏ธ โ€” Not implemented in the Unity plugin yet

Ask your release manager for the required parameters before configuring the SDK.

Configure ๐Ÿค–โ€‹

Configuration is done via the Settings Inspector.

FieldDescription
Viral Post Text ๐Ÿค–Default text included in the shared viral post
Viral Post Image Path ๐Ÿค–Path/URL to the image used for the viral post
Viral Post Enabled ๐Ÿค–Enables/disables the โ€œsend viral postโ€ feature

These values must be set in the Unity Settings Inspector.


Usage (Unity / C#)โ€‹

The SDK exposes a method to trigger a viral post share intent.

Send a Viral Postโ€‹

// Uses default text and image configured in the Settings Inspector
P101XP.GetInstance().SendViralPost();

This will open the Android share intent with the configured post text and image.


Optional Overrides ๐Ÿค–โ€‹

If you want to override the text or image at runtime, you can pass arguments:

P101XP.GetInstance().SendViralPost(
text: "Check out my score!",
imagePath: "/sdcard/Android/data/.../viral_image.png"
);

Both parameters are optional; if omitted, the SDK uses defaults from the inspector.


Notesโ€‹

  • This feature is Android-only and depends on installed apps that can handle share intents.
  • If no compatible app is installed, the share dialog may not appear.
  • Images must be accessible by Android file providers (frequently via cache/temporary paths) for intents to share them.

Exampleโ€‹

// Hook to a UI button
public void OnShareButtonClicked()
{
P101XP.GetInstance().SendViralPost(
text: "I just leveled up!",
imagePath: Application.persistentDataPath + "/share.png"
);
}

Once called, this opens the Android share dialog with the provided content.


Summaryโ€‹

PlatformSupported
Android ๐Ÿค–โœ”๏ธ
iOS ๐Ÿโš ๏ธ (no official support documented)