Share to facebook, twitter,etc. Ios Please help out
Hello , everything works fine on Android but i dont know how to make it work for Ios, Please Help out.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
using System;
using System.Collections.Generic;
public class ShareMenu : MonoBehaviour
{
private bool isProcessing = false;
public string AppLinkURL { get; set; }
private string shareText = "Download This Game";
private string gameLink = "Download the game on play store at " + "\nhttps://play.google.com/store/apps/details?id=com.CrazyDrivers";
public void shareImage()
{
if (!isProcessing)
StartCoroutine(ShareScreenshot());
}
private IEnumerator ShareScreenshot()
{
isProcessing = true;
yield return new WaitForEndOfFrame();
string destination = Path.Combine(Application.persistentDataPath, System.DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".png");
Debug.Log(destination);
if (!Application.isEditor)
{
AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent");
AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));
AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri");
intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_TEXT"), shareText + gameLink);
intentObject.Call<AndroidJavaObject>("setType", "text/plain");
AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");
currentActivity.Call("startActivity", intentObject);
isProcessing = false;
}
}
}
Can you somehow help me to change this code for ios to let me share to facebook,twitter,whatsapp/Because on android it works very well. I am newbie to programming And i am very bad in english. Please someone help me.
And Sorry For bad english.
Comment
Your answer
Follow this Question
Related Questions
FB.API Callback issue 1 Answer
Online Maps on IOs 0 Answers
How to backup Build Support Modules? 0 Answers
iOS builds crashes on Unity3d 5.6.4p1 0 Answers
Unity Facebook SDK v7.9.0 totally doesn't work on iOS (Unity version 5.3.2) 1 Answer