Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Social sharing

Discussion in 'Web' started by rahimaga, Jun 21, 2020.

  1. rahimaga

    rahimaga

    Joined:
    Mar 25, 2019
    Posts:
    8
    Hello,

    I'm doing a webgl game for mobile devices. I am trying to take a screenshot and share it using a button but i cannot. I have found several tutorials on this, but none works for webgl. The same happens with assets,
    none works for webgl. Im tryed with https://assetstore.unity.com/packages/tools/integration/native-share-for-android-ios-112731 , but not works too.

    Take the screenshoot and other parameters its seem easy, but i cant share.
    These are the last lines of code, Is it possible that the code refers to projects built on Android or IOS?

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.         Debug.Log( "Shared!" );
    3. #elif UNITY_ANDROID
    4.         AJC.CallStatic( "Share", Context, targetPackage, targetClass, files.ToArray(), mimes.ToArray(), subject, text, title );
    5. #elif UNITY_IOS
    6.         _NativeShare_Share( files.ToArray(), files.Count, subject, text );
    7. #else
    8.         Debug.Log( "No sharing set up for this platform." );
    9. #endif
    10.  
    I don't know how to do it, not if it's possible,
    Has anyone done something similar? or do you know any asset that works in webgl?

    Thank you.